Page 1 of 1

addlocalfile returns ok on error

Posted: June 10th, 2012, 9:53 am
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.

Re: addlocalfile returns ok on error (addendum)

Posted: June 10th, 2012, 10:50 am
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

Re: Help With Categories

Posted: June 10th, 2012, 11:03 am
by shypike
Solved in release 0.7.0RC2