Page 1 of 1

Crashes when adding NZB via API

Posted: March 28th, 2017, 5:52 am
by upanddown
I had been having random issues with sabnzbd crashing and could never trace or reproduce the cause. However, I am now consistently crashing it with the following (with several different NZB's from a public and popular indexer that is always good):

MyIP:8181/api?mode=addurl&name=URL-of-valid-nzb&nzbname=My-Random-Name&pp=3&priority=10&output=json&apikey=MyKey

...but if I use the web gui to load the same NZB from the URL then everything is fine.

API command response is:

{"status": true, "nzo_ids": ["SABnzbd_nzo_f9hfl3"]}

....and then it dies and the web gui says it's waiting for SABNZBd to restart. Close it, re-open and I find this exactly, every time:

28/Mar/2017:05:09:43] HTTP
Traceback (most recent call last):
File "cherrypy\_cprequest.pyo", line 670, in respond
File "cherrypy\lib\encoding.pyo", line 220, in __call__
File "cherrypy\_cpdispatch.pyo", line 60, in __call__
File "sabnzbd\interface.pyo", line 516, in tapi
File "sabnzbd\api.pyo", line 113, in api_handler
File "sabnzbd\api.pyo", line 176, in _api_queue
File "sabnzbd\api.pyo", line 285, in _api_queue_default
File "sabnzbd\api.pyo", line 1360, in build_queue
KeyError: 10


System information is:

Version: 1.2.3
OS: Windows Datacenter - Azure VM
Install-type: Windows Installer
Firewall Software: Windows Firewall
IPV6? no
Reproducible? yes

I'm lost, as my Google searches gave me nothing. Any ideas?

Re: Crashes when adding NZB via API

Posted: March 28th, 2017, 6:17 am
by safihre
That is because priority=10 doesn't exist, how did you come up with that value?

https://sabnzbd.org/wiki/advanced/api#addurl

Re: Crashes when adding NZB via API

Posted: March 28th, 2017, 11:59 am
by upanddown
ROFL ....unadulterated stupidity, and lack of sleep? I somehow had it in my head that it was a relative value, more like a z-index in CSS, where higher values were pushed to the top of the stack.

I never snapped after a few hours of banging my head on it. Sorry to waste your time, but thank you for saving a lot of mine!

Thanks!

Re: Crashes when adding NZB via API

Posted: March 28th, 2017, 1:54 pm
by safihre
Of course we should check our input values ;)
Just no-one tried so far to put anything else than the defined ones :D