Execute Plugin Not Running Script on Completion

Suggest, post, or discuss plugins for Deluge
Post Reply
dixen64
New User
New User
Posts: 6
Joined: Mon May 02, 2022 6:25 am

Execute Plugin Not Running Script on Completion

Post by dixen64 »

I currently have a script that successfully runs when manually triggering the script and when using the execute plugin to run the script when adding the torrent. However, the plugin does not run the script when the torrent is completed. Does anyone have any clues as to why this would happen? I am currently on Deluge 2.0.5.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute Plugin Not Running Script on Completion

Post by mhertz »

I tested that atleast it does work in deluge 2.0.5 -also tested it too worked from your delugevpn docker specifically, so not a general issue encountered atleast.

Normally the log should show error happened and exit-code, defined from plugin to show in 'warning' log-level I see, and the default example of generating the delugevpn docker is using 'info', so should be included in log(as shows defined level and up), but wasen't for whatever reason(I initially made a test-script touch'ing a file in /tmp, which failed, as I didn't think about the container only having specific path's mapped into it's virtual environment - Edit: On second thought I believe actually no error occured and hence no error message in log - I looked in wrong place i.e own /tmp instead of container's /tmp - so check log for actual error of execute plugin running your script).

Anyway, here(delugevpn docker in a VM) it worked with simple test case of:

<deluge-profile-dir>/execute.conf:

Code: Select all

{
    "file": 1,
    "format": 1
}{
    "commands": [
        [
            "da041881b73a756025fce9b21ba492c68c9a18ba",
            "complete",
            "/config/execute.sh"
        ]
    ]
}
<deluge-profile-dir>/execute.sh: (chmod +x'd)

Code: Select all

#!/bin/sh
touch /config/execute-test-ok
Which generated 'execute-test-ok' in deluge-profile-dir after download finished.

Still not working either with this small base-example?
dixen64
New User
New User
Posts: 6
Joined: Mon May 02, 2022 6:25 am

Re: Execute Plugin Not Running Script on Completion

Post by dixen64 »

mhertz wrote: Tue May 03, 2022 10:49 am I tested that atleast it does work in deluge 2.0.5 -also tested it too worked from your delugevpn docker specifically, so not a general issue encountered atleast.

Normally the log should show error happened and exit-code, defined from plugin to show in 'warning' log-level I see, and the default example of generating the delugevpn docker is using 'info', so should be included in log(as shows defined level and up), but wasen't for whatever reason(I initially made a test-script touch'ing a file in /tmp, which failed, as I didn't think about the container only having specific path's mapped into it's virtual environment - Edit: On second thought I believe actually no error occured and hence no error message in log - I looked in wrong place i.e own /tmp instead of container's /tmp - so check log for actual error of execute plugin running your script).

Anyway, here(delugevpn docker in a VM) it worked with simple test case of:

<deluge-profile-dir>/execute.conf:

Code: Select all

{
    "file": 1,
    "format": 1
}{
    "commands": [
        [
            "da041881b73a756025fce9b21ba492c68c9a18ba",
            "complete",
            "/config/execute.sh"
        ]
    ]
}
<deluge-profile-dir>/execute.sh: (chmod +x'd)

Code: Select all

#!/bin/sh
touch /config/execute-test-ok
Which generated 'execute-test-ok' in deluge-profile-dir after download finished.

Still not working either with this small base-example?
Thanks for the response. Your example isn't working for me either. In the logs, I don't see any errors, which is puzzling. I had wanted to up the log level to debug, but as you mentioned, I would have to rebuild the container to do so, and it would cause too many issues with other processes I have running. The strangest thing is that everything, including your example, runs fine if I have execute run when the torrent is added.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute Plugin Not Running Script on Completion

Post by mhertz »

If wanted for testing then I rebuilt the execute plugin to emit it's 'debug' logging lines as instead 'info' level, so catched in default delugevpn log - you just drop it into '<deluge-profile-dir'>/plugins' and restart deluge, as I made it take precedense over default included version(don't have to enable it again, it keeps enabled from before), and just delete it again afterwards so old version used again.

Execute-1.4.egg

Anyway, will not really help troubleshoot though I imagine, as if error, either in script or script not found/executable, then would show error in delugevpn log regardless, as using 'error' or 'warning' level, and so only reason not getting anything in log currently, is either that it's run succesfully(which you verified isn't happening), or that the 'TorrentFinishedEvent' not emited altogether, which seemingly only could have one cause here I believe - Are you testing with adding an already downloaded torrent, so just checks torrent data for few secs before showing 100% complete, or are you testing with a torrent which data you don't have already? The execute plugin only works for 'complete' in the latter case - something I stumbled upon myself a few years ago, highly frustrating me untill finally figuring it out.
dixen64
New User
New User
Posts: 6
Joined: Mon May 02, 2022 6:25 am

Re: Execute Plugin Not Running Script on Completion

Post by dixen64 »

mhertz wrote: Wed May 04, 2022 11:02 am If wanted for testing then I rebuilt the execute plugin to emit it's 'debug' logging lines as instead 'info' level, so catched in default delugevpn log - you just drop it into '<deluge-profile-dir'>/plugins' and restart deluge, as I made it take precedense over default included version(don't have to enable it again, it keeps enabled from before), and just delete it again afterwards so old version used again.

Execute-1.4.egg

Anyway, will not really help troubleshoot though I imagine, as if error, either in script or script not found/executable, then would show error in delugevpn log regardless, as using 'error' or 'warning' level, and so only reason not getting anything in log currently, is either that it's run succesfully(which you verified isn't happening), or that the 'TorrentFinishedEvent' not emited altogether, which seemingly only could have one cause here I believe - Are you testing with adding an already downloaded torrent, so just checks torrent data for few secs before showing 100% complete, or are you testing with a torrent which data you don't have already? The execute plugin only works for 'complete' in the latter case - something I stumbled upon myself a few years ago, highly frustrating me untill finally figuring it out.
Thank you for the help! You are correct, the problem was that I thought a recheck would trigger the complete status. Everything is working correctly now.
Post Reply