joplin icon indicating copy to clipboard operation
joplin copied to clipboard

No notification/ alarm on joplin desktop (linux)

Open marciado opened this issue 2 years ago • 16 comments

Environment

Joplin version: 2.8.8-1 Platform: Manjaro Linux OS specifics: Installed joplin-appimage 2.8-8-1 via pacman

Steps to reproduce

  1. Create a new todo entry [ ] Test todo
  2. Set alarm e.g. 16:20
  3. Wait for the selected time
  4. Nothing happens

Describe what you expected to happen

I expected a notification but received nothing.

Logfile

2022-07-14 16:20:00: "AlarmServiceDriverNode::scheduleNotification: Triggering notification (default):", "{"appID":"net.cozic.joplin-desktop","title":"Test Todo","icon":"/tmp/.mount_joplin8YNvHq/resources/build/icons/512x512.png","message":"bla"}"
2022-07-14 16:20:00: "AlarmServiceDriverNode::scheduleNotification: node-notifier response:", "Error: Command failed: notify-send "Test Todo" "bla" --icon "/tmp/.mount_joplin8YNvHq/resources/build/icons/512x512.png" --expire-time "10000"
notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_token

Code: 127
Error: Command failed: notify-send "Test Todo" "bla" --icon "/tmp/.mount_joplin8YNvHq/resources/build/icons/512x512.png" --expire-time "10000"
notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_token

    at ChildProcess.exithandler (child_process.js:328:12)
    at ChildProcess.emit (events.js:376:20)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:376:20)
    at Pipe.<anonymous> (net.js:673:12)", "undefined"

On System -> Applications -> Joplin -> Notifications are also enabled

marciado avatar Jul 14 '22 14:07 marciado

is there a notification server running? Try running this:

notify-send "This is a Notification"

If this does not return a notification then most probably you don't have a notification server running.

Also, please attach some more info regarding your system like the wm you are using. You can run inxi for this.

inxi -F

or neofetch

AmreshSinha avatar Jul 18 '22 18:07 AmreshSinha

is there a notification server running? Try running this:

notify-send "This is a Notification"

If this does not return a notification then most probably you don't have a notification server running.

Also, please attach some more info regarding your system like the wm you are using. You can run inxi for this.

inxi -F

or neofetch

Thanks! With that command I receive a notification. So there is a notification server running? image

And I use Xorg image

marciado avatar Jul 18 '22 18:07 marciado

:thinking: Can you provide the output of:

grep -r org.freedesktop.Notifications /usr/share/dbus-1/services/

And also can you try the same with the .appImage?

AmreshSinha avatar Jul 19 '22 10:07 AmreshSinha

There is no output with this command. Is that right?

marciado avatar Jul 19 '22 10:07 marciado

There is no output with this command. Is that right?

🤔 Run the test notification command and xwininfo just after that and paste the output.

I suspect that the problem is with the AUR package and not Joplin. As AppImage works fine.

AmreshSinha avatar Jul 19 '22 11:07 AmreshSinha

The output of: notify-send "This is a Notification" xwininfo is:

Screenshot from 2022-07-19 22-15-08

Is that correct? I have installed the joplin-appimage (AUR) via Manjaro package manager pacman.

marciado avatar Jul 19 '22 20:07 marciado

The output of: notify-send "This is a Notification" xwininfo is:

Screenshot from 2022-07-19 22-15-08

Is that correct? I have installed the joplin-appimage (AUR) via Manjaro package manager pacman.

xwininfo is a command. Run this:

notify-send "This is a Notification" && xwininfo

Did you tried the appImage? Joplin AUR package is not maintained by Joplin devs. You can try asking the same in the comments of Joplin AUR page.

AmreshSinha avatar Jul 20 '22 05:07 AmreshSinha

I deinstalled joplin-appimage via package manager. And I used this script to install the original joplin. But same behavior - no notification.

xwininfo output by clicking on notification: image

marciado avatar Jul 20 '22 08:07 marciado

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

github-actions[bot] avatar Aug 19 '22 16:08 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Aug 27 '22 16:08 github-actions[bot]

Ran into the exact same bug today on Fedora 39 and Joplin 2.13.12 installed app Image via the installer

https://github.com/laurent22/joplin/blob/e027cdce265b38f25c8fd298b5d9050f6a70af08/Joplin_install_and_update.sh#L1

In the console log I got the same error as in https://github.com/laurent22/joplin/issues/6669#issue-1304870212

notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_token

What is really weird in that notify-send works just fine in the terminal.

$ notify-send "test" "just testing" --icon "/tmp/.mount_Joplin8uOpfQ/resources/build/icons/512x512.png" --expire-time "10000"
$ echo $?
0

I also tried reproducing by calling the [email protected]

https://github.com/laurent22/joplin/blob/e027cdce265b38f25c8fd298b5d9050f6a70af08/packages/lib/package.json#L74

like we do in the code

https://github.com/laurent22/joplin/blob/e027cdce265b38f25c8fd298b5d9050f6a70af08/packages/lib/services/AlarmServiceDriverNode.ts#L61

node-notifier displays the notification just fine when used standalone as well:

const notifier = require("node-notifier")

notifier.notify({
  appID: 'net.cozic.joplin-desktop',
  icon: '/tmp/.mount_Joplin8uOpfQ/resources/build/icons/512x512.png',
  title: 'My notification',
  message: 'Hello, there!'
}, function(err, res, meta){
   if(err)
     console.log("error is: ", err);

   if(meta)
     console.log("meta is: ", meta);

   if(res)
     console.log("res is: ", res);   
  });

