3.4.0 API json response problem

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
Likkie
Newbie
Newbie
Posts: 4
Joined: September 20th, 2021, 2:02 am

3.4.0 API json response problem

Post by Likkie »

After upgrading to 3.4.0 my NZBHydra stopped being able to queue downloads in SABNZB+.

I'm no expert but it seems to me that Hydra is querying SABNZB as to what categories are available so that I can select the right one when adding an NZB to the queue. The response from SABNZB is bad or non-existent, I don't know how to tell... I see a "JSON" error in Hydra...

If I downgrade SABNZB+ back to 3.3.1 everything works fine again.

I'm not sure what other info to provide.

cheers.

Likkie
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: 3.4.0 API json response problem

Post by sander »

What JSON-error in Hydra?

In SABnzbd, set logging to +Debug (via the wrench symbol)
Let the problem happen. Then upload sabnzbd.log to pastebin.com and post the URL (with spaces around the dots) here in this thread.
Likkie
Newbie
Newbie
Posts: 4
Joined: September 20th, 2021, 2:02 am

Re: 3.4.0 API json response problem

Post by Likkie »

Hi Sander.

The error I see in Hydra is:

An error occured :
500: INTERNAL SERVER ERROR

No JSON object could be decoded

I have created a debug log file of the issue happening in SABNZB, it is at pastebin with ID: iP3EKpfm (I'm not allowed to post links :'( )

Cheers,

Likkie
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: 3.4.0 API json response problem

Post by sander »

I don't see a problem in the sab logging.

Can you into the Hydra logging?
And: I assume hydra2 ?
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: 3.4.0 API json response problem

Post by sander »

More suggestions:
3.3.1: OK
3.4.0: not OK

Can you try the intermediate version, so 3.4.0 beta1 and RC1?
Likkie
Newbie
Newbie
Posts: 4
Joined: September 20th, 2021, 2:02 am

Re: 3.4.0 API json response problem

Post by Likkie »

I am not using Hydra2 (its too slow) so Hydra

Here is a the Hydra log file in pastbin W47VjKdN

I will try the other versions of SAB as you suggest...
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: 3.4.0 API json response problem

Post by sander »

the last development on hydra were in 2018: https://github.com/theotherp/nzbhydra/commits/master ...

How about trying hydra2 to see if it has the same behaviour?

Code: Select all

2021-09-21 17:56:32,490 - DEBUG - downloader - Thread-36 - Sending categories request to sabnzbd
2021-09-21 17:56:32,500 - ERROR - web - Thread-36 - No JSON object could be decoded
Traceback (most recent call last):
  File "/app/hydra/libs/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/app/hydra/libs/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/hydra/nzbhydra/web.py", line 474, in wrapped_function
    return f(*args, **kwargs)
  File "/app/hydra/libs/webargs/core.py", line 368, in wrapper
    return func(*new_args, **kwargs)
  File "/app/hydra/nzbhydra/web.py", line 1487, in internalapi_getcategories
    return jsonify({"success": True, "categories": downloader.get_categories()})
  File "/app/hydra/nzbhydra/downloader.py", line 276, in get_categories
    return r.json()["categories"]
  File "/app/hydra/libs/requests/models.py", line 850, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: 3.4.0 API json response problem

Post by sander »

In the meantime:

"Sending categories request to sabnzbd" is from:

https://github.com/theotherp/nzbhydra/b ... #L270-L272

so this method/parameters:

{"mode": "get_cats", "output": "json"}

That is this method: https://sabnzbd.org/wiki/advanced/api#get_cats

Let's try against 3.4.0


Code: Select all

$ lynx --dump '127.0.0.1:8080/api?mode=get_cats&output=json'
{"categories": ["*", "movies", "tv", "audio", "software"]}
so that looks good to me. Same response with 3.3.1 and 3.4.0
Likkie
Newbie
Newbie
Posts: 4
Joined: September 20th, 2021, 2:02 am

Re: 3.4.0 API json response problem

Post by Likkie »

OK, so I tried 3.4.0Beta1 and the problem exists there already... :(

Hydra2 is extremely slow in my Docker environment. I don't understand how people are using it.
Its takes many minutes to start and then many minutes to return from a search if it ever does. It seems really broken.

If I have to stay SAB 3.3.1 for now I will. I dont even understand what is "improved" actually.

Cheers,

Erik
Post Reply