Interesting: using the example from
http://wiki.sabnzbd.org/api#toc42 I get the same error message as you:
Code: Select all
sander@R540:~$ lynx --dump 'http://localhost:8080/api?mode=history&name=delete&value=SABnzbd_nzo_zt2syz,SABnzbd_nzo_df2hyd,SABnzbd_nzo_op3shf'
500 Internal Server Error
The server encountered an unexpected condition which prevented it from
fulfilling the request.
Traceback (most recent call last):
File "/home/sander/SABnzbd-0.7.0Alpha2/cherrypy/_cprequest.py", line 618, in r
espond
cherrypy.response.body = self.handler()
File "/home/sander/SABnzbd-0.7.0Alpha2/cherrypy/_cpdispatch.py", line 25, in _
_call__
return self.callable(*self.args, **self.kwargs)
File "/home/sander/SABnzbd-0.7.0Alpha2/sabnzbd/interface.py", line 403, in api
return api_handler(kwargs)
File "/home/sander/SABnzbd-0.7.0Alpha2/sabnzbd/api.py", line 99, in api_handle
r
response = _api_table.get(mode, _api_undefined)(name, output, kwargs)
File "/home/sander/SABnzbd-0.7.0Alpha2/sabnzbd/api.py", line 429, in _api_hist
ory
del_hist_job(job, del_files)
File "/home/sander/SABnzbd-0.7.0Alpha2/sabnzbd/api.py", line 1452, in del_hist
_job
path = history_db.get_path(job)
File "/home/sander/SABnzbd-0.7.0Alpha2/sabnzbd/database.py", line 291, in get_
path
return self.c.fetchone().get('path')
AttributeError: 'NoneType' object has no attribute 'get'
Powered by [1]CherryPy 3.2.0
References
1. http://www.cherrypy.org/
sander@R540:~$
Another API command just works:
Code: Select all
sander@R540:~$ lynx --dump 'http://localhost:8080/api?mode=history&output=xml' | tail -4
/home/sander/SABnzbd-0.7.0Alpha2/interfaces/Config/templates False
False True http://wiki.sabnzbd.org/ 10m 53.4 G 39.8 G /home/sander 12.2
G 0.7.0Alpha2 /home/sander/.sabnzbd gold False Idle 0 False None 0 B
1000.0 G 0 B 0.00 8.08 8.08 0:00:00 True 0 unknown 0.00
sander@R540:~$
Ah, I think I found the reason:
Code: Select all
sander@R540:~$ lynx --dump 'http://localhost:8080/api?mode=history&name=delete&value=SABnzbd_nzo_U2ooDd,SABnzbd_nzo__CGnOP'
ok
sander@R540:~$
These are (were) existing nzo_id's. Running it again (with the nzo_id's already deleted), gives the error message again:
Code: Select all
sander@R540:~$ lynx --dump 'http://localhost:8080/api?mode=history&name=delete&value=SABnzbd_nzo_U2ooDd,SABnzbd_nzo__CGnOP'
500 Internal Server Error
The server encountered an unexpected condition which prevented it from
fulfilling the request.
Traceback (most recent call last):
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/cherrypy/_cprequest.py", line
618, in respond
cherrypy.response.body = self.handler()
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/cherrypy/_cpdispatch.py", line
25, in __call__
return self.callable(*self.args, **self.kwargs)
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/sabnzbd/interface.py", line 39
6, in api
return api_handler(kwargs)
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/sabnzbd/api.py", line 83, in a
pi_handler
response = _api_table.get(mode, _api_undefined)(name, output, kwargs)
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/sabnzbd/api.py", line 406, in
_api_history
del_hist_job(job, del_files)
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/sabnzbd/api.py", line 1355, in
del_hist_job
path = history_db.get_path(job)
File "/home/sander/oude-SABnzbd's/SABnzbd-0.6.1/sabnzbd/database.py", line 282
, in get_path
return self.c.fetchone().get('path')
AttributeError: 'NoneType' object has no attribute 'get'
Powered by [1]CherryPy 3.2.0
References
1. http://www.cherrypy.org/
sander@R540:~$
So:
1) use existing nzo_id's and it works
2) use non-existing nzo_id's and SAB gives an exception. I guess that's a bug.