Page 1 of 1

Problem with Execute plugin

Posted: Tue Sep 23, 2014 4:18 am
by overlord
I'm trying to run a python script after completion of download. This script used to work, but I recently moved everything to a new server. I can run the script manually and it works perfectly. When deluge runs it, I get the following in the /var/log/deluged/daemon.log

Code: Select all

[WARNING ] 20:13:06 core:124 [execute] command '/home/deluge/flexget/deluge_torrent_complete.py
' failed with exit code 1
[WARNING ] 20:13:06 core:128 [execute] stderr: Upon execvpe /home/deluge/flexget/deluge_torrent_complete.py
 ['/home/deluge/flexget/deluge_torrent_complete.py\n', 'c74148acb4c0bfc064d7281da4de24a01cc550af', 'Torrent name', 'path'] in environment id 140113411545640
:Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 403, in _fork
    path, uid, gid, executable, args, environment)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 453, in _execChild
    os.execvpe(executable, args, environment)
  File "/usr/lib/python2.7/os.py", line 353, in execvpe
    _execvpe(file, args, env)
  File "/usr/lib/python2.7/os.py", line 368, in _execvpe
    func(file, *argrest)
OSError: [Errno 2] No such file or directory

Any ideas?

Re: Problem with Execute plugin

Posted: Tue Sep 23, 2014 5:34 pm
by Cas
What did you put in the execute command?

Re: Problem with Execute plugin

Posted: Tue Sep 23, 2014 8:45 pm
by overlord
My execute command in the config is:

/home/deluge/flexget/deluge_torrent_complete.py

Re: Problem with Execute plugin

Posted: Tue Sep 23, 2014 11:16 pm
by Cas
Rereading the log I can now see there is a newline appended to the filename, delete that whitespace and it should work. If you could open a ticket that would be helpful and it can be fixed.

Re: Problem with Execute plugin

Posted: Tue Sep 23, 2014 11:37 pm
by overlord
I saw that newline as well, but the entry on the config page doesn't have a newline and the entry in the config file doesn't have a newline either, not sure where that is coming from. I can submit a ticket, but I can't find anywhere to ditch the newline

my execute.conf is as follows:

Code: Select all

{
  "file": 1,
  "format": 1
}{
  "commands": [
    [
      "84c3f73b9b91f7ce7d2993ed5ab55fcb27e1dbc1",
      "complete",
      "/home/deluge/flexget/deluge_torrent_complete.py"
    ]
  ]
}

Re: Problem with Execute plugin

Posted: Wed Sep 24, 2014 3:55 am
by overlord
So, I decided to delete the execute.conf file and let it re-create itself. Now the script is working. Wish I knew what caused it to fail before, but glad it's working now.

Thanks for the pointer