4.0.3 RC1 error message: "name 'random' is not defined"

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • 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
Madflava
Newbie
Newbie
Posts: 7
Joined: July 20th, 2017, 5:07 pm

4.0.3 RC1 error message: "name 'random' is not defined"

Post by Madflava »

Ive been seeing a lot of these the past few days.

2023-06-28 10:03am Failed to initialize [email protected] with reason: name 'random' is not defined
ERROR 2023-06-28 10:03am Failed to initialize [email protected] with reason: name 'random' is not defined
ERROR 2023-06-28 10:03am Failed to initialize [email protected] with reason: name 'random' is not defined
ERROR 2023-06-28 10:03am Failed to initialize [email protected] with reason: name 'random' is not defined
ERROR 2023-06-28 10:03am Failed to initialize [email protected] with reason: name 'random' is not defined
ERROR 2023-06-28 10:03am Failed to initialize [email protected] with reason: name 'random' is not defined

Probably something I have configured wrong but its worked finr until recently.

Thanks!
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: 4.0.3 RC1 error message: "name 'random' is not defined"

Post by sander »

please put specific info in the subject. I've now done it for you.

Code: Select all

name 'random' is not defined
that can happen if SAB uses something the random module before it was imported

Code: Select all

>>> random.randint(1,10)
...

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'random' is not defined
The code is here:

https://github.com/sabnzbd/sabnzbd/blob ... #L651-L656

I do see an "import random" (good), but I don't see any usage. So how can that happen?
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: 4.0.3 RC1 error message: "name 'random' is not defined"

Post by sander »

Ah:

Config -> Switches: what do you have selected at "Server IP address selection".

... my guess: "Randomly ... ". Correct? If so, change to "Quickest IP"

If that solves it, I think you have found a bug.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: 4.0.3 RC1 error message: "name 'random' is not defined"

Post by safihre »

The bug is already fixed, will be part of next release.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Madflava
Newbie
Newbie
Posts: 7
Joined: July 20th, 2017, 5:07 pm

Re: 4.0.3 RC1 error message: "name 'random' is not defined"

Post by Madflava »

safihre wrote: June 28th, 2023, 11:46 am The bug is already fixed, will be part of next release.
Fantastic news! Thank you!
Post Reply