Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: invalid literal for int() with base 10: '' #46

Open
techie2000 opened this issue Apr 8, 2021 · 16 comments
Open

ValueError: invalid literal for int() with base 10: '' #46

techie2000 opened this issue Apr 8, 2021 · 16 comments

Comments

@techie2000
Copy link

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: ''
@everythingguy
Copy link

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.

@IamTheLoki
Copy link

Same Problem. The tip did not worked in unraid.

@everythingguy
Copy link

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.

@IamTheLoki
Copy link

Switch to what?

@IamTheLoki
Copy link

Bildschirmfoto 2021-04-08 um 22 19 24

@everythingguy
Copy link

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.

@everythingguy
Copy link

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

@techie2000
Copy link
Author

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.
image

@jack828
Copy link

jack828 commented Apr 13, 2021

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

@maichai
Copy link

maichai commented May 6, 2021

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?

@husdupflorin
Copy link

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.

@benjaminchodroff
Copy link

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

@barrycarey
Copy link
Owner

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.

@techie2000
Copy link
Author

Thanks @barrycarey
I know the 'life got in the way' thing way too well :)
I'll keep an eye out for further updates.

@barrycarey
Copy link
Owner

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.

Image is now up on Docker Hub

@techie2000
Copy link
Author

techie2000 commented Oct 9, 2021

@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) ?

reading [https://github.com/barrycarey/Speedmon/issues/4#issue-1015537002](https://github.com/barrycarey/Speedmon/issues/4#issue-1015537002) it seems the data defs have changed between the old and new versions, so a new db and loss of the old stored data will be required I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants