Notification not working

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

Re: Notification not working

Post by mhertz »

Thanks alot Cas for proper fix, instead of my hackjobs, much appreciate your efforts! :)
kevindd992002
Leecher
Leecher
Posts: 71
Joined: Thu Jun 13, 2019 2:56 pm

Re: Notification not working

Post by kevindd992002 »

Thanks, Cas!
jsw10471
New User
New User
Posts: 9
Joined: Sun May 03, 2020 1:32 pm

Re: Notification not working

Post by jsw10471 »

So what is the status on this fix? I have deluge running in 2 dockers. One from Linuxserver and another from Binxhex/ArchVPN so that I can use it with a VPN and without. I have read this entire thread so many times my eyes are bleeding. I tried the first egg file released Notifications-0.4.egg and it did not work and then tried the newer Notifications2-0.3.egg and it also did not work and created a new Plugin name Notifications2 that had no .conf file that I can see.

I tried this on both versions of my dockers which are 2.0.4-dev38 and 2.0.3-2-201906121 and neither work. Tried deleting the old conf files off and making it recreate new ones on startup and then entered fresh information and again it did nothing.

Yes i have the gmail account setup to all LESS SECURE APPS.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

jsw10471 wrote:So what is the status on this fix? [...]
Status is that I and OP tested e.g. this modded version working:
[...]
If wanting to be absolutely sure of that the above never happens(but don't know if your issue but could be), as I cannot fix as don't know why happened that single time, then instead use the more akward version with gtkui/webui config support stripped out, so no notifications2 submenu coming forward after enabling it, meaning you enable notifications2 plugin and keep it enabled always, and then enable original notifications plugin temporarily only when needing make changes or check settings, and then after changing anything you hit apply and then disable original notifications plugin again and apply/save, leaving notifications2 only enabled option again. Here it is again, https://paste.c-net.org/UnlawfulComfy , sorry for inconvenience.
(Edit: The above referenced mod was made because the initial modded version with upped version from 0.3 to 0.4, which takes precedense I tested, when added to your deluge profile dir's plugin folder, was reported by OP to not take precedense propperly afterall(so older version still used) on his end using docker, but for others not using docker, or if just not affected by this(maybe docker version related dunno), then probably better to just use this version which doesn't add new notifications2 submenu under preferences and so simpler as just replaces "bad" plugin with "good": https://paste.c-net.org/QumarTrolley)

However Cas later posted his suggested but untested fix, though i'm sure would work and is more proper than mine, as for one, he knows what he's doing, lol, and second, doesn't strip out num_files parsing/displaying, but anyway, I haven't time right now to test and make modded plugin and upload, so my previous one will have to do, which is fine though, as pretty much same functionality, if not grading quality of code behind the scenes additionally ;)

If not working, as you stated, then please try following and tell me result e.g. on my end(and OP's, after he fixed his network issue) I get a mail in my inbox from doing it, and this test basically does the same as the plugin does in regards to actually sending the mail:
[...] if you can open such a terminal in the running deluge image as suggessted previously, then maybe we can get a better debug message out for what actually fails, and little easier for me to possible suggest a test for how to e.g. workaround by changing ssl default context, but i'm not sure I can do that "in blind", but atleast we can get proper debug message and know in what part specifically failure happens.

So if you could start such e.g. 'docker exec -it deluge /bin/bash' during deluge running and then if you can run this file(python filename.py or python3 filename.py not sure on your distro) and if not then copy paste or type, by first entering 'python' or 'python3' and hit return, and then afterwards this liitle code section, line after line, I just cooked up to make a connection to gmail smtp server through smtplib, same module plugin uses, and send a mail threw it, with debug-logging enabled - just add email and password into 'user' and 'pw' vars first:

Code: Select all

from smtplib import SMTP
user=""
pw=""
server = SMTP('smtp.gmail.com', 587)
server.set_debuglevel(1)
server.ehlo()
server.starttls()
server.login(user,pw)
server.sendmail(user, user, "test")
server.quit()
Last edited by mhertz on Sun Mar 28, 2021 12:36 pm, edited 1 time in total.
jsw10471
New User
New User
Posts: 9
Joined: Sun May 03, 2020 1:32 pm

Re: Notification not working

Post by jsw10471 »

So it appears to work from the CLI within the docker as following your instructions i got:
>> server.sendmail(user, user, "test")
send: 'mail FROM:<xxxxxxxx@gmail.com> size=4\r\n'
reply: b'250 2.1.0 OK v6sm3143932ook.40 - gsmtp\r\n'
reply: retcode (250); Msg: b'2.1.0 OK v6sm3143932ook.40 - gsmtp'
send: 'rcpt TO:<xxxxxxxxxx@gmail.com>\r\n'
reply: b'250 2.1.5 OK v6sm3143932ook.40 - gsmtp\r\n'
reply: retcode (250); Msg: b'2.1.5 OK v6sm3143932ook.40 - gsmtp'
send: 'data\r\n'
reply: b'354 Go ahead v6sm3143932ook.40 - gsmtp\r\n'
reply: retcode (354); Msg: b'Go ahead v6sm3143932ook.40 - gsmtp'
data: (354, b'Go ahead v6sm3143932ook.40 - gsmtp')
send: b'test\r\n.\r\n'
reply: b'250 2.0.0 OK 1616934798 v6sm3143932ook.40 - gsmtp\r\n'
reply: retcode (250); Msg: b'2.0.0 OK 1616934798 v6sm3143932ook.40 - gsmtp'
data: (250, b'2.0.0 OK 1616934798 v6sm3143932ook.40 - gsmtp')

i received the test email just fine
Last edited by jsw10471 on Sun Mar 28, 2021 12:42 pm, edited 1 time in total.
jsw10471
New User
New User
Posts: 9
Joined: Sun May 03, 2020 1:32 pm

Re: Notification not working

Post by jsw10471 »

Despite having my DELUGE_LOGLEVEL set in the docker-compose.yml i do not seem to get any error log though

environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
- UMASK=000
- DELUGE_LOGLEVEL=error

The deluged.log is just 0 bytes all the time
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

I'll retest in a docker with one of your used images in one of my test VMs later, I did before too with my back and fouth's with the OP of this thread, but to make sure nothings changed, and then can check Cas's propossed fix also while add it and upload with his fix instead, but I don't have time now so just wanted to say i'll post back later in a few hours round about.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Notification not working

Post by mhertz »

Sorry, took some more hours than expected before could look into it.

Anyway, I tested linuxserver deluge docker image, and as OP correctly stated, then using my modded 0.4 notifications plugin doesn't work from docker - it shows 0.4 correctly, but mismatches files during actual running, so not a solution. However, if not using docker, then I again tested it working on regular setups, where it's the best solution to use imho. For docker, then my modded notifications2 plugin works fine and I also tested Cas's modification instead of mine also to be working fine, so heres reuploads with Cas's fix instead of mine:

0.4 for regular deluge users - drop in plugin folder and will be used automatically instead of buggy included 0.3 version:

Notifications-0.4.egg

Notification2 plugin, for docker users, configure with regular notifications plugin(if not already done), disable again and enable Notifications2, and done:

Notifications2-0.3.egg

(As previously said, strange errors happened previously when I had made notifications2 generate own new separate preferences menu and config file, since mismatched with original notifications plugin for some reason, despite not even enabled, so had to ditch all entry-points to fix except 'core', meaning original notifications plugin only useful for generating the conf if missing, nothing else when using notifications2, and both should never be left enabled simultaneously)

Since it works fine here, then are you sure that you're configuring it correctly? Btw, no need test this newer last version, since if the old mod of notifications2 didn't work, then this will neither for you, but just made to test Cas's fix and report back, plus release to public also. You need e.g. 'smtp.google.com', '587' and remember add recipient furthest down i.e. your own email, also go to next tab at top named Subscriptions and tick TorrentFinsihedEvent under Email, sorry not patrionizing you and just want to be sure were on same page here. You can also use my config file posted here previously, and just exchange with your own user, pass, and mail-address: viewtopic.php?f=7&t=55458&start=10#p232822 Remember always stop deluge docker and restart after having added new plugin or changed configs in general.

For logging, if you change the loglevel to debug then should get more output i'd presume, or atleast like that for normal runs - I forgot mess with that before when going into the VM and testing the above.
jsw10471
New User
New User
Posts: 9
Joined: Sun May 03, 2020 1:32 pm

Re: Notification not working

Post by jsw10471 »

so in reading this answer, since I am docker user I should use the Notifications2-0.3.egg file and put it in the /config/plugins folder. I should then either update the notifications-core.conf file manually to have my gmail settings or "edit" with the traditional Notifications plugin enabled. Then disable the traditional Notifications plugin and enable the Notifications2 plugin (which will not show within the Preferences).

After doing this it should work....
jsw10471
New User
New User
Posts: 9
Joined: Sun May 03, 2020 1:32 pm

Re: Notification not working

Post by jsw10471 »

So i did all this for Binhex/ArchVPN one and flipped on debug in the logs. I can see in the logs it talks about the Notifications2 plugin getting loaded and loads the .conf file because i can see the SMTP setttings, however adding a new torrent never triggers an email in the deluged.log and a completing torrent also does not.

I will try with the blander linuxserver/deluge docker later and see if it works
Post Reply