So what gives why does it fail when called within Joplin?

It complains about notify_notification_get_activation_token which I'm not sure about. Is that something that Joplin needs to do?

The only reference to that symbol that I could find is here:

https://github.com/GNOME/libnotify/blob/7849c5ddda75250e30a6cbb50ecd9c171b7db532/tools/notify-send.c#L173

abmusse avatar Jan 05 '24 02:01 abmusse

Ran into the exact same bug today on Fedora 39 and Joplin 2.13.12 installed app Image via the installer

I'm re-opening this.

Note that it works for me on Ubuntu 23.10 (Joplin 2.13.12 -- Snap version).

node-notifier displays the notification just fine when used standalone as well:

Another thing to try is calling alarmDriver.scheduleNotification directly from Joplin's development tools:

const AlarmServiceDriverNode = require('@joplin/lib/services/AlarmServiceDriverNode').default;
const packageInfo = require('./packageInfo.js');
const alarmDriver = new AlarmServiceDriverNode({ appName: packageInfo.build.appId });
alarmDriver.setService({ logger: () => Logger.create('Test') });
alarmDriver.scheduleNotification({ date: new Date(Date.now() + 50), title: 'Testing...' }); // 50 ms delay

I'm re-opening this.

Note that it works for me on Ubuntu 23.10 (Joplin 2.13.12 -- Snap version).

Appreciate you looking into this again! Hopefully we can get to the bottom of this and get it resolved.

Another thing to try is calling alarmDriver.scheduleNotification directly from Joplin's development tools:

I will give this a shot and report back.

abmusse avatar Jan 08 '24 05:01 abmusse

Another thing to try is calling alarmDriver.scheduleNotification directly from Joplin's development tools:

const AlarmServiceDriverNode = require('@joplin/lib/services/AlarmServiceDriverNode').default;
const packageInfo = require('./packageInfo.js');
const alarmDriver = new AlarmServiceDriverNode({ appName: packageInfo.build.appId });
alarmDriver.setService({ logger: () => Logger.create('Test') });
alarmDriver.scheduleNotification({ date: new Date(Date.now() + 50), title: 'Testing...' }); // 50 ms delay

@personalizedrefrigerator

After running the above in the dev console looks like we get the same error message as before:

AlarmServiceDriverNode::scheduleNotification: Triggering notification (default): 
{appID: 'net.cozic.joplin-desktop', title: 'Testing...', icon: '/tmp/.mount_JoplinJDOcmL/resources/build/icons/512x512.png',message: '-'}
appID: "net.cozic.joplin-desktop"
icon: "/tmp/.mount_JoplinJDOcmL/resources/build/icons/512x512.png"
message: "-"
title: "Testing..."
Test: AlarmServiceDriverNode::scheduleNotification: node-notifier response: Error: Command failed: notify-send "Testing..." "-" --icon "/tmp/.mount_JoplinJDOcmL/resources/build/icons 512x512.png" --expire-time "10000"
notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_token
    at __node_internal_genericNodeError (node:internal/errors:867:15)
    at ChildProcess.exithandler (node:child_process:430:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:322:12) undefined

abmusse avatar Jan 08 '24 05:01 abmusse

Same problem here, Ubuntu 23.10 (installed Joplin using bash script as recommended on installation instructions) Joplin log shows: notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_token

Uninstalling and reinstalling via snap, it works.

CoeJoder avatar Mar 11 '24 02:03 CoeJoder

I think this fails (also on my system and probably others) due to a library version mismatch. There is an outdated libnotify.so.4 in the mount image (Appimage version 2.14.17 is where I encountered it) of Joplin that is linked first. This is a conjecture at the moment since I have not modified the Appimage yet to remove the offending library (version from 2019) . My system has its own libnotify.so.4 that matches the version of the installed libnotify-bin package (0.8.1, circa 2022) but it is never reached due to the precedence of the (outdated) library in the appimage. The error:

node-notifier response: Error: Command failed: notify-send "Full S.... Season ....." "-" --icon "/tmp/.mount_Joplin5Hrjfau/resources/build/icons/512x512.png" --expire-time "10000"
notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_token.

The symbol (function) that is being missed by notify-send (when called by node-notifier) is NOT present in the old library (libnotify.so.4 in the appimage) but IS present in the system libnoitify.so.4. I have confirmed that so I am 99 % sure that removing the old libnotify.so.4 from the appimage (if possible) or updating it will fix the issue. I am developing an accessory for Joplin that relies on successfully emitting session notifications and would appreciate having this fixed officially.

QuantiusBenignus avatar Mar 11 '24 19:03 QuantiusBenignus

To follow up, I can confirm that the issue (which has persisted in the subsequent 2.14.19 and 2.14.20 Appimage releases??) is eliminated as I expected when the outdated libnotify.so.4 in the appimage is removed. I used appimagetool to repackage the Joplin Appimage (2.14.20) without the library in question and Joplin then successfully finds the system libnotify.so.4, resulting in a notification. Hopefully someone will update the official appimages soon (either drop the lib or replace with an updated one, IMHO better to drop it since (AFAIK) it seems to be needed only by notify-send, which is external to the appimage). With notifications working properly in GNOME, one can check out this GNOME shell extension, which reads out loud the notifications emitted by Joplin.

QuantiusBenignus avatar Mar 22 '24 00:03 QuantiusBenignus