Page 1 of 1

Error 413:RequestEntityTooLarge

Posted: October 26th, 2021, 12:56 pm
by beerdedfellow
Hello Forum,

My first post here -- my apologies if this has been covered before but I've been searching on this issue but have not found anything helpful. I am currently using radarr v3 to connect to the newest version of sabnzbd (just updated to 3.4.2). With most of my media, I am getting the error "413:RequestEntityTooLarge" being returned from sabnzbd. This seems to happen even on smaller media, sub 10G. When I attempt to upload the NZB to sabnzbd manually, it says "uploading" but just spins there indefinitely. Based on what I have read this is a setting in the web service that can be changed, but I'm not sure how (or why that's necessary), as this setup was working cleanly before.

Any help in pointing me in the right direction would be greatly appreciated. Thanks!

Re: Error 413:RequestEntityTooLarge

Posted: October 26th, 2021, 1:20 pm
by sander
Can you reproduce if you use the SABnzbd interface directly, so without Radarr?

Did you read https://github.com/Radarr/Radarr/search ... ype=issues ?

I did a brute-force search, and '413 Request Entity Too Large' does exist in the cherrypy library used by SABnzbd. So it's possible that SAB is yielding that error, but now we have to find how/when

Code: Select all

$ grep -irn Request /usr/lib/python3/dist-packages/cherrypy | grep -i large
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:425:            raise MaxSizeExceeded('Request Entity Too Large', self.maxlen)
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:442:            raise IOError('Request Entity Too Large')
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:528:                raise IOError('Request Entity Too Large')
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:616:                '413 Request Entity Too Large',
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:742:                '413 Request Entity Too Large',
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:856:                        '413 Request Entity Too Large',
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:883:            # Request Entity Too Large / Request-URI Too Long
/usr/lib/python3/dist-packages/cherrypy/wsgiserver/__init__.py:926:            # Request Entity Too Large. Close conn to avoid garbage.
/usr/lib/python3/dist-packages/cherrypy/_cpserver.py:99:    If exceeded, the HTTP server should return "413 Request Entity Too Large".
/usr/lib/python3/dist-packages/cherrypy/_cpserver.py:104:    the HTTP server should return "413 Request Entity Too Large"."""

Re: Error 413:RequestEntityTooLarge

Posted: October 26th, 2021, 1:29 pm
by beerdedfellow
Thanks Sander,

Neither of the above radarr issues seem to apply to me. I'm not selecting large quantities of movies, only attempting to download a single file. Do you have any ideas on how we can go about reproducing this without radarr? As mentioned when I upload manually it just hangs on "Uploading 1 ...". The dots are scrolling, so it's doing stuff, it just never finishes.

Re: Error 413:RequestEntityTooLarge

Posted: October 26th, 2021, 1:38 pm
by sander
beerdedfellow wrote: October 26th, 2021, 1:29 pm As mentioned when I upload manually it just hangs on "Uploading 1 ...". The dots are scrolling, so it's doing stuff, it just never finishes.
But no error?
How big is the .nzb file itself?

So the error is only in Radarr? At that moment, is there anything in the SAB webinterface or sabnzbd.log?

Re: Error 413:RequestEntityTooLarge / 413 Request Entity Too Large

Posted: October 26th, 2021, 1:43 pm
by sander
Ah, this is interesting:

Code: Select all

$ curl -vvv http://localhost:8080/sabnzbd/api  -F mode=addfile -F "name=@/home/sander/text-file-100M-chars.txt"
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /sabnzbd/api HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 104857902
> Content-Type: multipart/form-data; boundary=------------------------9730a43799e92b88
> Expect: 100-continue
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 413 Request Entity Too Large
< Content-Length: 67
< Content-Type: text/plain
< Connection: close
< 
* Closing connection 0
The entity sent with the request exceeds the maximum allowed bytes.

sander@stream13:~$
So trying to upload a 100MB text file, SABnzbd API says "HTTP/1.1 413 Request Entity Too Large".

That seems the correct response for a 100MB .nzb file.

So ... how big is your .NZB file ... ?

Re: Error 413:RequestEntityTooLarge

Posted: October 26th, 2021, 5:55 pm
by beerdedfellow
The file is 3MB on disk

Re: Error 413:RequestEntityTooLarge

Posted: October 27th, 2021, 2:22 am
by sander
beerdedfellow wrote: October 26th, 2021, 5:55 pm The file is 3MB on disk
Can you send that NZB to [email protected] with subject "413:RequestEntityTooLarge / sander"

Re: Error 413:RequestEntityTooLarge

Posted: October 27th, 2021, 3:24 pm
by beerdedfellow
Sent

Re: Error 413:RequestEntityTooLarge

Posted: October 28th, 2021, 2:34 am
by sander
beerdedfellow wrote: October 27th, 2021, 3:24 pmSent
Received. And uploaded via WebGUI into SABnzbd ... no problem at all. So I can't reproduce.

Have you tried a different browser? EDIT: it might be your browser is sending too big / too many cookies to SABnzbd's built-in webserver cherrypy

Re: Error 413:RequestEntityTooLarge

Posted: October 28th, 2021, 8:13 am
by safihre
Additionally, can you clear your cookies?

Re: Error 413:RequestEntityTooLarge

Posted: October 28th, 2021, 1:00 pm
by beerdedfellow
Thanks guys,

I didn't suspect it was an issue with the NZB file since it's behaving this way with so many of them. It's downloaded movies recently from radarr though, so it's very strange that it's being so selective.

I've tried uploading the NZB via the web interface in a browser that has never visited the site before (safari). I still get the same behavior, it just hangs out on "uploading 1...". I scrolled the logs while I did this, but all I see are "GET /api" requests (which are constantly being spammed -- assuming this is normal). I see nothing that seems like an upload. I even moved the container to the unstable branch and re-launched it, still with the same results.

This is difficult because while DEBUG logging is enabled, sab is not logging the attempt to upload via web interface, nor does it seem to be logging the failures resulting from "RequestEntityTooLarge". All of the inter-workings of the container permissions within the kubernetes cluster look right. It has a config volume and the media volume, both of which it has write access to. Also, as mentioned some downloads work, so we know the cluster/container config should be accurate.

I suspect the two issues may be related (web upload failing + api failing), but not sure which one is simpler to troubleshoot. Where do we go from here?

Really appreciate the help.

Re: Error 413:RequestEntityTooLarge

Posted: October 28th, 2021, 1:52 pm
by sander
Those repeated API requests logging is probably your webbrowser itself
I didn't suspect it was an issue with the NZB file
OK, but what do you suspect the problem is, as others cannot reproduce it? Your Kubernetes container setup? Is there more involved, like a proxy?

What if you run SAB direct on an OS, preferrably on another machine ... ?

Re: Error 413:RequestEntityTooLarge

Posted: October 28th, 2021, 2:04 pm
by safihre
The error will also be thrown if the request headers are too large. Since you have such a custom setup, I wonder if you might also have a proxy or something like that.

Indeed, it will only log api request that make it through to the Sabnzbd core code. The request is already being blocked by the web server.