Execute plugin not running commands

Suggest, post, or discuss plugins for Deluge
sage2050
New User
New User
Posts: 2
Joined: Tue Sep 26, 2023 5:31 pm

Execute plugin not running commands

Post by sage2050 »

Trying to run a basic bash script on complete, but execute refuses to run the command. I've been chatting with ambipro on discord about this issue since yesterday and we haven't been able to figure out what's wrong.

binhex-deluge 2.1.1 container running in unraid
command is complete -> /config/plugins/deluge-cross-seed.sh
I added a line to create a test file on run, so I'm sure that it's not executing
script runs fine from terminal with same path
execute 1.4 installed (suggestion from mhertz here)
stop and shutdown daemon from thin client through each troubleshooting step
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute plugin not running commands

Post by mhertz »

Hi! :)

I'm not sure I have time this evening, but will figure out tomorrow, later in the day.

If you have the rule setup, as you have, then to make sure it's setup properly, as that image is little special, then I would in a terminal run 'sudo docker exec -it deluge /bin/bash' and there 'deluge-console -c /config halt' and then 'exit', and then restart deluge docker image and try again loading a torrent. When torrent finishes and need be new torrent for test, then check the deluged.log in /config i.e. 'grep execute deluged.log' and see if execute ran and if error and what is, atleast error should be there I believe.
sage2050
New User
New User
Posts: 2
Joined: Tue Sep 26, 2023 5:31 pm

Re: Execute plugin not running commands

Post by sage2050 »

16:13:22 [ERROR ][deluge2_execute.core :1622] Execute script not found or not executable

edit: I removed 'sh' prefix from the command line and did it again (added it to test after first post)

16:15:40 [WARNING ][deluge2_execute.core :1622] Command "/config/plugins/deluge-cross-seed.sh" failed with exit code 1
16:15:40 [WARNING ][deluge2_execute.core :1622] stderr: b'Upon execvpe /config/plugins/deluge-cross-seed.sh (\'/config/plugins/deluge-cross-seed.sh\', b\'51b18f75ba0e3370c29b947f0979e857b800dae5\', b\'Welsh Dragon Flat 3D STL\', b\'/Media/downloads/_incomplete\') in environment id 22468764709520\n:Traceback (most recent call last):\n File "/usr/lib/python3.11/site-packages/twisted/internet/process.py", line 397, in _fork\n self._execChild(path, uid, gid, executable, args, environment)\n File "/usr/lib/python3.11/site-packages/twisted/internet/process.py", line 468, in _execChild\n os.execvpe(executable, args, environment)\n File "<frozen os>", line 583, in execvpe\n File "<frozen os>", line 597, in _execvpe\nFileNotFoundError: [Errno 2] No such file or directory: \'/config/plugins/deluge-cross-seed.sh\'\n'

list of the plugins folder:

sh-5.1# ls -la /config/plugins/
total 2248
drwxrwxrwx 2 nobody users 176 Sep 26 11:04 .
drwxrwxrwx 7 nobody users 4096 Sep 26 16:15 ..
-rwxrwxrwx 1 nobody users 65277 Dec 8 2020 AutoRemovePlus-0.6.15.egg
-rwxrwxrwx 1 nobody users 286 Sep 26 10:57 deluge-cross-seed.sh
-rwxrw-rw- 1 nobody users 17921 Sep 26 10:31 Execute-1.4.egg
-rwxrwxrwx 1 nobody users 220498 Mar 12 2021 LabelPlus-0.3.2.4.egg
-rwxrwxrwx 1 nobody users 46072 Oct 6 2022 ltConfig-2.0.0.egg
-rwxrwxrwx 1 nobody users 1934881 Oct 2 2020 SimpleExtractor-1.4.egg
Last edited by sage2050 on Tue Sep 26, 2023 8:21 pm, edited 2 times in total.
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute plugin not running commands

Post by mhertz »

Do you have a shebang in that deluge-cross-seed.sh? It can say like-minded error in that case too. Anyway, I just tested it working in that binhex image, in an ubuntu 22.04 VM.

Edit: Also, shouldn't matter but don't use my execute plugin build, as the extra fix already included in deluge 2.0.4+.
User avatar
ambipro
Moderator
Moderator
Posts: 446
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Execute plugin not running commands

Post by ambipro »

mhertz wrote: Tue Sep 26, 2023 8:57 pm Do you have a shebang in that deluge-cross-seed.sh? It can say like-minded error in that case too. Anyway, I just tested it working in that binhex image, in an ubuntu 22.04 VM.

Edit: Also, shouldn't matter but don't use my execute plugin build, as the extra fix already included in deluge 2.0.4+.
Not sure if this is relevant, but is this supposed to have \n at the end?

Code: Select all

[Errno 2] No such file or directory: \'/config/plugins/deluge-cross-seed.sh\'\n'
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute plugin not running commands

Post by mhertz »

Good catch bro! :)

I remember reading that when googling it earlier, so don't know why so blind I didn't see :) Cas stated was issue, and the reporter stated he didn't do anything like that, and fixed by deleting/recreating execute.conf.

Edit: @sage2050, I'm sorry missed your clear mention of restarting daemon from thinclient in first post(misunderstood as just start/stop docker) , and so stupid stating you to exec into docker image and halting, when already done by you effectively. Not important now but just to correct myself / apologize being moron :)

Anyway, regarding ambipro's solving of this issue: viewtopic.php?p=201767#p201767. Great job again!
sage2050
New User
New User
Posts: 2
Joined: Tue Sep 26, 2023 5:31 pm

Re: Execute plugin not running commands

Post by sage2050 »

I deleted execute.conf and .bak, restarted the container and let them rebuild and got the same error with the \n appended to the path

there is a shebang at the beginning of the script, #!/bin/bash
tried with #!/bin/sh same error
Last edited by sage2050 on Tue Sep 26, 2023 11:06 pm, edited 1 time in total.
User avatar
ambipro
Moderator
Moderator
Posts: 446
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Execute plugin not running commands

Post by ambipro »

I'm actually getting similar weird newlines at the end of errors writing a deluge script.

Code: Select all

  message: "Failure: [Failure instance: Traceback (failure with no frames): <class 'deluge.error.AddTorrentError'>: Torrent already in session ([REDACTED]).\n"
So while it is odd, especially being placed there. I don't know if it's truly the problem now.
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute plugin not running commands

Post by mhertz »

Just to make sure, then dont just restart container, but stop deluged gracefully from thinclient or docker exec. I would delete rule and remake rule again from scratch, and maybe try other place this time and name, e.g /config or /data etc, just to change things up, and then quit daemon again, restart container and test again.

I actually forgot shebang, as lazy and always run temp scripts with sh infront, and got other error(file not found or not executable first, and then exec error little later), but cannot remember if the /n was there on my end in error message, as per ambipro's good find again, but can check later again.

Im on a role now I see, as obviously shebang there when clearly stated tested fine from terminal initially. Sorry.

Otherwise pretty stumped honestly, and sorry for jumping the gun before with calling the issue pretty much gone, though strange with the linked thread I posted before, unless coincidence merely.

Edit: It is not an issue with \n as ambipro stated before, good call. It's strange because in the code, then it checks if file is there and accesable, and if so, then handed over to the twisted function running file, using execvpe or whatever was and fails - so the file is there and OK, as you also demonstrated with your ls -la output, but just fails running. Could you try with another torrent just for test, i.e. linux iso as I do. Granted not good if fails intermittent, but just to rule out if is torrent dependant or fully borked, guessing former. Just tested spaces in torrent-name, despite quoted, but sometimes tricky, though would be strange not detected before. I can't break it neither in binhex image in VM or in my own linux system's deluge repo package, really strange, I don't really know where to go from here i'm affraid - no need add debug-prints, when already there, just cryptic fail message.

I would also exec into docker and run script with those listed args and see if works fine there too, after having checked a Linux ISO.
sage2050
New User
New User
Posts: 2
Joined: Tue Sep 26, 2023 5:31 pm

Re: Execute plugin not running commands

Post by sage2050 »

I tried a new torrent file, I tried moving the script to a different folder (/media/), I tried with execute on add instead of on complete, i tried adding and remaking the execute command in a bunch of different ways, I removed the execute egg and went back to the included 1.3, same results in every test. graceful shutdowns between each step.
Last edited by sage2050 on Wed Sep 27, 2023 4:42 pm, edited 2 times in total.
Post Reply