Fatal error in Downloader - invalid literal for int() with base 10

Get help with all aspects of 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.
danieljai
Newbie
Newbie
Posts: 12
Joined: March 10th, 2024, 10:56 pm

Fatal error in Downloader - invalid literal for int() with base 10

Post by danieljai »

Been using this setup for many years; started getting these errors last week. Nothing resumes until i restart the container. I'm out of ideas. Need some help.

Things I've changed recently:
- moved from unraid docker to debian docker
- started using sabnzbd-notify(dot).py to communicate with Slack
- added check before download

Other stuff
- Version: 4.2.2
- Python Version: 3.11.8 (main, Feb 19 2024, 17:01:17) [GCC 13.2.1 20231014] [UTF-8]

Code: Select all

Traceback (most recent call last):  
File "/app/sabnzbd/sabnzbd/downloader(dot)py", line 706, in process_nw_worker
    self.process_nw(read_fds[nw_queue.get()])
  File "/app/sabnzbd/sabnzbd/downloader.(dot)py", line 745, in process_nw
    if nw.status_code != 222 and not done:
       ^^^^^^^^^^^^^^
  File "/app/sabnzbd/sabnzbd/newswrapper(dot)py", line 98, in status_code
    return int(self.data[:3])
           ^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b'>\r\n'
note: (dot) means dot. Cannot post links as new user.
Last edited by danieljai on March 11th, 2024, 1:07 am, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

Which nesserver?
danieljai
Newbie
Newbie
Posts: 12
Joined: March 10th, 2024, 10:56 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by danieljai »

it's usenet.premiumize.me
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

So a non-mainstream newsserver.

The problem is this:

ValueError: invalid literal for int() with base 10: b'>\r\n'

SABnzbd expects a 3-digit number back (like "211"), and converts that to an integer.
However: your newsserver usenet.premiumize.me just sends a newline '\r\n'. And running int() on that gives the traceback.
EDIT: or newsserver usenet.premiumize.me does send a correct line, but somehow SAB only sees the trailing '\r\n', not the beginning. Lost in your virtualisation layers ... ?

Troubleshooting:
does it happen all the time, or sometimes?
does it happen if you have SSL / NNTPS turned off, so plain NNTP?
what is your OS? Linux? If so: how good are you with Linux?

EDIT:

"added check before download" ... what if you turn that off?
danieljai
Newbie
Newbie
Posts: 12
Joined: March 10th, 2024, 10:56 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by danieljai »

Thanks for the explanation.

It only happens sometimes, making it very hard to reproduce and troubleshoot. It started just last week, and I've been using the same newsgroup for over 5 years now.

Not sure if it's by fluke; just an observation:
#1 When the error shows up, I restart the entire container. The download resumes after the restart, after progressing a bit with the download, it errors again.
#2 Alternatively, if error shows up, I select queue repair. After that, the download would successfully finish.

With #1, I couldn't finish the 12G job without it erroring out 4 times. With #2, I was able to finish the 12G job, and the subsequent 2 jobs.

- I turned off "check before download" just now, will see how it goes
- Next, I'll try turning off SSL
- The program is running inside a docker container on Debian in Proxmox. I can follow Linux commands.
- I'm a bit more proficient in python. If the problem is with the newsserver returning \r\n, perhaps I can add something that parses the status code so it leaves only digits, so int() will go through? Not sure if that's a good idea.

Thank you again for your help!
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

I'll send you a DM
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

I did a few test download with usenet.premiumize.me. I don't get tracebacks, but I do get the status codes 400 at the beginning of almost each download.

Googling, I get "400 service discontinued". Weird.

Code: Select all

WARNING 2 minutes ago [email protected]: Received unknown status code 400 for article DqVgYmFnFwKsCwTpBuIwVeYv-1658672528612@nyuu
WARNING 3 minutes ago [email protected]: Received unknown status code 400 for article SwTlAbOxKzYeKfDhHdBcQdUd-1658672577363@nyuu
WARNING 3 minutes ago [email protected]: Received unknown status code 400 for article FbUmAqIcSvEbLsLeGrGtKpBo-1658672552836@nyuu
WARNING 29 minutes ago [email protected]: Received unknown status code 400 for article WbKwQhViSnByAqKzPjDsIqYz-1658671799917@nyuu
I'll do some more download ... "hopefully" I get a traceback ...
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

