Page 1 of 1

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

Posted: June 28th, 2023, 9:05 am
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!

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

Posted: June 28th, 2023, 9:34 am
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?

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

Posted: June 28th, 2023, 9:54 am
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.

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

Posted: June 28th, 2023, 11:46 am
by safihre
The bug is already fixed, will be part of next release.

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

Posted: June 29th, 2023, 2:58 pm
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!