URLGRABBER CRASHED ZeroDivisionError: division by zero

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
MThJtER
Newbie
Newbie
Posts: 4
Joined: January 3rd, 2023, 9:18 am

URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by MThJtER »

Running 3.7.1 [479daf0]

seeing the following error when queue item is failing to get nzb state.

Code: Select all

URLGRABBER CRASHED
Traceback (most recent call last):
..
ZeroDivisionError: division by zero
MThJtER
Newbie
Newbie
Posts: 4
Joined: January 3rd, 2023, 9:18 am

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by MThJtER »

just fyi - unable to add full trace as 'New users are not allowed to post links'. I think the full file name is being seen as a web url.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by jcfp »

MThJtER wrote: January 4th, 2023, 11:48 amunable to add full trace as 'New users are not allowed to post links'
Please put the log or trace on a pastebin, and post the link in a way the anti-spam doesn't trigger on it (e.g. pastebin com abcd1234).
MThJtER
Newbie
Newbie
Posts: 4
Joined: January 3rd, 2023, 9:18 am

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by MThJtER »

pastebin 2Ug1TdBc

i'm also seeing a slightly different trace happening:
pastebin mNd5quRS

in both cases, the entire download queue gets stuck in this 'trying to fetch' state. If I restart sab, it starts working again. The divide by zero error shows up a few times, but it doesn't block completion of fetch or download.
User avatar
sander
Release Testers
Release Testers
Posts: 9070
Joined: January 22nd, 2008, 2:22 pm

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by sander »

I believe this one is already solved in the develop version

yes: https://github.com/sabnzbd/sabnzbd/blob ... ue.py#L588

https://github.com/sabnzbd/sabnzbd/comm ... 69842f6a99

https://github.com/sabnzbd/sabnzbd/pull/2369

For Google reference

Code: Select all

  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 594, in sort_queue
    self.__nzo_list.sort(key=sort_function, reverse=reverse)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 588, in <lambda>
    sort_function = lambda nzo: nzo.remaining / nzo.bytes
ZeroDivisionError: division by zero
https://pastebin.com/2Ug1TdBc
https://pastebin.com/mNd5quRS

Code: Select all

URLGRABBER CRASHED
Traceback (most recent call last):
  File "/app/sabnzbd/sabnzbd/urlgrabber.py", line 245, in run
    res, _ = sabnzbd.nzbparser.add_nzbfile(
  File "/app/sabnzbd/sabnzbd/nzbparser.py", line 127, in add_nzbfile
    return process_single_nzb(
  File "/app/sabnzbd/sabnzbd/nzbparser.py", line 350, in process_single_nzb
    nzo_ids.append(sabnzbd.NzbQueue.add(nzo, quiet=bool(reuse)))
  File "/app/sabnzbd/sabnzbd/decorators.py", line 54, in call_func
    return func(*params, **kparams)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 380, in add
    self.sort_queue(field, direction)
  File "/app/sabnzbd/sabnzbd/decorators.py", line 54, in call_func
    return func(*params, **kparams)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 594, in sort_queue
    self.__nzo_list.sort(key=sort_function, reverse=reverse)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 588, in <lambda>
    sort_function = lambda nzo: nzo.remaining / nzo.bytes
ZeroDivisionError: division by zero

Code: Select all

ERROR 2 hours ago [05/Jan/2023:06:25:07] HTTP 
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/usr/lib/python3.10/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/usr/lib/python3.10/site-packages/cherrypy/lib/encoding.py", line 223, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/app/sabnzbd/sabnzbd/interface.py", line 180, in internal_wrap
    return wrap_func(*args, **kwargs)
  File "/app/sabnzbd/sabnzbd/interface.py", line 456, in api
    return api_handler(kwargs)
  File "/app/sabnzbd/sabnzbd/api.py", line 104, in api_handler
    response = _api_table.get(mode, (_api_undefined, 2))[0](name, kwargs)
  File "/app/sabnzbd/sabnzbd/api.py", line 589, in _api_addurl
    nzo_id = sabnzbd.urlgrabber.add_url(name, pp, script, cat, priority, nzbname, password)
  File "/app/sabnzbd/sabnzbd/urlgrabber.py", line 408, in add_url
    future_nzo = sabnzbd.NzbQueue.generate_future(msg, pp, script, cat, url=url, priority=priority, nzbname=nzbname)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 269, in generate_future
    self.add(future_nzo)
  File "/app/sabnzbd/sabnzbd/decorators.py", line 54, in call_func
    return func(*params, **kparams)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 380, in add
    self.sort_queue(field, direction)
  File "/app/sabnzbd/sabnzbd/decorators.py", line 54, in call_func
    return func(*params, **kparams)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 594, in sort_queue
    self.__nzo_list.sort(key=sort_function, reverse=reverse)
  File "/app/sabnzbd/sabnzbd/nzbqueue.py", line 588, in <lambda>
    sort_function = lambda nzo: nzo.remaining / nzo.bytes
ZeroDivisionError: division by zero
User avatar
safihre
Administrator
Administrator
Posts: 5523
Joined: April 30th, 2015, 7:35 am
Contact:

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by safihre »

In that case:
You can stop the problem by disabling Auto Sort in Config Switches.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9070
Joined: January 22nd, 2008, 2:22 pm

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by sander »

safihre wrote: January 5th, 2023, 9:14 am In that case:
You can stop the problem by disabling Auto Sort in Config Switches.
That. Or if not handy for you: use develop version of SABnzbd. You seem to run from source.
MThJtER
Newbie
Newbie
Posts: 4
Joined: January 3rd, 2023, 9:18 am

Re: URLGRABBER CRASHED ZeroDivisionError: division by zero

Post by MThJtER »

switched to nightly version, and problems is no longer seen. Thank-you all.
Post Reply