MiguelNdeCarvalho/speedtest-exporter

Container Status always unhealthy

Closed this issue · 6 comments

Logs show
[2021-04-15 14:16:46.303] [error] Configuration - Cannot retrieve configuration document (0)
,[2021-04-15 14:16:46.304] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
,[2021-04-15 14:16:46.304] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
,{
, "type": "log",
, "timestamp": "2021-04-15T14:16:46Z",
, "message": "Configuration - Could not retrieve or read configuration (ConfigurationError)",
, "level": "error"
,}
,ERROR:Speedtest-Exporter:Exception on /metrics [GET]
,Traceback (most recent call last):
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
, response = self.full_dispatch_request()
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
, rv = self.handle_user_exception(e)
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
, reraise(exc_type, exc_value, tb)
, File "/usr/local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
, raise value
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
, rv = self.dispatch_request()
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
, return self.view_functionsrule.endpoint
, File "/app/exporter.py", line 70, in updateResults
, r_server, r_jitter, r_ping, r_download, r_upload, r_status = runTest()
, File "/app/exporter.py", line 47, in runTest
, output = subprocess.check_output(cmd)
, File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
, return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
, File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
, raise CalledProcessError(retcode, process.args,
,subprocess.CalledProcessError: Command '['speedtest', '--format=json-pretty', '--progress=no', '--accept-license', '--accept-gdpr']' returned non-zero exit status 2.
,[2021-04-15 14:38:22.019] [error] Trying to get interface information on non-initialized socket.
,[2021-04-15 14:38:27.535] [error] Configuration - Couldn't resolve host name (HostNotFoundException)
,[2021-04-15 14:38:27.535] [error] Configuration - Cannot retrieve configuration document (0)
,[2021-04-15 14:38:27.536] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
,[2021-04-15 14:38:27.536] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
,{
, "type": "log",
, "timestamp": "2021-04-15T14:38:27Z",
, "message": "Configuration - Could not retrieve or read configuration (ConfigurationError)",
, "level": "error"
,}
,ERROR:Speedtest-Exporter:Exception on /metrics [GET]
,Traceback (most recent call last):
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
, response = self.full_dispatch_request()
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
, rv = self.handle_user_exception(e)
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
, reraise(exc_type, exc_value, tb)
, File "/usr/local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
, raise value
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
, rv = self.dispatch_request()
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
, return self.view_functionsrule.endpoint
, File "/app/exporter.py", line 70, in updateResults
, r_server, r_jitter, r_ping, r_download, r_upload, r_status = runTest()
, File "/app/exporter.py", line 47, in runTest
, output = subprocess.check_output(cmd)
, File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
, return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
, File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
, raise CalledProcessError(retcode, process.args,
,subprocess.CalledProcessError: Command '['speedtest', '--format=json-pretty', '--progress=no', '--accept-license', '--accept-gdpr']' returned non-zero exit status 2.
,[2021-04-15 16:28:01.854] [error] Trying to get interface information on non-initialized socket.
,[2021-04-15 16:28:07.373] [error] Configuration - Couldn't resolve host name (HostNotFoundException)
,[2021-04-15 16:28:07.373] [error] Configuration - Cannot retrieve configuration document (0)
,[2021-04-15 16:28:07.374] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
,[2021-04-15 16:28:07.374] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
,{
, "type": "log",
, "timestamp": "2021-04-15T16:28:07Z",
, "message": "Configuration - Could not retrieve or read configuration (ConfigurationError)",
, "level": "error"
,}
,ERROR:Speedtest-Exporter:Exception on /metrics [GET]
,Traceback (most recent call last):
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
, response = self.full_dispatch_request()
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
, rv = self.handle_user_exception(e)
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
, reraise(exc_type, exc_value, tb)
, File "/usr/local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
, raise value
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
, rv = self.dispatch_request()
, File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
, return self.view_functionsrule.endpoint
, File "/app/exporter.py", line 70, in updateResults
, r_server, r_jitter, r_ping, r_download, r_upload, r_status = runTest()
, File "/app/exporter.py", line 47, in runTest
, output = subprocess.check_output(cmd)
, File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
, return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
, File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
, raise CalledProcessError(retcode, process.args,
,subprocess.CalledProcessError: Command '['speedtest', '--format=json-pretty', '--progress=no', '--accept-license', '--accept-gdpr']' returned non-zero exit status 2.
,

Hey,

It appears that you don't have internet, that's why it failing. Can you try to use v3.1 tag?

Thanks,
MiguelNdeCarvalho

I'm also having this issue, which can be reproduced as follows:

docker run --rm -it miguelndecarvalho/speedtest-exporter:v3.1 sh

/app $ speedtest
[2021-04-16 16:21:24.520] [error] Configuration - SSL connect error (UnknownException)
[2021-04-16 16:21:24.520] [error] Configuration - Cannot retrieve configuration document (0)
[2021-04-16 16:21:24.520] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[2021-04-16 16:21:24.520] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[error] Configuration - Could not retrieve or read configuration (ConfigurationError)

I do have internet, but maybe I'm not passing it to the speedtest container as expected?

It appears that this error is from speedtest-cli itself, and is fixed in the latest version 2.1.3.

Hi @xtreme2020

Could you paste the logs from following:

docker run --rm -it miguelndecarvalho/speedtest-exporter:v3.1 sh

/app $ speedtest -v

This sets CLI to output slightly more information(-v flag is for logging verbosity).

docker run --rm -it miguelndecarvalho/speedtest-exporter:v3.1 sh

Hi, everyone
this is what I got from the command above, look like the container cannot pick internet but my internet connection is ok

[2021-04-17 20:14:50.332] [warning] Failed to resolve host www.speedtest.net: : [-3] Try again
[2021-04-17 20:14:50.332] [warning] Cannot open connection - no destination address.
[2021-04-17 20:14:50.332] [error] Trying to get interface information on non-initialized socket.
[2021-04-17 20:14:55.848] [warning] Failure during HTTP request (effective url: https://cli.speedtest.net/api/cli/config?deviceId=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855&hid=U%2501%2501P%2502%2504VTR%250E%255B%2503&sid=fe1c41fa2d6aadde364d9012579820e48be900c58f1c15fd76aff4b7cce9dc2b&uname=Linux%204.19.0-0.bpo.9-amd64%20%231%20SMP%20Debian%204.19.118-2%2Bdeb10u1~bpo9%2B1%20(2020-06-09)%20x86_64)
[2021-04-17 20:14:55.848] [warning] HostNotFoundException
[2021-04-17 20:14:55.848] [warning] Couldn't resolve host name
[2021-04-17 20:14:55.849] [error] Configuration - Couldn't resolve host name (HostNotFoundException)
[2021-04-17 20:14:55.849] [error] Configuration - Cannot retrieve configuration document (0)
[2021-04-17 20:14:55.849] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[2021-04-17 20:14:55.850] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[error] Configuration - Could not retrieve or read configuration (ConfigurationError)

Hi, everyone already got it working, for some reason there was a problem with the network assigned by docker, so I started the container with docker run -d --network host --name speedtest-exporter miguelndecarvalho/speedtest-exporter:v3.1 , once I changed the network to host everything start working