0

When cmd is run manually it works with no issues, but when run from another program on linux it gives me an error in the logs. Any ideas would be greatly appreciated. thanks

Comes up with this error when in logs when i check log files.

[WARNING ] 17:39:20 core:124 [execute] command 'perl /home/josh/scripts/deluge/sorttv.pl' failed with exit code 1
[WARNING ] 17:39:20 core:128 [execute] stderr: Upon execvpe perl /home/josh/scripts/deluge/sorttv.pl ['perl /home/josh/scripts/deluge/sorttv.pl', '176426f007943621q60bc72d3ae333af46a0d502', 'Continuum Season 2', '/home/josh/media/!complete'] in environment id 25326672
:Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 420, in _fork
executable, args, environment)
File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 466, 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

UPDATE-

now i get a diff error-

[WARNING ] 21:43:00 core:124 [execute] command './home/josh/scripts/deluge/sorttv.pl' failed with exit code 2
[WARNING ] 21:43:00 core:128 [execute] stderr: Can't locate WWW/TheMovieDB.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./home/josh/scripts/deluge/sorttv.pl line 56.
BEGIN failed--compilation aborted at ./home/josh/scripts/deluge/sorttv.pl line 56.
14
  • Iv changed the command on deluge by removing the 'perl' so it now just runs './home/josh/scripts/deluge/sorttv.pl' check above I believe iv installed WWW/TheMovieDB.pm but maybe not correctly Commented Dec 10, 2013 at 2:46
  • New error: It's expecting module WWW::TheMovieDB to be installed. Install it Commented Dec 10, 2013 at 2:50
  • I did, says its upto-date Commented Dec 10, 2013 at 3:05
  • Could also be a permission problem. What is the full path to TheMovieDB.pm? (perldoc -l WWW::TheMovieDB might give it to you, or you can use find to scour your system) Commented Dec 10, 2013 at 3:13
  • its located in - /usr/local/lib/perl5/site_perl/5.18.1/WWW/TheMovieDB.pm Commented Dec 10, 2013 at 3:16

2 Answers 2

2

You instructed execvpe to look for an executable named perl /home/josh/scripts/deluge/sorttv.pl. As you can imagine, it did not find it.

What you did was equivalent to entering the following in the shell:

'perl /home/josh/scripts/deluge/sorttv.pl' ...

/home/josh/scripts/deluge/sorttv.pl should be passed as an argument. Instead of

args = (...)
os.execvpe('perl /home/josh/scripts/deluge/sorttv.pl', args, env)

You want

args = ('/home/josh/scripts/deluge/sorttv.pl', ...)
os.execvpe('perl', args, env)
Sign up to request clarification or add additional context in comments.

1 Comment

I didnt make the script. Im just trying to get it to work with deluge. So the problem lies with deluge or the script?
1

You need to provide the argument seperately from the command when you call the function in python. As you can see, the executable (perl) should be the first argument to execvpe, and the argument /home/josh/scripts/deluge/sorttv.pl should be the second.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.