(low prio): Internal Server Error via API History retry atte

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
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

(low prio): Internal Server Error via API History retry atte

Post by sander »

FYI / FWIW: Not sure if this is a bug, or just behaviour because of wrong input:

http://localhost:8080/sabnzbd/api?mode= ... lue=blabla leads to the internal server error below.




BTW, @shypike:
API History Format is: http://localhost:8080/sabnzbd/api?mode= ... nzo_zt2syz
With "<nzo_id>SABnzbd_nzo_lRg5ao</nzo_id>" in the History, what is the full URL for the retry of this download? I tried all kinds (see second code block), and none worked (all leading to errors)

Code: Select all

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.6.14/cherrypy/_cprequest.py", line 618, in respond
    cherrypy.response.body = self.handler()
  File "/home/sander/SABnzbd-0.6.14/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/sander/SABnzbd-0.6.14/sabnzbd/interface.py", line 398, in api
    return api_handler(kwargs)
  File "/home/sander/SABnzbd-0.6.14/sabnzbd/api.py", line 91, in api_handler
    response = _api_table.get(mode, _api_undefined)(name, output, kwargs)
  File "/home/sander/SABnzbd-0.6.14/sabnzbd/api.py", line 302, in _api_retry
    if retry_job(value, name):
  File "/home/sander/SABnzbd-0.6.14/sabnzbd/api.py", line 1373, in retry_job
    path = history_db.get_path(job)
  File "/home/sander/SABnzbd-0.6.14/sabnzbd/database.py", line 290, in get_path
    return self.c.fetchone().get('path')
AttributeError: 'NoneType' object has no attribute 'get'
Powered by CherryPy 3.2.0
Tries of URL:

Code: Select all

sander@R540:~$ wget 'http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_zt2syz'
--2011-12-24 08:30:18--  http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_zt2syz
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-12-24 08:30:18 ERROR 500: Internal Server Error.

sander@R540:~$ 
sander@R540:~$ 
sander@R540:~$ wget 'http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_lRg5ao_zt2syz'
--2011-12-24 08:30:56--  http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_lRg5ao_zt2syz
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-12-24 08:30:56 ERROR 500: Internal Server Error.

sander@R540:~$ 
sander@R540:~$ wget 'http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_lRg5ao2syz'
--2011-12-24 08:31:25--  http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_lRg5ao2syz
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-12-24 08:31:25 ERROR 500: Internal Server Error.

sander@R540:~$ wget 'http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_lRg5ao'
--2011-12-24 08:31:29--  http://localhost:8080/sabnzbd/api?mode=retry&value=SABnzbd_nzo_lRg5ao
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-12-24 08:31:29 ERROR 500: Internal Server Error.

sander@R540:~$ 

User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: (low prio): Internal Server Error via API History retry

Post by shypike »

Are you sure that there is a retry link in History?

When checking this I came across a bug.
When a job is unrepairable, any present SFV files are used to do a last effort check.
However, there's a bug in the SFV check: missing files are listed, but do not lead to a failed job!
(Damages files do lead to a failed job.)
So you end up with a History entry that looks like a failed job, but cannot retried.
It doesn't have a Retry link and will also not respond to an Api retry call.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: (low prio): Internal Server Error via API History retry

Post by sander »

Oh ... no; it was just a download with Download-only, succesfully in History.
I hadn't realised that a retry-offer was necessary.

About the webserver error: it now looks like an error. Is that a bug?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: (low prio): Internal Server Error via API History retry

Post by shypike »

Strictly speaking, it's a bug.
The cause is mainly lack of full validation of parameters.
There are no ill side-effects as CherryPy handles crashes in application code quite well.
It will be improved in a later release, after we upgrade to a more recent CherryPy.
Post Reply