Notification not working

General support for problems installing or using Deluge
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

Yes. However I'm beginning to think I'm misunderstanding something, because the fixed build of plugin I uploaded is down as file host shutdown. Also, before that issue, there where another one referenced in this thread I posted fixed build for and reported, and which Cas fixed in more pro maner than me, so can neither be that issue as also fixed.

Am I trippin' or whatever the cool kids say nowadays :)
shinger
Leecher
Leecher
Posts: 90
Joined: Sat Jun 05, 2010 1:02 pm

Re: Notification not working

Post by shinger »

Hey mhertz,

I have now also stopped deluged and start it again and the updated version of the notifications plugin that you introduced did fixed the problem. To be sure of it, i also rebooted the whole system that deluge is running on, but still everything is working just fine.

So i am not sure what kind of problems were there but the issue that i was having is that the notifications plugin constantly was being turned off, while the port was set to 0, TLS turned off and recipients email address was wiped.

I was so fed up by it, because it was bothering me already for like 6-7 years that i created a script that would just watch every minute if the settings have been wiped and if so that i would just replace the notifications conf file and restart deluged.service to apply it again.
===============================================================
Server: Rock 5B 8 Cores (ARM), 16 GB RAM, 2 TB 970 Evo +
OS: Linux Ubuntu 22.04 LTS
Deluge: v2.1.1
Plugins: Blocklist, LabelPlus, ItConfig, MyScheduler, Stats, Notifications, YaRSS2
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

Thanks for elaborating - I for some reason forgot this, sorry buddy. Anyway that is indeed strange because I didn't change anything regarding that, but glad it worked for you, though imho must be coincidence, or deluge update/change etc but whatever works is most important obviously :) I did looked at the code after you posted and couldn't see where the issue could come from possibly, but not a wizz either at these kinda things admittedly. I wanted look and experiment more with finding the culprit for this, to have something useful to respond with I.e new fix, but then other things came up apparently. I just was confused because the link to plugin was down, but you got it then long time ago I can deduce then. If continue have problems, and you always use same config, then I could disable possibility of rewriting/change config, away from current-config-file, or alike, but if not having issues, then not needed I guess, but just for feature I mean(though you're on top of that too I see from your workaround described). Apologies again for slow response.
shinger
Leecher
Leecher
Posts: 90
Joined: Sat Jun 05, 2010 1:02 pm

Re: Notification not working

Post by shinger »

Hi mhertz,

I have put the plugin in the attachment, maybe you can do something with it. I am not sure if you are able to see any source or something as i have not dived in to python yet.

Maybe the main code of deluge of the Notification plugin is missing something and it could be merged with it from the code of the plugin. That would be a more solid solution.
Attachments
Notifications-0.5.egg
(35.85 KiB) Downloaded 189 times
===============================================================
Server: Rock 5B 8 Cores (ARM), 16 GB RAM, 2 TB 970 Evo +
OS: Linux Ubuntu 22.04 LTS
Deluge: v2.1.1
Plugins: Blocklist, LabelPlus, ItConfig, MyScheduler, Stats, Notifications, YaRSS2
User avatar
ambipro
Moderator
Moderator
Posts: 445
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Notification not working

Post by ambipro »

shinger wrote: Fri Nov 24, 2023 6:45 am Hi mhertz,

I have put the plugin in the attachment, maybe you can do something with it. I am not sure if you are able to see any source or something as i have not dived in to python yet.

Maybe the main code of deluge of the Notification plugin is missing something and it could be merged with it from the code of the plugin. That would be a more solid solution.
It's just a packaged zip. Open it with winrar or I believe you can just run unzip on it.

.py files (source) are all inside..

Image
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

Thanks ambipro :) @all, Indeed unzip works, or as i'm big fan off for everything compression/decompression, 7z from open-source p7zip(command-line 7-zip port), which like on windows handles pretty much everything(zip, rar(most), 7z etc), including even e.g. NSIS installer exe's like deluge's etc, not even winrar supporting, Fanboy mode off, sorry :)

