Code Monkey home page Code Monkey logo

Comments (26)

n1nj4888 avatar n1nj4888 commented on September 14, 2024 2

Hi @barrycarey - Just checking in on whether you're still planning to fix this to save those of us with user permissions in InfluxDB from having to manually edit the line 41 of InfluxdbSpeedtest.py that's causing the issue?

Thanks!

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

Same here without container. Script simply finishes after "Configuration Successfully Loaded". No other output, no error.

from speedtest-for-influxdb-and-grafana.

fanaticDavid avatar fanaticDavid commented on September 14, 2024

I upgraded the image 2 days ago (also on a Synology NAS), and I am encountering exactly the same issue: the container is stuck restarting. Here's a sample from the logs, obtained using Portainer:

Loading Configuration File config.ini
Configuration Successfully Loaded
2019-02-13 22:42:22,980 - DEBUG: Testing connection to InfluxDb using provided credentials
Loading Configuration File config.ini
Configuration Successfully Loaded
2019-02-13 22:42:50,590 - DEBUG: Testing connection to InfluxDb using provided credentials
Loading Configuration File config.ini
Configuration Successfully Loaded
2019-02-13 22:43:44,746 - DEBUG: Testing connection to InfluxDb using provided credentials
Loading Configuration File config.ini
Configuration Successfully Loaded
2019-02-13 22:44:47,671 - DEBUG: Testing connection to InfluxDb using provided credentials

If the speed test is even run at all, the results are certainly not being saved to InfluxDB.

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

I don't maintain the Docker image currently. If I have time this weekend I'll setup an officially supported on.

from speedtest-for-influxdb-and-grafana.

billimek avatar billimek commented on September 14, 2024

Not sure why this is causing an issue for you two. For what it's worth, I'm running the atribe/speedtest-for-influxdb-and-grafana:latest docker image chart definition here and the config file at runtime looks like this:

/src # cat config.ini
[GENERAL]
Delay = 7200
[INFLUXDB]
Address = influxdb-influxdb
Port = 8086
Database = speedtests
Username =
Password =
Verify_SSL = False
[SPEEDTEST]
Server =
[LOGGING]
Level = debug

sample log output is:

Loading Configuration File config.ini
Configuration Successfully Loaded
2019-02-15 14:06:39,683 - DEBUG: Testing connection to InfluxDb using provided credentials
2019-02-15 14:06:39,816 - DEBUG: Successful connection to InfluxDb
2019-02-15 14:06:39,816 - INFO: Starting Speed Test For Server None
2019-02-15 14:06:39,892 - DEBUG: Setting up SpeedTest.net client
2019-02-15 14:06:40,505 - DEBUG: Picking the closest server
2019-02-15 14:06:41,207 - INFO: Selected Server 1767 in Atlanta, GA
2019-02-15 14:06:41,208 - INFO: Starting download test
2019-02-15 14:06:51,237 - INFO: Starting upload test
2019-02-15 14:07:01,860 - DEBUG: [{'measurement': 'speed_test_results', 'fields': {'download': 269215505.17997843, 'upload': 23655377.193265762, 'ping': 18.512}, 'tags': {'server': '1767'}}]
2019-02-15 14:07:01,886 - DEBUG: Data written to InfluxDB
2019-02-15 14:07:01,887 - INFO: Download: 269.22Mbps - Upload: 23.66Mbps - Latency: 18.512ms
2019-02-15 14:07:01,887 - INFO: Waiting 7200 seconds until next test

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

It's not only the Docker Container. The latest bare Script also does not work on my Debian Stretch Machine:

Loading Configuration File config.ini Configuration Successfully Loaded 2019-02-18 19:34:43,188 - DEBUG: Testing connection to InfluxDb using provided credentials root@cybstretch1:~/Speedtest-for-InfluxDB-and-Grafana#

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

@cyablo I just did a pull straight from the Repo on Ubuntu and it worked no issue. Can you post your config? Just leave out username/password stuff.

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

Ok, pretty sure I know what's going on. If it fails to connect to InfluxDB it was failing silently with a sys.exit(). Looks like each time this happens the container restarts the script so it just loops.

I just updated the repo to output an error if it fails to connect to Influx.

For any of you having this issue, ensure your InfluxDB connection details are correct.

from speedtest-for-influxdb-and-grafana.

atribe avatar atribe commented on September 14, 2024

I just pulled that change into the docker image and it is rebuilding right now.

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

