Page 1 of 1

3.4.0 API json response problem

Posted: September 20th, 2021, 2:24 am
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

Re: 3.4.0 API json response problem

Posted: September 20th, 2021, 3:54 am
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.

Re: 3.4.0 API json response problem

Posted: September 21st, 2021, 1:37 am
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

Re: 3.4.0 API json response problem

Posted: September 21st, 2021, 2:03 am
by sander
I don't see a problem in the sab logging.

Can you into the Hydra logging?
And: I assume hydra2 ?

Re: 3.4.0 API json response problem

Posted: September 21st, 2021, 2:14 am
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?

Re: 3.4.0 API json response problem

Posted: September 21st, 2021, 3:03 am
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...

Re: 3.4.0 API json response problem

Posted: September 21st, 2021, 3:45 am
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

Re: 3.4.0 API json response problem

Posted: September 21st, 2021, 4:02 am
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

Re: 3.4.0 API json response problem

Posted: September 23rd, 2021, 4:32 am
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