Page 1 of 1

timeout when adding NZB via UI whilst downloading

Posted: May 25th, 2018, 1:28 am
by OneCD
Hello.
  • SABnzbd 2.3.3 with the "Glitter - Night" skin
  • Python 2.7.13
  • Debian 9.4 Stretch (64b)
  • Intel Atom D2700 with 2.9GB RAM.
  • System load is currently in the low-to-mid 3's - but this problem occurs even when less than 1.
  • Accessed via FireFox Quantum 59.0.2 (64b) on a separate Debian system.
I noticed (about the time I upgraded to 2.3.3 from 2.3.2) that most of the time, when I add one or more NZBs via the web UI, the importer seems to crash. This occurs if the queue is downloading like it usually is, and I try adding a largish NZB. If it's over about 2MB, it will happen every time. I'll see errors start accumulating in the log even though the foreground indicates the file is still uploading. I have to close that tab, and open a new one. I then check the UI error log and see something like this on the web-page:
Traceback (most recent call last):
File "/opt/sabnzbd/cherrypy/_cprequest.py", line 663, in respond
self.body.process()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 989, in process
super(RequestBody, self).process()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 558, in process
proc(self)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 223, in process_multipart_form_data
process_multipart(entity)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 215, in process_multipart
part.process()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 556, in process
self.default_proc()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 715, in default_proc
self.file = self.read_into_file()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 730, in read_into_file
self.read_lines_to_boundary(fp_out=fp_out)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 667, in read_lines_to_boundary
line = self.fp.readline(1 << 16)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 860, in readline
data = self.read(chunksize)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 824, in read
data = self.fp.read(chunksize)
File "/opt/sabnzbd/cherrypy/wsgiserver/__init__.py", line 360, in read
data = self.rfile.read(size)
File "/opt/sabnzbd/cherrypy/wsgiserver/__init__.py", line 1138, in read
data = self.recv(left)
File "/opt/sabnzbd/cherrypy/wsgiserver/__init__.py", line 1070, in recv
data = self._sock.recv(size)
timeout: timed out
If I don't close that uploading tab, I'll end up with a bunch of these timeout blocks.

Here's the SABnzd info log for the same event logged above. As can be seen, this NZB is a little over 5MB. The timeout occurred after (maybe) 30 seconds:
2018-05-25 15:57:29,341::INFO::[_cplogging:219] [25/May/2018:15:57:29] HTTP
Request Headers:
Content-Length: 5396386
REFERER: http://talia:8800/sabnzbd/
HOST: talia:8800
CONNECTION: keep-alive
Remote-Addr: 10.0.0.10
ACCEPT: */*
USER-AGENT: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
X-REQUESTED-WITH: XMLHttpRequest
ACCEPT-LANGUAGE: en-AU,en-US;q=0.7,en;q=0.3
DNT: 1
Content-Type: multipart/form-data; boundary=---------------------------<HASH>268
ACCEPT-ENCODING: gzip, deflate
COOKIE: wanted_view=list; snatched_view=list; soon_view=thumb; suggest_view=thumb; late_view=list; manage_view=thumb; blu_ray_com_new_releases_view=thumb; imdb_movies_in_theaters_view=thumb; imdb_box_office_view=thumb; advanced_toggle_checked=0; compact_display_state=false; ys-detailsPanel=o%3Aheight%3Dn%253A515
2018-05-25 15:57:29,343::ERROR::[_cplogging:219] [25/May/2018:15:57:29] HTTP
Traceback (most recent call last):
File "/opt/sabnzbd/cherrypy/_cprequest.py", line 663, in respond
self.body.process()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 989, in process
super(RequestBody, self).process()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 558, in process
proc(self)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 223, in process_multipart_form_data
process_multipart(entity)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 215, in process_multipart
part.process()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 556, in process
self.default_proc()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 715, in default_proc
self.file = self.read_into_file()
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 730, in read_into_file
self.read_lines_to_boundary(fp_out=fp_out)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 667, in read_lines_to_boundary
line = self.fp.readline(1 << 16)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 860, in readline
data = self.read(chunksize)
File "/opt/sabnzbd/cherrypy/_cpreqbody.py", line 824, in read
data = self.fp.read(chunksize)
File "/opt/sabnzbd/cherrypy/wsgiserver/__init__.py", line 360, in read
data = self.rfile.read(size)
File "/opt/sabnzbd/cherrypy/wsgiserver/__init__.py", line 1138, in read
data = self.recv(left)
File "/opt/sabnzbd/cherrypy/wsgiserver/__init__.py", line 1070, in recv
data = self._sock.recv(size)
timeout: timed out
2018-05-25 15:58:18,247::INFO:: <--- and back to normal.
But if I stop the download queue, then add the NZBs, no problem.

I've been bypassing the UI and putting these NZBs in my watch folder instead as this works every time.

Any thoughts? Thank you. :)

Re: timeout when adding NZB via UI whilst downloading

Posted: May 25th, 2018, 1:40 am
by safihre
Hmm, seems the sockets are too busy to get data for your upload. CherryPy is trying to read new incoming data, but can't.
Seems like a priority problem in which connections come first, this is on the NAS right?

Re: timeout when adding NZB via UI whilst downloading

Posted: May 25th, 2018, 1:57 am
by OneCD
Yes, NAS is correct.

Re: timeout when adding NZB via UI whilst downloading

Posted: May 27th, 2018, 3:29 pm
by safihre
Wonder if we can do anything about that.. Pause downloading while we get uploads to keep the sockets free?

Re: timeout when adding NZB via UI whilst downloading

Posted: May 28th, 2018, 2:27 pm
by OneCD
Is that an option/switch already? Can we make it one? ;)

Re: timeout when adding NZB via UI whilst downloading

Posted: May 28th, 2018, 3:24 pm
by safihre
I should just make SAB faster so it doesn't happen at all :D

Re: timeout when adding NZB via UI whilst downloading

Posted: May 28th, 2018, 3:27 pm
by OneCD
Or I should stop running it on 6 year old hardware. ;D