@shinger, well unfortunetly there's nothing relevant to add i'm affraid. Here's a diff from official and mine:

Code: Select all

diff -urN deluge_notifications/core.py deluge2_notifications/core.py
--- deluge_notifications/core.py	2023-11-24 13:39:10.559047385 +0100
+++ deluge2_notifications/core.py	2022-05-05 19:50:28.000000000 +0200
@@ -148,7 +148,7 @@
 
         try:
             try:
-                server.sendmail(self.config['smtp_from'], to_addrs, message.encode())
+                server.sendmail(self.config['smtp_from'], to_addrs, message.encode('utf-8'))
             except smtplib.SMTPException as ex:
                 err_msg = (
                     _('There was an error sending the notification email: %s') % ex
diff -urN deluge_notifications/webui.py deluge2_notifications/webui.py
--- deluge_notifications/webui.py	2023-11-24 13:39:10.559047385 +0100
+++ deluge2_notifications/webui.py	2022-05-05 19:45:38.000000000 +0200
@@ -21,6 +21,7 @@
 
 
 class WebUI(WebPluginBase):
+
     scripts = [get_resource('notifications.js')]
     debug_scripts = scripts
 
Btw, it looks like I don't check all and only two files, but 'diff' just prints it strangely and I specified both full plugin dirs specifically. The utf8 missing part is just Cas's stye wanting be verbose about what's going on for readability(utf8 is default for encode(), and so I prefer ditch such stuff) and I added it to the PR afterwards. Lol usually only did PRs when sure I could not f it up, like here(occasionally did still though) :)

Anyway, as seen, this is entirely unrelated to your issue and the two plugins are identical, except for one small semntics for readability.

I haven't personally seen your issue myself, and couldn't find neither in code myself, but have only ever used the plugin shortly for testing throughout the years and of.course trust your opinion.

So, i'm affraid I can not really do anything about it myself, except my previous suggestion, which indeed is extremely stupid, but was just only workaround I could think off from top of head, instead of having continually having script running to monitor it needlessly, but you said you didn't experience it anymore, so I guess you don't need it anyway, though let me know if change mind of-course :)

Btw, happy thanksgiving to you and rest good people around here, really appreciate you all, and none in the least the awesome devs making this comunity here even a thing in first place, thanks! :)
shinger
Leecher
Leecher
Posts: 90
Joined: Sat Jun 05, 2010 1:02 pm

Re: Notification not working

Post by shinger »

What if i decide to remove that plugin and have deluge be verbose in logs. Then when the issue occurs (notifications plugin automatically turns off) to send the verbose log, allthough i don't remember if i maybe already had done that and still did not get any wiser.
===============================================================
Server: Rock 5B 8 Cores (ARM), 16 GB RAM, 2 TB 970 Evo +
OS: Linux Ubuntu 22.04 LTS
Deluge: v2.1.1
Plugins: Blocklist, LabelPlus, ItConfig, MyScheduler, Stats, Notifications, YaRSS2
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

Yes good idea, that's only thing you can do. Hopefully somethings revealed then. Either why turns off, or why reverting some of the settings as you previously described. I will also do a little more thorough look-see again soon, in depth, to try see if can guess at a possible culprit. Hopefully though never happens again because as said only change was as shown a default option specified (needlessly) and a whitespace apparently, don't know what I was doing there with that lol. Ohh, also changed name of main project dir and entry-point in setup.py used to build this(not included in extracted egg, hence not in diff), but still fully irrelevant and only for making it take precedence also on dockers where otherwise didn't for some reason(non-dockers just need up version number for that, as I did here for that). I guess it's because dockers use other plugin/config-locations, changing chronological sorting, but whatever.

(Off-topic, so apparently it's not thanksgiving I find out lol, sorry, though sentiment same of-course :) )
Post Reply