Notification not working

General support for problems installing or using Deluge
kevindd992002
Leecher
Leecher
Posts: 68
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Postby kevindd992002 » Mon Jan 04, 2021 3:10 pm

Ok, I don't know why but when I checked this path again inside the container, I see that the "egg"s are actually directories and not files. Thanks for the clue and that's what I did. I renamed the /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg "directory" and appended _bak to it and restart deluge. Checked the plugins section in the GUI and Notification is no longer there. So that tells us that it is definitely looking at that folder for the default egg directory.

I then kept that directory still renamed to _bak and then put your egg under the "/config/plugins" directory, restart deluge, and Notifications is now back in the GUI. That tells us that it is using your egg file. I'm downloading a test torrent now and have debug enabled. I'm just waiting for it to finish to see if there's a difference.

As for your notifications-core.conf file, we have the same content there except for the fact that I have the value of smtp_from the same to that of smtp_user. What sender email address does deluge use if you leave smtp_from blank? Does it even allow that?

kevindd992002
Leecher
Leecher
Posts: 68
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Postby kevindd992002 » Mon Jan 04, 2021 3:33 pm

Ok, still didn't work. For some reason, after I enabled Notifications in the GUI and after a 2nd reboot, it brought back the renamed directory to its default folder name and used that old egg again. I guess this is how docker containers work. I can put a startup script to solve this IF the egg in the /usr/lib path was an actual egg "file" and not a directory. Obviously, I can't replace a directory with a file (your egg). Are those egg directories some sort of decompressed eggs?

kevindd992002
Leecher
Leecher
Posts: 68
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Postby kevindd992002 » Mon Jan 04, 2021 3:42 pm

Or is there a way to change the name of your egg so that it is recognized as a different plugin inside deluge?

mhertz
Compulsive Poster
Compulsive Poster
Posts: 1060
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Postby mhertz » Mon Jan 04, 2021 8:45 pm

The smtp_from field is optional and works fine empty - I originally looked up how to setup the plugin and in my search found a guide which just used that field as having a message like "Deluge download ready", so knew it wasen't mandatory when could be entered like that: viewtopic.php?t=49847

