addlocalfile returns ok on error

Report & discuss bugs found in 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
reims67
Newbie
Newbie
Posts: 5
Joined: June 10th, 2012, 9:05 am

addlocalfile returns ok on error

Post by reims67 »

Hello,

When a nzb file is added using addlocalfile API, sabnzbd replies 'ok' even on error.

* 1st case:

I have one unix user with a file in /tmp with 0600 permission and sabnzbd runs as a different user. Each time the file is sent to sabnzbd, I receive an 'ok' but the file is not added. The log file contains these lines:

Code: Select all

2012-06-10 16:37:25,274::WARNING::[dirscanner:155] Cannot read /tmp/xxxxxX.nzb
2012-06-10 16:37:25,275::INFO::[dirscanner:156] Traceback: 
Traceback (most recent call last):
  File "/my_home_dir/SABnzbd-0.6.15/sabnzbd/dirscanner.py", line 140, in ProcessSingleFile
    f = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/tmp/xxxxxX.nzb'
* 2nd case:

If the filename given to addlocalfile does not have a recognized extension (.zip, .rar, .nzb, .gz), sabnzbd replies 'ok' (in doubt ;) ), log file contains nothing. The problem comes from api.py, line 327-332. There is an if/elif but no else to return an error code, something like (I think, I am no python developer)

Code: Select all

    else:
        return report(output, _MSG_OUTPUT_FORMAT)
Thanks for you great program.
reims67
Newbie
Newbie
Posts: 5
Joined: June 10th, 2012, 9:05 am

Re: addlocalfile returns ok on error (addendum)

Post by reims67 »

To complete my previous report, here is additionnal informations:

Version: 0.6.15
OS: Linux (gentoo 64 bits)
Install-type: python source
Firewall: open office.... just kidding, french joke :D
IPv6: no
Reproducible: always
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Help With Categories

Post by shypike »

Solved in release 0.7.0RC2
Post Reply