brennentsmith / internet-speed-logger

Open source application to track your internet download and upload speeds with an elegant web interface.
GNU General Public License v3.0
176 stars 33 forks source link

speedtest not found. #2

Closed jonwilliams84 closed 4 years ago

jonwilliams84 commented 4 years ago

Hi, I have not changed the command for speedtest, yet it cannot be found.

"speedlogger-runner_1 | Error executing Speedtest speedlogger-runner_1 | Error: Command failed: speedtest -f json --accept-license speedlogger-runner_1 | /bin/sh: 1: speedtest: not found speedlogger-runner_1 | speedlogger-runner_1 | at ChildProcess.exithandler (child_process.js:295:12) speedlogger-runner_1 | at ChildProcess.emit (events.js:210:5) speedlogger-runner_1 | at maybeClose (internal/child_process.js:1021:16) speedlogger-runner_1 | at Socket. (internal/child_process.js:430:11) speedlogger-runner_1 | at Socket.emit (events.js:210:5) speedlogger-runner_1 | at Pipe. (net.js:658:12) { speedlogger-runner_1 | killed: false, speedlogger-runner_1 | code: 127, speedlogger-runner_1 | signal: null, speedlogger-runner_1 | cmd: 'speedtest -f json --accept-license' speedlogger-runner_1 | } speedlogger-runner_1 | /bin/sh: 1: speedtest: not found speedlogger-runner_1 | speedlogger-runner_1 | Failed to connect to parse output speedlogger-runner_1 | SyntaxError: Unexpected end of JSON input speedlogger-runner_1 | at JSON.parse () speedlogger-runner_1 | at processOutput (/data/run-speedtest.js:55:23) speedlogger-runner_1 | at ChildProcess.exithandler (child_process.js:302:5) speedlogger-runner_1 | at ChildProcess.emit (events.js:210:5) speedlogger-runner_1 | at maybeClose (internal/child_process.js:1021:16) speedlogger-runner_1 | at Socket. (internal/child_process.js:430:11) speedlogger-runner_1 | at Socket.emit (events.js:210:5) speedlogger-runner_1 | at Pipe. (net.js:658:12) speedlogger-runner_1 | Sleeping for 48793 seconds before next run..."

jonwilliams84 commented 4 years ago

If I change the command to the absolute path /data/bin/speedtest it still fails with same error. Looks like the config isn't been parsed at launch. If I exec into the container I am able to run it manually.

jonwilliams84 commented 4 years ago

Ok, managed to resolve. Problem is the image appears to have been built with the following in the default.json:

node@3d6f4c92ce45:/data$ cat config/default.json:

"{ "webserver": { "listenPort": 3000, "listenHost": "0.0.0.0" }, "db": { "connectionString": "mongodb://speedtest:speedtest@mongo:27017/speedtest", "collection": "speedtest" }, "speedtest": { "commandString": "speedtest -f json --accept-license", "intervalSec": 43200 }"

So, have added a volume to the runner service within the docker-compose.yml bind-mounting the file directly. "volumes: -./config/default.json:/data/config/default.json:ro"

It also appears that the latest build of speedtest requires an additional flag '--accept-gdpr' to accept a second interactive prompt.

Hope this helps.

brennentsmith commented 4 years ago

Hi @jonwilliams84 - thanks for bringing the --accept-gdpr flag to my attention. It is only needed in the EU, so it did not flag here in the US. I've fixed it in https://github.com/brennentsmith/internet-speed-logger/pull/3 and the image has been updated on DockerHub.