Egg files are zipped directories, and deluge supports plugins both in directories or zipped files as long as just ending in '.egg' to be accepted. Actually the only changed file in my fixed version is core.py under deluge_notifications folder in the zipped directory, so I guess you could in your startup script copy over and overwrite that file to fix it, but regardless, I have now changed also in it's setup.py file and upped the version number of plugin from v0.3 to v0.4 in my fixed version and that takes precedense always, also on linux, so now not needed anymore to rename the original plugin(or delete it) anymore and simply just need place the fixed plugin into deluge profile's plugins folder, restart deluge(and it's daemons, if loaded) and it will be used - it can be verified also by checking from any deluge UI that it lists the notification plugin's version number as v0.4 and not v0.3 to make sure. I have updated previous posted link also to this version.

https://paste.c-net.org/QumarTrolley

kevindd992002
Leecher
Leecher
Posts: 68
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Postby kevindd992002 » Mon Jan 04, 2021 11:41 pm

Thank you, that makes sense! I will try this again today and report back. I'm feeling positive about this.

kevindd992002
Leecher
Leecher
Posts: 68
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Postby kevindd992002 » Tue Jan 05, 2021 5:17 pm

Still not working :(

Code: Select all

Line 395: 01:04:55 [DEBUG   ][deluge_notifications.core     :212 ] ENABLING CORE NOTIFICATIONS
   Line 7351: 01:14:20 [DEBUG   ][deluge_notifications.common   :52  ] Calling CORE custom email providers for TorrentFinishedEvent: ('5fff0e1c8ac414860310bcc1cb76ac28e960efbe',) {}
   Line 7352: 01:14:20 [DEBUG   ][deluge_notifications.common   :56  ] Found handler for kind email: <bound method CoreNotifications._on_torrent_finished_event of <deluge_notifications.core.Core object at 0x7f4e65ec8128>>
   Line 7352: 01:14:20 [DEBUG   ][deluge_notifications.common   :56  ] Found handler for kind email: <bound method CoreNotifications._on_torrent_finished_event of <deluge_notifications.core.Core object at 0x7f4e65ec8128>>
   Line 7353: 01:14:20 [DEBUG   ][deluge_notifications.core     :177 ] Handler for TorrentFinishedEvent called for CORE
   Line 7354: 01:14:20 [DEBUG   ][deluge_notifications.common   :116 ] Notification failure using email: [Failure instance: Traceback: <class 'KeyError'>: 'name'
   Line 7357: /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg/deluge_notifications/common.py:70:wrapper
   Line 7358: /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg/deluge_notifications/common.py:58:_handle_custom_providers
   Line 7361: /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg/deluge_notifications/core.py:181:_on_torrent_finished_event
   Line 7368: /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg/deluge_notifications/common.py:70:wrapper
   Line 7369: /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg/deluge_notifications/common.py:58:_handle_custom_providers
   Line 7372: /usr/lib/python3/dist-packages/deluge/plugins/Notifications-0.3.egg/deluge_notifications/core.py:181:_on_torrent_finished_event


I can confirm though that I see 0.4 in the WebGUI now. But I'm not sure why the /usr/lib egg directory is still being shown in the logs?

mhertz
Compulsive Poster
Compulsive Poster
Posts: 1060
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Postby mhertz » Tue Jan 05, 2021 9:19 pm

Unfortunetly I have a hard time changing the plugin-name - I have done that several times before successfully in other plugins, just a matter of changing a var in setup.py and renaming deluge_* to match and rebuild, but in this specific-case there's issues, and name changes fine but then e.g. errors in log which can be mitigated by clicking again at plugin under preferences once or twice, but seemingly needs done every startup time, which is annoying. I believe issues arises from the gtkui.py file which i'm not good at, well not at any of this, but regardless. That's why I was happy to find that just upping the version-number was enough, but sadly it seemingly works in mysterious ways during a docker run, or your LSIO setup atleast and I neither can explain why trying to read from that original folder on your setup when not done here in my various tests.

I'm pretty much out of ideas i'm affraid, and if I can think of something, then i'll return, but in mean-time, then as you stated a possibility of workarounding through a startup-script, then if possible, then maybe add that copying/overwriting of core.py into/over deluge_notififactions subfolder of plugin-dir - you can get the fixed core.py by extracting my fixed plugin as just a zip-file.
Last edited by mhertz on Wed Jan 06, 2021 8:50 am, edited 1 time in total.

mhertz
Compulsive Poster
Compulsive Poster
Posts: 1060
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Postby mhertz » Tue Jan 05, 2021 10:19 pm

Little update - maybe you, and others LSIO etc users affected, could use following workaround I just cooked up.

It's little stupid and not the best, but better than nothing I guess - Okay, I have rebuilt the plugin with new name, Notifications2, and as couldn't fix the gtkui.py issue, then I also stripped the GTKUI entry-point out of setup.py, but this then means that you can select to enable the plugin in GTKUI(and other UIs), but it will not show a submenu anymore(atleast not in GTKUI), so all settings need to be made in notifications-core.conf yourself of deluge profile folder, but i'm thinking if not having such already, then one could enable regular Notifications plugin to generate it and disable it again afterwards. I tested it worked too like that. Just a thought.

https://paste.c-net.org/UnlawfulComfy

mhertz
Compulsive Poster
Compulsive Poster
Posts: 1060
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Postby mhertz » Wed Jan 06, 2021 9:51 pm

Okay, disregard above post, as I now fixed the gtkui.py issue, and then the next-coming webui.py/notifications.js issue, so here's an alternative version of the fixed plugin for people where original version I posted didn't work(though should only be certain docker setups like LSIO).

As before, just place into deluge profile's plugins folder, restart and then a new plugin can be enabled from any UI, named Notifications2, which now shows a submenu for configuration in both GTKUI and webui. The submenu I defined to be named Notifications2, but left it to read/save from original named notifications-core.conf(and not e.g notifications2-core.conf - I originally did that though, but changed it back as didn't see any point/advantage and only a downside of needing re-setup again even if already having notifications-core.conf in-place).

Tested working in GTKUI and webUI.

https://paste.c-net.org/JunctureClapping
Last edited by mhertz on Thu Jan 07, 2021 8:45 pm, edited 1 time in total.

kevindd992002
Leecher
Leecher
Posts: 68
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Postby kevindd992002 » Thu Jan 07, 2021 4:17 pm

It still doesn't work but we're getting closer. Thank you for your effort, I really appreciate it :)

It looks like it is using the correct Notifications2 egg now but it somehow failing the SSL handshake:

Code: Select all

Line 1608: 22:44:27 [DEBUG   ][deluge_notifications2.core    :212 ] ENABLING CORE NOTIFICATIONS
   Line 2016: 22:45:04 [DEBUG   ][deluge_notifications2.core    :94  ] Handled Notification Events: [('TorrentFinishedEvent', 'Emitted when a torrent finishes downloading.')]
   Line 5498: 22:52:48 [DEBUG   ][deluge_notifications2.common  :52  ] Calling CORE custom email providers for TorrentFinishedEvent: ('5fff0e1c8ac414860310bcc1cb76ac28e960efbe',) {}
   Line 5499: 22:52:48 [DEBUG   ][deluge_notifications2.common  :56  ] Found handler for kind email: <bound method CoreNotifications2._on_torrent_finished_event of <deluge_notifications2.core.Core object at 0x7fc7e91db6d8>>
   Line 5499: 22:52:48 [DEBUG   ][deluge_notifications2.common  :56  ] Found handler for kind email: <bound method CoreNotifications2._on_torrent_finished_event of <deluge_notifications2.core.Core object at 0x7fc7e91db6d8>>
   Line 5500: 22:52:48 [DEBUG   ][deluge_notifications2.core    :177 ] Handler for TorrentFinishedEvent called for CORE
   Line 5501: 22:52:48 [DEBUG   ][deluge_notifications2.core    :79  ] Spawning new thread to send email with subject: Finished Torrent "ubuntu-20.10-desktop-amd64.iso": This email is to inform you that Deluge has finished downloading "ubuntu-20.10-desktop-amd64.iso".
   Line 5506: 22:52:48 [DEBUG   ][deluge_notifications2.core    :98  ] Email prepared
   Line 5918: 22:53:49 [DEBUG   ][deluge_notifications2.common  :116 ] Notification failure using email: [Failure instance: Traceback: <class 'socket.timeout'>: _ssl.c:835: The handshake operation timed out
   Line 5928: /config/plugins/Notifications2-0.3.egg/deluge_notifications2/core.py:138:_notify_email
   Line 5947: /config/plugins/Notifications2-0.3.egg/deluge_notifications2/core.py:138:_notify_email
   Line 34338: 23:58:03 [DEBUG   ][deluge_notifications2.common  :52  ] Calling CORE custom email providers for TorrentFinishedEvent: ('5fff0e1c8ac414860310bcc1cb76ac28e960efbe',) {}
   Line 34339: 23:58:03 [DEBUG   ][deluge_notifications2.common  :56  ] Found handler for kind email: <bound method CoreNotifications2._on_torrent_finished_event of <deluge_notifications2.core.Core object at 0x7fc7e91db6d8>>
   Line 34339: 23:58:03 [DEBUG   ][deluge_notifications2.common  :56  ] Found handler for kind email: <bound method CoreNotifications2._on_torrent_finished_event of <deluge_notifications2.core.Core object at 0x7fc7e91db6d8>>
   Line 34340: 23:58:03 [DEBUG   ][deluge_notifications2.core    :177 ] Handler for TorrentFinishedEvent called for CORE
   Line 34341: 23:58:03 [DEBUG   ][deluge_notifications2.core    :79  ] Spawning new thread to send email with subject: Finished Torrent "ubuntu-20.10-desktop-amd64.iso": This email is to inform you that Deluge has finished downloading "ubuntu-20.10-desktop-amd64.iso".
   Line 34346: 23:58:03 [DEBUG   ][deluge_notifications2.core    :98  ] Email prepared
   Line 34760: 23:59:04 [DEBUG   ][deluge_notifications2.common  :116 ] Notification failure using email: [Failure instance: Traceback: <class 'socket.timeout'>: _ssl.c:835: The handshake operation timed out
   Line 34770: /config/plugins/Notifications2-0.3.egg/deluge_notifications2/core.py:138:_notify_email
   Line 34789: /config/plugins/Notifications2-0.3.egg/deluge_notifications2/core.py:138:_notify_email
   Line 42192: 00:12:59 [DEBUG   ][deluge_notifications2.common  :52  ] Calling CORE custom email providers for TorrentFinishedEvent: ('5fff0e1c8ac414860310bcc1cb76ac28e960efbe',) {}
   Line 42193: 00:12:59 [DEBUG   ][deluge_notifications2.common  :56  ] Found handler for kind email: <bound method CoreNotifications2._on_torrent_finished_event of <deluge_notifications2.core.Core object at 0x7fc7e91db6d8>>
   Line 42193: 00:12:59 [DEBUG   ][deluge_notifications2.common  :56  ] Found handler for kind email: <bound method CoreNotifications2._on_torrent_finished_event of <deluge_notifications2.core.Core object at 0x7fc7e91db6d8>>
   Line 42194: 00:12:59 [DEBUG   ][deluge_notifications2.core    :177 ] Handler for TorrentFinishedEvent called for CORE
   Line 42195: 00:12:59 [DEBUG   ][deluge_notifications2.core    :79  ] Spawning new thread to send email with subject: Finished Torrent "ubuntu-20.10-desktop-amd64.iso": This email is to inform you that Deluge has finished downloading "ubuntu-20.10-desktop-amd64.iso".
   Line 42201: 00:12:59 [DEBUG   ][deluge_notifications2.core    :98  ] Email prepared
   Line 42868: 00:13:59 [DEBUG   ][deluge_notifications2.common  :116 ] Notification failure using email: [Failure instance: Traceback: <class 'socket.timeout'>: _ssl.c:835: The handshake operation timed out
   Line 42878: /config/plugins/Notifications2-0.3.egg/deluge_notifications2/core.py:138:_notify_email
   Line 42897: /config/plugins/Notifications2-0.3.egg/deluge_notifications2/core.py:138:_notify_email


As you can see, I tried three times:

1. Gmail -> port 587, blank from field, SSL enabled
2. Yahoo -> port 587, blank from field, SSL enabled
3. Yahoo -> port 465, blank from field, SSL enabled


Return to “Support”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests