roest01 / docker-speedtest-analyser

Automated docker speedtest analyser tool with included web interface to monitor your internet speed connection over time. Setup at home on your NAS (Synology, QNAP tested) and the container runs hourly speedtests. The speedtest results are displayed in an webinterface as line graph(s) over the day.
Other
108 stars 47 forks source link

Speedtest suddenly stopt working (only manual test works) #71

Open Mosdn85 opened 3 years ago

Mosdn85 commented 3 years ago

Hi all,

For almost a week dockers speed test analyser stopped working. Manual testing is working. I've uninstalled & re-installed it, but its the same problem

I got the following errors, when i checked the logs.

--- running speedtest --- Traceback (most recent call last): File "/var/www/html/scripts/speedtestRunner.py", line 62, in runSpeedtest() File "/var/www/html/scripts/speedtestRunner.py", line 27, in runSpeedtest s.get_best_server() File "/usr/lib/python2.7/site-packages/speedtest.py", line 1491, in get_best_server raise SpeedtestBestServerFailure('Unable to connect to servers to ' speedtest.SpeedtestBestServerFailure: Unable to connect to servers to test latency.

Any ideas what the problem is?

WKr, Mo

GitBeto21 commented 3 years ago

Hi, I have same issues here; since 8th March 😩

hccp-slogemann commented 3 years ago

Same for me, stopped working since 8th of March

KossikCZ commented 3 years ago

Yeah, mine too. Since March 8th as well. :( I am puzzled to see why, as running the test manually via web or cli works. :/

Chris122AT commented 3 years ago

Same problem here!

contisegler commented 3 years ago

I had the same problem. Setting the environment variable CRONJOB_ITERATION solved the problem for me. I only tested this with a 5 minute interval though.

GitBeto21 commented 3 years ago

I have setup this variable since the installation, because I used a shortener itineration then 60min. and still it does not work. i have just changed the time, and now works again. What about this alert: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised And this error: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/ ??? 🧐

contisegler commented 3 years ago

For the five minute interval all speed tests work except at the full and half hour. I can only speculate why this is the case. Maybe running speedtest.py in debug mode at the full or half hour might give more information.

GitBeto21 commented 3 years ago

it makes sense. because I choose 30 min, and it was empty, now I choose 10, and I see results for 10, 20, 40, 50

Mosdn85 commented 3 years ago

I had the same problem. Setting the environment variable CRONJOB_ITERATION solved the problem for me. I only tested this with a 5 minute interval though.

Hi, How did you do that? Like this?

image

Mosdn85 commented 3 years ago

Fixed also with me when i added environment variable "CRONJOB_ITERATION" with value 5 With value 30, same problem

arubacao commented 3 years ago

Can confirm.

Mosdn85 commented 3 years ago

Can confirm.

  • start manual speedtest is working
  • CRONJOB_ITERATION != 60,30 is working
  • CRONJOB_ITERATION == 60,30 is NOT working

Hi arubacao,

You only add "!" next to CRONJOB_ITERATION and it works?

arubacao commented 3 years ago

@Mosdn85 Ah no, I mean something that is simply not 30 or 60. I just use 57 instead of 60 and this works for me.

stevietv commented 3 years ago

looks like the error is coming from sivel/speedtest-cli (https://github.com/sivel/speedtest-cli/blob/c58ad3367bf27f4b4a4d5b1bca29ebd574731c5d/speedtest.py#L1490-L1491)

the packaged speedtest is not able to return the best server at https://github.com/roest01/docker-speedtest-analyser/blob/52b577348283d28eed353ea51c4ce0f28a2bf754/scripts/speedtestRunner.py#L27

Bagestu commented 3 years ago

Okay, so it appears that I'm not the only one. Too bad I only tried changing 60 to 30... Thanks a lot for figuring out that we can get this working again by putting any value except 60 or 30 for the cronjob.

For now I'll change the cron through bash so I can make it run every 60 minutes again, but with an offset, as it otherwise still fails at the 30th and 60th minute intervals. Removing the "/" from the existing cron should do the trick: `/15 (every 15 minutes) then becomes15 ` (15 minutes past every hour).

This might be a good thing to add for a future release, @roest01. Because if a docker is restarted, it'll reset the cronjob value.

stevietv commented 3 years ago

Strange thing I also noticed. I have mine set to run every 59 minutes. In the logs I see the suceeded speedtest every 59 minutes, and also a failed speed test on the hour every hour:

today at 15:59  --- running speedtest ---
today at 15:59  --- Result ---
today at 15:59  Timestamp: 1.61651157028e+12
today at 15:59  Ping: 24 [ms]
today at 15:59  Download: 35 [Mbit/s]
today at 15:59  Upload: 26 [Mbit/s]
today at 15:59  speedtest complete
today at 16:00  --- running speedtest ---
today at 16:00  Traceback (most recent call last):
today at 16:00    File "/var/www/html/scripts/speedtestRunner.py", line 62, in <module>
today at 16:00      runSpeedtest()
today at 16:00    File "/var/www/html/scripts/speedtestRunner.py", line 27, in runSpeedtest
today at 16:00      s.get_best_server()
today at 16:00    File "/usr/lib/python2.7/site-packages/speedtest.py", line 1491, in get_best_server
today at 16:00      raise SpeedtestBestServerFailure('Unable to connect to servers to '
today at 16:00  speedtest.SpeedtestBestServerFailure: Unable to connect to servers to test latency.
today at 16:59  --- running speedtest ---
today at 16:59  --- Result ---
today at 16:59  Timestamp: 1.61651516231e+12
today at 16:59  Ping: 24 [ms]
today at 16:59  Download: 34 [Mbit/s]
today at 16:59  Upload: 26 [Mbit/s]
today at 16:59  speedtest complete
today at 17:00  --- running speedtest ---
today at 17:00  Traceback (most recent call last):
today at 17:00    File "/var/www/html/scripts/speedtestRunner.py", line 62, in <module>
today at 17:00      runSpeedtest()
today at 17:00    File "/var/www/html/scripts/speedtestRunner.py", line 27, in runSpeedtest
today at 17:00      s.get_best_server()
today at 17:00    File "/usr/lib/python2.7/site-packages/speedtest.py", line 1491, in get_best_server
today at 17:00      raise SpeedtestBestServerFailure('Unable to connect to servers to '
today at 17:00  speedtest.SpeedtestBestServerFailure: Unable to connect to servers to test latency.

its almost as if regardless of the cron settings its still running on the hour?

Rubeast commented 3 years ago

I have the same problem. I tried with 15 and 60 minutes, but was not working. So just to confirm, to get this working, we need to configure something that is not 15, 30 or 60?

Edit: Also not working when setting CRONJOB_ITERATION at 29.

stevietv commented 3 years ago

I've switched to a fork for now mikehhhhhhh/docker-speedtest-analyser for now as its fixed a few things in PRs. would be great if @roest01 could merge some of the PRs and keep this all to one image.

Rubeast commented 3 years ago

Thanks! That fork works forking perfect.

Edit: The fork was working, but the speeds were not correct. I was getting constantly 80Mbps while the original roest version gave me the correct speeds. Didn't see the option to open an issue on that github page. Anyway.. I found one that is much better and has a ton of extra features: https://github.com/henrywhitaker3/Speedtest-Tracker

frankboh commented 3 years ago

Same problem here. At some point in late March, Docker stopped working on my Synology NAS. Manually I could still start the test and setting a 1 minute measurement interval also worked. Afterwards I deleted the container completely and reinstalled "latest". Now it does not work at all. Before the reinstallation I saw the same issue like https://github.com/roest01/docker-speedtest-analyser/issues/71?_pjax=%23js-repo-pjax-container#issue-832599511. After reinstallation it fails with nginx - it wants to reload OpenResty, but doesn't work. The same result by the way with the fork of mikehhhhhh.

Here is a Part of my log (sorry, it's backwards): 2021-04-08 10:44:00 crond[8]: line /var/www/html/scripts/speedtestRunner.py >/dev/stdout 2>&1 2021-04-08 10:44:00 crond[8]: file root: 2021-04-08 10:44:00 crond[8]: wakeup dt=60 2021-04-08 10:43:00 --- running speedtest --- 2021-04-08 10:43:00 crond[8]: line /var/www/html/scripts/speedtestRunner.py >/dev/stdout 2>&1 2021-04-08 10:43:00 crond[8]: file root: 2021-04-08 10:43:00 crond[8]: wakeup dt=29 2021-04-08 10:43:00 crond[8]: user:root entry:0 /var/www/html/scripts/speedtestRunner.py >/dev/stdout 2>&1 2021-04-08 10:42:31 no file '/usr/local/lib/lua/5.1/loadall.so') 2021-04-08 10:42:31 no file '/usr/lib/lua/5.1/resty.so' 2021-04-08 10:42:31 no file '/usr/local/lib/lua/5.1/resty.so' 2021-04-08 10:42:31 no file './resty.so' 2021-04-08 10:42:31 no file '/usr/local/lib/lua/5.1/loadall.so' 2021-04-08 10:42:31 no file '/usr/lib/lua/5.1/resty/core.so' 2021-04-08 10:42:31 no file '/usr/local/lib/lua/5.1/resty/core.so' 2021-04-08 10:42:31 no file './resty/core.so' 2021-04-08 10:42:31 no file '/usr/share/lua/common/resty/core/init.lua' 2021-04-08 10:42:31 no file '/usr/share/lua/common/resty/core.lua' 2021-04-08 10:42:31 no file '/usr/share/lua/5.1/resty/core/init.lua' 2021-04-08 10:42:31 no file '/usr/share/lua/5.1/resty/core.lua' 2021-04-08 10:42:31 no file '/usr/local/share/lua/5.1/resty/core/init.lua' 2021-04-08 10:42:31 no file '/usr/local/share/lua/5.1/resty/core.lua' 2021-04-08 10:42:31 no file '/usr/share/luajit-2.1.0-beta3/resty/core.lua' 2021-04-08 10:42:31 no file './resty/core.lua' 2021-04-08 10:42:31 no field package.preload['resty.core'] 2021-04-08 10:42:31 nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found: 2021-04-08 10:42:31 nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html) 2021-04-08 10:42:31 crond[8]: user:root entry:0 /var/www/html/scripts/speedtestRunner.py >/dev/stdout 2>&1 2021-04-08 10:42:31 crond[8]: crond (busybox 1.29.3) started, log level 2 2021-04-08 10:42:31 Starting nginx 2021-04-08 10:42:31 Starting Cronjob 2021-04-08 10:42:31 Starting run.sh

GitBeto21 commented 3 years ago

is it working now? since 8th April there are no more data/results 🤔 regardless what I set, it just doesn't work (again)

Mosdn85 commented 3 years ago

is it working now? since 8th April there are no more data/results 🤔 regardless what I set, it just doesn't work (again)

remove it, not worth it any more use this instead, better :)

https://hub.docker.com/r/henrywhitaker3/speedtest-tracker

roest01 commented 3 years ago

@Mosdn85 what a shame... "not worth it" how about a pull request to fix this bug instead of promoting competitors

stevietv commented 3 years ago

to be fair @roest01 there's been a few issues and PR's open for a while with no action taken so I understand why people are looking for other options. It's also not in everyones capacity to create PRs and fix bugs, some people are also only users, not developers.

Its nice to see the PR's merged now, and with some nice added feature also! thanks for that!

Mosdn85 commented 3 years ago

@roest01 : No offence to you eh but a simple answer with "im looking into it" would be also nice :) We have the problem almost 2 months and we receive no response until now when others post other alternatives.

i hope there will be a fix soon, so i can use back your tool...

GitBeto21 commented 3 years ago

still not working empty graph and "invalid date"

Chris122AT commented 3 years ago

I agree to @roest01 and @stevietv. After all, roest01 invested much time in this minimalist speedtest. However, not everyone can contribute that much technically.

I am a more advanced user, not a programmer. What I was trying to do was just replace the old speedtest.py with the latest speedtest.py. I hoped that only the old speedtest.py transferred incorrect / no more data due to changes in the speedtest servers.

Well, it would have been too easy ...

@roest01 It would be nice if you will take on the metric extensions from mikehhhhhhh/docker-speedtest-analyser

Finally: thanks to all person involved and keep up the good work!!

Mosdn85 commented 3 years ago

FIXED :)

roest01 commented 3 years ago

Hey guys,

invested today to update everything around this project.

We have the problem almost 2 months and we receive no response until now when others post other alternatives. Yea sure but isn't the temporary solution to use another time than 30/60 ?

You've closed this ticket. Whats the final solution tho ?

@Chris122AT i've merged the metric extension from mikehhhhhhh/docker-speedtest-analyser in #69

Mosdn85 commented 3 years ago

Indeed still not working yet > reopen image

stevietv commented 3 years ago

its currently working in the develop branch - pull that or maybe @roest01 can merge develop to master?

Bananas-Are-Yellow commented 3 years ago

Any update on this? I saw that the docker image on Docker Hub was updated yesterday, so I pulled it, but it still doesn't work.

For what it's worth, I tried the other, "use this it's better", alternative and I don't like it. I just want this one to work.

Webreaper commented 3 years ago

Still broken.

jaxjexjox commented 2 years ago

It continues to be broken, someone needs to fork.

Webreaper commented 2 years ago

It continues to be broken, someone needs to fork.

Just use the speedtest-tracker mentioned by @Mosdn85. I've been using it for months, it's completely ronseal.

jaxjexjox commented 2 years ago

It continues to be broken, someone needs to fork.

Just use the speedtest-tracker mentioned by @Mosdn85. I've been using it for months, it's completely ronseal.

I prefer the look of the original here, if I had the skills, I'd fix it, but sadly I don't. I am already using tracker tho, thank you.

jaxjexjox commented 2 years ago

I've switched to a fork for now mikehhhhhhh/docker-speedtest-analyser for now as its fixed a few things in PRs. would be great if @roest01 could merge some of the PRs and keep this all to one image.

I just tried out @mikehhhhhhh one and it doesn't appear to be working for me either. I even tried, pip3 install speedtest-cli just in case that was busted (heck, it fixed someone elses issues) but no dice. Clicking the manual button, to instigate a test, doesn't appear to work.