Bug 13805

Summary: speedtest cli error unable to connect to servers to test latency when run from fcrontab
Product: IPFire Reporter: Adolf Belka <adolf.belka>
Component: ---Assignee: Adolf Belka <adolf.belka>
Status: VERIFIED --- QA Contact:
Severity: Minor Usability    
Priority: - Unknown -    
Version: 2   
Hardware: unspecified   
OS: Unspecified   

Description Adolf Belka 2025-01-06 13:27:12 UTC
This was a bug highlighted by someone in the forum.

https://community.ipfire.org/t/speedtest-cli-error-unable-to-connect-to-servers-to-test-latency-when-run-from-fcrontab/13315

I had a test out and eventually identified that the problem only occurs when speedtest-cli is run on the hour or on the half hour.
Comment 1 Adolf Belka 2025-01-06 13:33:34 UTC
Problem was identified to be a long running one. First highlighted in the speedtest-cli github in Feb 2023.

on the hour or the half hour speedtest responds with an error message saying that your IP has been blocked due to too many attempts.

However when you try 20 or 30 sconds later it works fine.

The script gets the server list by running a php script in the speedtest.net web server. However speedtest.net no longer use that http method so it is not maintained.

speedtest-cli users have reported patches on the github site from Feb 2023 to change the server list process to use the json list that is provided.
This fixes the bug but the speedtest-cli github owner has stopped maintaining or committing anything on the github site for a while. Last commit was in July 2021.
Comment 2 Adolf Belka 2025-01-06 13:37:13 UTC
I have taken the various patches, including some to deal with syntax aspects with python 3.10, python 3.11 and deprecated function from python 3.12 together with the one for using the json server list.

I had to make some minor changes to the patches as only one of them has been merged and so some of the other patches don't work if another one has been used.

I have made a self consistent set of patches and have tested them out on my vm testbed and speedtest-cli then also operates if run on the hour or the half hour.

I will submit the patch set.
Comment 4 Adolf Belka 2025-01-11 09:55:44 UTC
Patch has been merged into next and will become CU192.

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2dc005c68b24f7e3d5d59258da26c9ff6e25ffdc
Comment 6 Adolf Belka 2025-02-16 12:39:43 UTC
Confirmed that running the command

speedtest-cli --no-upload --secure --csv

at 13:30 on my CU192 Testing vm system was successful, verifying that the fix is working.