aln-1 / pfsense-speedtest-widget

pfSense speedtest widget
GNU General Public License v3.0
48 stars 27 forks source link

speedtest widget failing #1

Open zermoumia opened 3 years ago

zermoumia commented 3 years ago

I get this error when I run speedtest:


Retrieving speedtest.net configuration...
Traceback (most recent call last):
  File "/usr/local/bin/speedtest", line 11, in <module>
    load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest')()
  File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1986, in main
    shell()
  File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1875, in shell
    secure=args.secure
  File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1091, in __init__
    self.get_config()
  File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1174, in get_config
    map(int, server_config['ignoreids'].split(','))
ValueError: invalid literal for int() with base 10: ''
countingpine commented 3 years ago

The problem is with the speedtest-cli package - the speedtest site has recently changed something in its response, which the speedtest.py script can't handle.

See this Pull Request on the speedtest project: https://github.com/sivel/speedtest-cli/pull/769

I worked out a fairly simple way to apply a fix on Ubuntu: https://unix.stackexchange.com/a/645065/38647

You can replace the script with the newly released version. Something like this should work on pfSense, if speedtest.py is in the place indicated by your error log. I suggest backing up the original script first, in case something goes wrong:

gzip -9 /usr/local/lib/python3.7/site-packages/speedtest.py &&
 curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/v2.1.3/speedtest.py > /usr/local/lib/python3.7/site-packages/speedtest.py