Speedtest-for-InfluxDB-and-Grafana
Speedtest-for-InfluxDB-and-Grafana copied to clipboard
ValueError: invalid literal for int() with base 10: ''
Starting last night I got intermittent errors in the log and as a result, speedtests are not occurring/recorded. After a few hours, the intermittent nature went away and failure is consistent.
Here is a sample of the log upon startup
Loading Configuration File config.ini
Configuration Successfully Loaded
2021-04-08 15:11:51,512 - INFO: Starting Speed Test For Server None
Traceback (most recent call last):
File "/src/influxspeedtest.py", line 8, in <module>
collector.run()
File "/src/influxspeedtest/InfluxdbSpeedtest.py", line 171, in run
self.run_speed_test()
File "/src/influxspeedtest/InfluxdbSpeedtest.py", line 119, in run_speed_test
self.setup_speedtest(server)
File "/src/influxspeedtest/InfluxdbSpeedtest.py", line 71, in setup_speedtest
self.speedtest = speedtest.Speedtest()
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: ''
Loading Configuration File config.ini
Configuration Successfully Loaded
2021-04-08 15:12:52,124 - INFO: Starting Speed Test For Server None
Traceback (most recent call last):
File "/src/influxspeedtest.py", line 8, in <module>
collector.run()
File "/src/influxspeedtest/InfluxdbSpeedtest.py", line 171, in run
self.run_speed_test()
File "/src/influxspeedtest/InfluxdbSpeedtest.py", line 119, in run_speed_test
self.setup_speedtest(server)
File "/src/influxspeedtest/InfluxdbSpeedtest.py", line 71, in setup_speedtest
self.speedtest = speedtest.Speedtest()
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: ''
I got past this error by rebuilding the docker image. The python requirements in the current image are out of date. There is an update to the speedtest-ci that has fixed this error.
Step-by-Step First I cloned this repo Then I ran "docker build -t speedtest-for-influxdb ." in the directory of the repo. Then I ran docker run with the new image "speedtest-for-influxdb" This resolved the issue.
Same Problem. The tip did not worked in unraid.
I am using unraid as well. Make sure the built image is in the same context as your unraid docker. Make sure you switch the image in the template to the one you built.
Switch to what?

The repo maintainer needs to rebuild the docker image to resolve this issue. If you want to resolve it on your end then you can follow the steps I provided in my original post.
I got past this error by rebuilding the docker image. The python requirements in the current image are out of date. There is an update to the speedtest-ci that has fixed this error.
Step-by-Step First I cloned this repo Then I ran "docker build -t speedtest-for-influxdb ." in the directory of the repo. Then I ran docker run with the new image "speedtest-for-influxdb" This resolved the issue.
Since you are using unraid instead of the docker run command, you would simply update the repo in the template to the name you used when building the image. The template is what you took a screenshot of. If you don't know how to build docker images your best bet is to wait for the maintainer to do it and then the container will ask to be updated in your unraid gui.
Here is a better guide
Click the terminal button in your unraid gui and run the follow commands
git clone https://github.com/barrycarey/Speedtest-for-InfluxDB-and-Grafana.git cd Speedtest-for-InfluxDB-and-Grafana docker build -t speedtest-for-influxdb . (DO NOT FORGET THE PERIOD)
After your machine completes these commands you can exit the terminal and go to the template for the container. In the template, update the repository to speedtest-for-influxdb
Hope that helps
Thanks @everythingguy
At first , I struggled to spot the subtly (re)named flavour of the container in your build command vs the original and wondered why it wasn't working when I changed my template startup command! For anyone else reading this and struggling, note the original is speedtest-for-influxdb-and-grafana
and the instructions above will create speedtest-for-influxdb
FYI, I modified the Dockerfile after cloning it/before building form it, and now use FROM python:3.7-alpine
in preference to the original FROM python:alpine
and have seen a couple of test go through successfully
Looking at the recent git activity/history of @barrycarey, it would appear that he is taking at least a short sabbatical so we shouldn't expect an update just yet i guess.
For those users not using docker (e.g. I am in a TrueNAS jail with it running as a cron [have modified for my use case]), simply do:
$ pip3 install -r requirements.txt --upgrade
For those users not using docker (e.g. I am in a TrueNAS jail with it running as a cron [have modified for my use case]), simply do:
$ pip3 install -r requirements.txt --upgrade
Does that help? I tried it with the container but it does not help:
docker run <speedtestimageid> pip3 install -r requirements.txt --upgrade
Any ideas why and how to do it better?
Indeed, the rebuild worked for me. I pushed the working image here: https://hub.docker.com/r/husdupflorin/speedtest-for-influxdb so you don't have to spend the time rebuilding it.
If you're very lazy and don't want to rebuild this image, you could download the latest speedtest.py locally (https://github.com/sivel/speedtest-cli/blob/master/speedtest.py) and mount that file to the docker image to override the existing one (which "patches" this bug in the 2 year old image):
docker run --name="speedtest" --restart="always" -v /path/to/config.ini:/src/config.ini -v /path/to/speedtest.py:/usr/local/lib/python3.7/site-packages/speedtest.py atribe/speedtest-for-influxdb-and-grafana:latest
Sorry for the lack of movement on this. Life got in the way the last few months. I spent this weekend reworking most of this project. I should have it merged by next weekend.
It will include an option to use speedtest.py or the official Speedtest.net CLI app for improved results. It will also include support for Influx V1, Influx v2 and Graphite.
Thanks @barrycarey I know the 'life got in the way' thing way too well :) I'll keep an eye out for further updates.
Hey All,
I'm retiring this repo and it is being Replaced by Speedmon
The new tool is very similar in function except it's using the official Speedtest.net CLI app for more accurate results. It also has support for Inlflux V1 & V3 along with Graphite.
Configuration process is different so take note of the changes.
@barrycarey is the output to influx the same model, ie can I use my existing influx db, or will I need to create a new one (and change the Grafana dashboard to point at new source) ?