I did a few dozen real (smaller) downloads from usenet.premiumize.me:, and not one error, and not one traceback. (FWIW: A lot of downloads failed because of missing articles)

The difference with your setup: proxmox. So ... is it caused by proxmox?

Let's verify: can you run SABnzbd on a PC/Mac, and do downloads? If you don't get Tracebacks, it might be my hypothesis "or newsserver usenet.premiumize.me does send a correct line, but somehow SAB only sees the trailing '\r\n', not the beginning. Lost in your virtualisation layers ... ?" ... caused by Proxmox / docker missing bytes, especially the first ones (read: the response code)
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by safihre »

Could also be that they sent this as part of the previous article, that we didn't read the full output.
However, this is very strictly defined in the standard what is the end of data. So they are then doing something invalid.
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: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

Ignore my hypothesis above about proxmox/docker! Because:

OP give me the problematic NZB, and with "Check before download" on, I do get the Traceback ... in the checking phase:

Code: Select all

2024-03-11 18:05:54,488::DEBUG::[downloader:744] Article <hcqsDHTqW6xYgZU7ss@d106420829d7979391nvei38GALVE6L35cyB8> is present
2024-03-11 18:05:54,492::DEBUG::[downloader:744] Article <R91TPLJ0HOh0S5gWAxof@6d77d9412d32075805M1YvRHHxqz1> is present
2024-03-11 18:05:54,495::DEBUG::[downloader:744] Article <Mf9BJCsyKbSoLxI0jIn@1d47600623c2d9b78y6cQ73iIOUlyOxm> is present
2024-03-11 18:05:54,498::DEBUG::[downloader:744] Article <k2UWtn6yHxY0rufSc@678d42086d1390273E7EeE26I031spunCT> is present
2024-03-11 18:05:54,501::DEBUG::[downloader:744] Article <W9ImIww7aEtLRhJ7@620094d837e726d91gVJEfB26LMx9D> is present
2024-03-11 18:05:54,504::DEBUG::[downloader:744] Article <9TAoXeb6ryVi@1428da2397670df0aK2gThhdYgoO> is present
2024-03-11 18:05:54,509::INFO::[notifier:142] Sending notification: Error - Fatal error in Downloader (type=error, job_cat=None)
2024-03-11 18:05:54,505::ERROR::[downloader:697] Fatal error in Downloader
Traceback (most recent call last):
  File "/usr/share/sabnzbdplus/sabnzbd/downloader.py", line 693, in process_nw_worker
    self.process_nw(read_fds[nw_queue.get()])
  File "/usr/share/sabnzbdplus/sabnzbd/downloader.py", line 734, in process_nw
    if nw.status_code not in (220, 222) and not done:
  File "/usr/share/sabnzbdplus/sabnzbd/newswrapper.py", line 98, in status_code
    return int(self.data[:3])
ValueError: invalid literal for int() with base 10: b'>\r\n'
2024-03-11 18:05:54,510::INFO::[downloader:394] Pausing
2024-03-11 18:05:54,511::INFO::[notifier:142] Sending notification: SABnzbd - Paused (type=pause_resume, job_cat=None)
2024-03-11 18:05:54,511::INFO::[downloader:414] Forcing disconnect
danieljai
Newbie
Newbie
Posts: 12
Joined: March 10th, 2024, 10:56 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by danieljai »

can you run SABnzbd on a PC/Mac, and do downloads...
I'm away from my home setup until tomorrow evening. I'll try again when I get back.

As mentioned, I also couldn't reliably reproduce the problem. Based on observation, it seems to happen more often or predominately on large jobs (larger than 10G), and when it happens, no matter how many times I tried to restart, it keeps happening.

Is it seeing just '\r\n' or '211\r\n'? Is that used to signal EOF?

Since you mention few layers of virtualization. I wonder, does it have to do with running bridge mode in the docker container...
However, this is very strictly defined in the standard what is the end of data. So they are then doing something invalid.
Since this is happening randomly, I guess it is unlikely due to poorly defined output data format, right? Otherwise, it should error out consistently.

Sorry if I'm speaking out of ignorance. I have limited understand about this system and its interactions. I'm just speaking from a very general perspective.
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

And without "Check before download", no Traceback, but again the weird response immediatly at the beginning of the download

And the download succeeds. So OP, turn off the "check before download"

Code: Select all

WARNING 10 minutes ago [email protected]: Received unknown status code 400 for article 1MFLnALSOK3DvTAOQr@716d9e30d207897a30N8nqiCncQhmdoDQO9Z
WARNING 10 minutes ago [email protected]: Received unknown status code 400 for article T5fbyPrfJcseIi@d6b120850d9737302JgN3ixQ95yz6
WARNING 10 minutes ago [email protected]: Received unknown status code 400 for article 9dkrUBbnqN44N2@9d8612760d0f087325u1AguGOF6lpWNUxB
WARNING 10 minutes ago [email protected]: Received unknown status code 400 for article QBVHtTa37DOLS2zmt@098212d9a77c16390s6s2Iih2f1GUruzz90
danieljai
Newbie
Newbie
Posts: 12
Joined: March 10th, 2024, 10:56 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by danieljai »

sander wrote: March 11th, 2024, 1:50 pm Ignore my hypothesis above about proxmox/docker! Because:

With "Check before download" on, I do get the Traceback ... in the checking phase:

Code: Select all

2024-03-11 18:05:54,488::DEBUG::[downloader:744] Article <hcqsDHTqW6xYgZU7ss@d106420829d7979391nvei38GALVE6L35cyB8> is present
2024-03-11 18:05:54,492::DEBUG::[downloader:744] Article <R91TPLJ0HOh0S5gWAxof@6d77d9412d32075805M1YvRHHxqz1> is present
2024-03-11 18:05:54,495::DEBUG::[downloader:744] Article <Mf9BJCsyKbSoLxI0jIn@1d47600623c2d9b78y6cQ73iIOUlyOxm> is present
2024-03-11 18:05:54,498::DEBUG::[downloader:744] Article <k2UWtn6yHxY0rufSc@678d42086d1390273E7EeE26I031spunCT> is present
2024-03-11 18:05:54,501::DEBUG::[downloader:744] Article <W9ImIww7aEtLRhJ7@620094d837e726d91gVJEfB26LMx9D> is present
2024-03-11 18:05:54,504::DEBUG::[downloader:744] Article <9TAoXeb6ryVi@1428da2397670df0aK2gThhdYgoO> is present
2024-03-11 18:05:54,509::INFO::[notifier:142] Sending notification: Error - Fatal error in Downloader (type=error, job_cat=None)
2024-03-11 18:05:54,505::ERROR::[downloader:697] Fatal error in Downloader
Traceback (most recent call last):
  File "/usr/share/sabnzbdplus/sabnzbd/downloader.py", line 693, in process_nw_worker
    self.process_nw(read_fds[nw_queue.get()])
  File "/usr/share/sabnzbdplus/sabnzbd/downloader.py", line 734, in process_nw
    if nw.status_code not in (220, 222) and not done:
  File "/usr/share/sabnzbdplus/sabnzbd/newswrapper.py", line 98, in status_code
    return int(self.data[:3])
ValueError: invalid literal for int() with base 10: b'>\r\n'
2024-03-11 18:05:54,510::INFO::[downloader:394] Pausing
2024-03-11 18:05:54,511::INFO::[notifier:142] Sending notification: SABnzbd - Paused (type=pause_resume, job_cat=None)
2024-03-11 18:05:54,511::INFO::[downloader:414] Forcing disconnect
Oh, hi old friend (the error). :D
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by sander »

More fun, with the 100MB test download, with sabnzbd

Code: Select all

WARNING a few seconds ago [email protected] recieved unknown status code 400 for article ExOtMnHzYeTeXbPrQpMqQcEd-1658672646626@nyuu: 400 Archive server temporarily offline
WARNING a few seconds ago [email protected] recieved unknown status code 400 for article HmLkJbFaPwGnDeHoAsUeWvOx-1658672650641@nyuu: 400 Archive server temporarily offline
WARNING a few seconds ago [email protected] recieved unknown status code 400 for article InAlBjYtHfRoZbUcLbLjVwGg-1658672650925@nyuu: 400 Archive server temporarily offline
"400 Archive server temporarily offline" ... seems a server side problem
danieljai
Newbie
Newbie
Posts: 12
Joined: March 10th, 2024, 10:56 pm

Re: Fatal error in Downloader - invalid literal for int() with base 10

Post by danieljai »

This happens only at the beginning of a job, right? I can drop a support ticket and let them know their downloads are 400-ing in the beginning.

Is it possible that this behaviour is interfering with the checking script?
Post Reply