speedtest-cli ERROR: Unable to connect to servers to test latency.
-
Hi, I have this error with py311-speedtest-cli-2.1.3
Version of pfsense :
23.09.1-RELEASE (amd64)
built on Wed Dec 20 19:27:00 CET 2023
FreeBSD 14.0-CURRENTError :
Retrieving speedtest.net configuration... Testing from Free SAS (XX.XX.XX.XX)... Retrieving speedtest.net server list... Selecting best server based on ping... ERROR: Unable to connect to servers to test latency.
Thank helping me
-
@mathais going to need a bit more info to try and figure out why.. I can not duplicate the problem here.
Can you pull a list of servers even?
[23.09.1-RELEASE][admin@sg4860.home.arpa]/root: speedtest-cli --list Retrieving speedtest.net configuration... 12664) Metronet (Bloomington, IL, United States) [819.54 km] 17512) Consolidated Communications Inc (Mattoon, IL, United States) [842.80 km] 19408) Joink, LLC (Terre Haute, IN, United States) [923.70 km] 62025) Kraus CableTV (Manhattan, IL, United States) [935.78 km] 47532) Urban Communications (Oak Forest, IL, United States) [962.14 km] 12201) Endeavor Communications (Cloverdale, IN, United States) [977.11 km] 17384) Windstream (Chicago, IL, United States) [977.12 km] 51366) Jasper County REMC (Rensselaer, IN, United States) [982.81 km] 53404) Brightspeed (Indianapolis, IN, United States) [1036.35 km] 6795) Unlimited Net, LLC (Indianapolis, IN, United States) [1036.35 km] [23.09.1-RELEASE][admin@sg4860.home.arpa]/root:
What packages are you running, IPS? pfblocker? Are you running any rules in floating that block outbound traffic to places?
-
I've see the same situation.
@johnpoz said in speedtest-cli ERROR: Unable to connect to servers to test latency.:
What packages are you running, IPS? pfblocker? Are you running any rules in floating that block outbound traffic to places?
Noop.
I use a clean 23.09.1 system (long live ZFS).
No pfblockerng, Clean default Resolver settings, etc.[23.09.1-RELEASE][root@pfSense.bhf.tld]/root: speedtest-cli --list speedtest-cli: Command not found.
Humm, Have to install it fist I guess.
[23.09.1-RELEASE][root@pfSense.bhf.tld]/root: pkg install py311-speedtest-cli-2.1.3 Updating pfSense-core repository catalogue... Fetching meta.conf: 0% pfSense-core repository is up to date. Updating pfSense repository catalogue... Fetching meta.conf: 0% Fetching packagesite.pkg: 0% pfSense repository is up to date. All repositories are up to date. The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: py311-speedtest-cli: 2.1.3 [pfSense] Number of packages to be installed: 1 52 KiB to be downloaded. Proceed with this action? [y/N]: y [1/1] Fetching py311-speedtest-cli-2.1.3.pkg: 100% 52 KiB 53.1kB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing py311-speedtest-cli-2.1.3... [1/1] Extracting py311-speedtest-cli-2.1.3: 100%
Ok, I have it. Let's test :
[23.09.1-RELEASE][root@pfSense.bhf.tld]/root: speedtest-cli --list Retrieving speedtest.net configuration...
and that's it, not even a error message
[23.09.1-RELEASE][root@pfSense.bhf.tld]/root: speedtest-cli Retrieving speedtest.net configuration... Testing from Orange (82.127.26.108)... Retrieving speedtest.net server list... Selecting best server based on ping... ERROR: Unable to connect to servers to test latency.
and now I recall.
Way back, when I was investigating this, I had to read the manual (python is actually a language like plain english).
What I've found out : my pfSenses, "speedtest-cli", connects to the (a) server that hosts the lists.
That server said to me, while retrieving the list 'manually' : sorry, no go, way to much connection from your IPv4. That was the error. The "speedtest-cli" script just bails out, silently, not mentioning the reason ( actually : it did : it can not connect )
??
Do I have a device in my network that also has "speedtest-cli" installed, and is executed all the time ? Thus 'abusing' ? Not that I know of - and I'm paid to know things like that.
Back then, I got a list of all the IPs that host the list with speedtest servers and blocked it for outgoing connections.
No hits on that rule for weeks. So no abuse that I'm aware of. I've no device in my networks that is "speedtesting" all the time.
The thing is, my IPv4 is 'static', my ISP always assigns the same one to me.
And of course, "speedtest" can only test the ancient protocol, IPv4, it has no IPv6 capabilities.So, for me, is that the speedtest list servers don't want to talk to me "for some reason" for 'abuse' (== to many requests from your IP).
There could be other reasons, of course.What works fine :
[23.09.1-RELEASE][root@pfSense.bhf.tld]/root: pkg remove py311-speedtest-cli-2.1.3 Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: py311-speedtest-cli: 2.1.3 Number of packages to be removed: 1 Proceed with deinstalling packages? [y/N]: y [1/1] Deinstalling py311-speedtest-cli-2.1.3... [1/1] Deleting files for py311-speedtest-cli-2.1.3: 100%
Also : in the past, I've add one more stpe to validate my findings :
I started a pfSense OpenVPN client, that connects to expr*ssvpn, and policy routed all IPv4 WAN traffic over the VPN.
Now, speedtest-cli works just fine ( ! ), and I was testing my OpenVPN speed, not really ISP speed .... nice, and completely useless.Btw : not really a big issue, as running "speedtest-cli" on the router itself basically wrong. It's meant to be used on a device on the pfSense LAN to get the real numbers.
-
@Gertjan said in speedtest-cli ERROR: Unable to connect to servers to test latency.:
( actually : it did : it can not connect )
Yeah, which is why asked him if he could even pull the list of servers ;)
That error is horrible, it doesn't say could not retrieve list, could not connect to list server(s) etc.. It says it after says selecting best server based on ping ;)
Which would seem to indicate it did get list of servers it could talk to, but could not connect to any of them, via ping? or did it pick one and then could not connect for that actual speed test?
And pretty much in agreement with you on this one..
running "speedtest-cli" on the router itself basically wrong.
Running such a test on the actual router is of little value if what your after is what speed can the router actually route, etc.
edit: on a side note, since you spent some time looking into how that client works, etc.. You have any clue to how it determines distance to these servers?
- Metronet (Bloomington, IL, United States) [819.54 km]
Bloomington, IL sure and the hell is not 820 km from me.. 150ish miles would be correct, not 500 miles.. So curious how it determines distance from you to their test servers..
Would be fun to use all of their distances they list to triangulate where they think I am, since every geoip db I look at either gets my exact city correct, or puts it in the chicagoland area at least.. Which sure is not anywhere close to 500 miles from Bloomington, IL ;)
edit: ok figured it out.. they are using not actually looking up my IP geoip, they are just using the default location which is in the center of the US.. Somewhere in Kanas, From the distances they show from their servers puts me somewhere here ;) heheh
Math is cool!! hahah
But what is so stupid about it - is they do pull servers that are somewhat in my location.. They just doing the math wrong for the distances.
-
@johnpoz said in speedtest-cli ERROR: Unable to connect to servers to test latency.:
They just doing the math wrong for the distances
Normally, I shouldn't, but you are asking for it : it's a free service
Hiring a guy that can do - write the script - math == more cost."geoip databases" was a nice thing when there were few hosts on the internet.
I guess the quality geoip database exists, but it is very $/€. -
@Gertjan they seem to be able to do geoip to return a list of IPs that are in my area.. All of those in my list above, are in my geographic area.. They just doing the math wrong for distance.. So clearly they already paid the guy ;) to figure use some geoip db to figure out hey what servers should ip xyz look to for doing his speed test..
You would think they would get the math right.. the web gui version of speedtest gets it right..
-
@Gertjan Thank you, so you removed speedtest-cli ?
I have openvpn configured on my pfsense and all my IPV4 traffic pass through the VPN .Do you know another tool for testing my internet speed ?
Thanks
-
@mathais so you want to test not through the vpn is that the idea? Not sure if you noticed but running a speedtest right on pfsense is not a very good test..
Run your speed test through pfsense from some client.. Just hit a website - do simple policy routing on pfsense if you want to test through the vpn or not through the vpn.
-
@mathais said in speedtest-cli ERROR: Unable to connect to servers to test latency.:
@Gertjan Thank you, so you removed speedtest-cli ?
I have openvpn configured on my pfsense and all my IPV4 traffic pass through the VPN .All traffic? Even video&music streaming? Why???
Do you know another tool for testing my internet speed ?
Saying “internet speed” what EXACTLY You mean: uplink to ISP, between Your pfSense and certain server, between Your device(s) and certain server?
Check all cables, connected speed on NIC, no collisions and errors on interfaces.
2.
SWITCH ON RACK/QUICK congestion control (CC) in FreeBSD.
3.
DISABLE OFFLOADING on NICs - nowadays this have no sens.
4.
DISABLE POWER MANAGEMENT on motherboard (off CPU Threading, CPU power states, PCI & NICs power mgmt, etc…)
5.
only now test by- Speedtest
- Fast
- Librespeed
- iperf3
Your UPLINK (of course no any other net activity on pfSense would be).
After that You have:
- maximum possible on certain moment from Your hardware & FreeBSD drivers;
- measurements from nearest and far servers (not very accurate because workload time of the day and loading of certain server);
Better to automate this by Smokeping (on the pfSense device itself) OR Prometheus+Grafana on separate server (but agent on pfSense).
With alerting on Pushover by API or email.