You are right:

2019-02-18 19:59:33,803 - CRITICAL: Failed to connect to InfluxDB for unknown reason

But my InfluxDB Credentials are 100% correct. I even did reset the password to be sure and I'm using the same credentials in Grafana. Here is my config:

[GENERAL]

Delay = 300

[INFLUXDB]
Address = localhost
Port = 8086
Database = speedtests
Username = speedtests
Password = ******
Verify_SSL = False

[SPEEDTEST]

Leave blank to auto pick server

Server =

[LOGGING]

Valid Options: critical, error, warning, info, debug

Level = debug

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

Are you influx with or without SSL?

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

I'm not using SSL on Influx.

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

If you have python on your machine pip install influxdb and then try running this (either save as .py or do it in the Python console):

influx = InfluxDBClient(
'111.111.111.111,
8086,
database=DATABASE,
ssl=False,
verify_ssl=False,
username=Username,
password=Password,
timeout=5
)

influx.get_list_users()

Trying to figure out if this is an issue with my script or just a failure connect to Influx in general.

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

I have a few own Scripts, FHEM & LibreNMS pushing data to Influx without Problems. An older Version of your Script was also working fine.

THERE WAS CRAP HERE

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

My bad, forgot to add '' to my database name, username etc...

influxdb.exceptions.InfluxDBClientError: 403: {"error":"error authorizing query: speedtests not authorized to execute statement 'SHOW USERS', requires admin privilege"}

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

Do you have restricted permissions on that user?

Currently, to test if the Influx Connection is working I'm sending a show users command. If the command throws and exception the script exists. I didn't do this prior to the major updates I did recently which would explain why it worked before.

I never explored what level of permissions were required for that command. It might require root. You may need to use a user with more permissions until I can explore a better way to verify the Influx credentials.

from speedtest-for-influxdb-and-grafana.

cyablo avatar cyablo commented on September 14, 2024

Sure, the user only has permission to read and write to it's own DB.

I just commented out the lines to test the connection, it's working now and I'll take it as a workaround.

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

Glad to hear that worked. Admittedly not an ideal work around. When I have some time I'll see if I can come up with a better way to verify the credentials.

from speedtest-for-influxdb-and-grafana.

n1nj4888 avatar n1nj4888 commented on September 14, 2024

Thanks for looking into this - I can confirm I also use a user which only has read/write to the specific speedtest DB in influxdb so assume this is the cause of the issue. Rather than granting that user admin rights, I’d also like to comment out the access test if possible as a workaround so am keen to understand:

(1) Which files / lines need commenting out?
(2) How are you commenting these lines out since I only expose the container’s /src (the config files, no code) at present and cant get into the container quick enough after starting it to make the amendments before the container errors and stops?

Thanks!

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

It's line 41 in InfluxdbSpeedtest.py that's causing the issue.

The easiest solution would be using a user with root permissions temporary. I'll get it fixed this weekend.

from speedtest-for-influxdb-and-grafana.

fanaticDavid avatar fanaticDavid commented on September 14, 2024

In the Home Assistant project, they recently introduced a similar bug. They fixed it by using the following query: SHOW SERIES LIMIT 1;
I'm not sure if that would work in this case, but I just thought I'd share 😉

from speedtest-for-influxdb-and-grafana.

barrycarey avatar barrycarey commented on September 14, 2024

Nice! Thanks for the heads up. I'll mess with it this weekend.

from speedtest-for-influxdb-and-grafana.

n1nj4888 avatar n1nj4888 commented on September 14, 2024

Hi @barrycarey - Were you able to fix the "show users" error stopping the container?

from speedtest-for-influxdb-and-grafana.

n1nj4888 avatar n1nj4888 commented on September 14, 2024

Hi @barrycarey - Do you plan to release a fix for this? The only way i can get the docker to run currently is to manually comment out the "show users" test in the script inside the container...

from speedtest-for-influxdb-and-grafana.

douglasg14b avatar douglasg14b commented on September 14, 2024

Welp, this is a shame....

My user only has access to the db, and not admin rights, so of course that fails.

from speedtest-for-influxdb-and-grafana.

danielo515 avatar danielo515 commented on September 14, 2024

So, it is just a one-line change right? Would you will to do it?
I will just fork the project and do it myself, but I'm using a helm chart that uses this image, so many levels of indirection...

from speedtest-for-influxdb-and-grafana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.