Can't run post processing script from SABnzbd

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
lebovitz
Newbie
Newbie
Posts: 3
Joined: September 26th, 2011, 12:59 am

Can't run post processing script from SABnzbd

Post by lebovitz »

Hi,

While trying to run the script I get the (somewhat famous) error:
Exit(-1) Cannot run script /share/HDA_DATA/.qpkg/SickBeard/autoProcessTV/sabToSickBeard.py (More)

In SABnzbd logs I get the following:

2011-09-25 17:55:55,383::INFO::[newsunpack:132] Running external script /share/HDA_DATA/.qpkg/SickBeard/autoProcessTV/sabToSickBeard.py(/share/HDA_DATA/Qdownload/sabnzbd/complete/TV/Comedy_Central_Presents_S09E07_Christian_Finnegan_PDTV_XviD_MiNDTHEGAP, Comedy Central Presents S09E07 Christian Finnegan PDTV XviD MiNDTHEGAP.nzb, Comedy_Central_Presents_S09E07_Christian_Finnegan_PDTV_XviD_MiNDTHEGAP, , tv, alt.binaries.multimedia, 0)
2011-09-25 17:55:55,581::DEBUG::[newsunpack:139] Failed script /share/HDA_DATA/.qpkg/SickBeard/autoProcessTV/sabToSickBeard.py, Traceback:
Traceback (most recent call last):
File "/share/HDA_DATA/.qpkg/SABnzbdplus/sabnzbd/newsunpack.py", line 137, in external_processing
startupinfo=stup, env=env, creationflags=creationflags)
File "/opt/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/opt/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I'm not familiar with Python, but it seems there's some issue with the arguments passed to the post-script.
Needless to say I can run the script from terminal, giving it the directory path as an argument. Also the scripts have their permissions set to 755.
/usr/bin/python is linked to /opt/bin/python2.6
and in the top of my scripts I have: #!/usr/bin/python

I have modified the Python script to print the arguments to a log file, however the log file isn't created at all, so I assume SABnzbd couldn't find the script file. However when I copy the script path from the log file and paste it to the shell I have no problem running it.

Does anyone have an idea on what's wrong?

System details:
Version: 0.6.9
OS: Linux (QNAP)
Install-type: QNAP package
Skin (if applicable): Plush
Firewall Software: None
Are you using IPV6?: no
Is the issue reproducible? yes
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Can't run post processing script from SABnzbd

Post by shypike »

Check if the script is executable.
chmod +x sabToSickBeard.py
The check if the first line of the script points to the right location.
It's something like
#!/usr/bin/python
Make sure that your Python program is in that location, if not change the script.
lebovitz
Newbie
Newbie
Posts: 3
Joined: September 26th, 2011, 12:59 am

Re: Can't run post processing script from SABnzbd

Post by lebovitz »

As I said above the permissions are set to 755 and in the top of the script I have /usr/bin/python.

I also said that I can run the script from the shell (showing that it is executable and the path in the file points to a valid python file).
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Can't run post processing script from SABnzbd

Post by shypike »

Well, the path is logged: /share/HDA_DATA/.qpkg/SickBeard/autoProcessTV/sabToSickBeard.py
and there's a message straight from the OS: "OSError: [Errno 2] No such file or directory".
What more can I say?
Depending on how you start, SABnzbd may not get the same PATH as when you a interactive bash shell.
Does SABnzbd run with the same user account and/or access rights as when you use a shell?
lebovitz
Newbie
Newbie
Posts: 3
Joined: September 26th, 2011, 12:59 am

Re: Can't run post processing script from SABnzbd

Post by lebovitz »

How do I know which user "runs" sabnzbd?
That's about the limit of my Linux knowledge.
I'm running it in QNAP...
The only user (I know of) in this system is admin (which should be equal to root).
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Can't run post processing script from SABnzbd

Post by shypike »

Does SABnzbd autostart using some startup script from a package?
If so, you should check that out.
My remarks about PATH are still valid.
Can you ask the package creator?
Post Reply