core
core copied to clipboard
Speedtest stuck on configuration fail fresh install (RPi3)
The problem
Hello,
Fresh try to use speedtest official intégration but stuck at initial auto configuration.
Network work fine, tested with Fast integration it's ok.
Using speedtest on a browser connected to the same network as the Rapsberry Pi 3 is ok.
Cloud it's OK too in another integrations.
Screenshots.
What version of Home Assistant Core has the issue?
2024-2-1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
speedtestdotnet
Link to integration documentation on our website
https://www.home-assistant.io/integrations/speedtestdotnet/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @rohankapoorcom, @engrbm87, mind taking a look at this issue as it has been labeled with an integration (speedtestdotnet
) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of speedtestdotnet
can trigger bot actions by commenting:
-
@home-assistant close
Closes the issue. -
@home-assistant rename Awesome new title
Renames the issue. -
@home-assistant reopen
Reopen the issue. -
@home-assistant unassign speedtestdotnet
Removes the current integration label and assignees on the issue, add the integration domain after the command. -
@home-assistant add-label needs-more-information
Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. -
@home-assistant remove-label needs-more-information
Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
speedtestdotnet documentation speedtestdotnet source (message by IssueLinks)
Nothing in the logs?
Nothing in the logs?
No ... nothing in my supervisor log.
After rebooting speedtest created 3 sensors but still blanck.
Not sure what you mean with supervisor log? It's the normal log (Home Assistant Core) you should look at (which seems to be the one you look at according to the printscreen).
I think best would be to use a computer and expand the full log and see if you see the entries from speedtest
there somewhere.
Same issue here.
2024-02-29 12:01:28.527 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 223, in post
return await super().post(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
result = await self._flow_mgr.async_init(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 345, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/config_flow.py", line 71, in async_step_init
self._servers = self.hass.data[DOMAIN].servers
~~~~~~~~~~~~~~^^^^^^^^```
I have the same issue. See logs below.
For me, it seemed to work fine when using the ‘Auto detect’ server configuration. But it broke the moment I saved the configuration after selecting my internet provider’s own speedtest server.
Core: 2024.2.5 Supervisor: 2024.02.1 Operating System: 12.0 Frontend: 20240207.1
Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: 09:49:46 (8 occurrences)
Last logged: 09:53:18
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 223, in post
return await super().post(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
result = await self._flow_mgr.async_init(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 345, in async_init
result = await self._async_handle_step(flow, flow.init_step, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/config_flow.py", line 71, in async_step_init
self._servers = self.hass.data[DOMAIN].servers
~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'speedtestdotnet'
The debug logging also doesn’t seem to add much new information:
2024-03-03 11:05:55.261 DEBUG (MainThread) [homeassistant.components.speedtestdotnet.coordinator] Finished fetching speedtestdotnet data in 0.325 seconds (success: False)
I have tested and it works fine for me.
But as both of you have an error on line 71 for self._servers = self.hass.data[DOMAIN].servers
but this line is not on 71 but on line 78 it tells me that both of you have a custom component installed and you're not using the core integration.
I recommend you remove this custom version you have and. use the core one, or raise an issue at the custom component repository
I have tested and it works fine for me.
But as both of you have an error on line 71 for
self._servers = self.hass.data[DOMAIN].servers
but this line is not on 71 but on line 78 it tells me that both of you have a custom component installed and you're not using the core integration.I recommend you remove this custom version you have and. use the core one, or raise an issue at the custom component repository
Hello,
Excuse me but I'm using the core version of Speedtest. I don't know how to use another version.
I installed it from the main menu .... So if my file are different that's not because I use an unusual version of the plugin :/
Not sure what you mean with supervisor log? It's the normal log (Home Assistant Core) you should look at (which seems to be the one you look at according to the printscreen).
I think best would be to use a computer and expand the full log and see if you see the entries from
speedtest
there somewhere.
I Will try to join a full text log from my computer when possible.
Sorry, you're right. there was a prior change modifying the line numbers which I didn't notice before.
When exactly do you get this error.
- At HA startup?
- When configuring options?
- Any other time?
Sorry, you're right. there was a prior change modifying the line numbers which I didn't notice before.
When exactly do you get this error.
- At HA startup?
- When configuring options?
- Any other time?
For me, the integration was working fine with the ‘auto detect’ server configuration option (at least for half a year, if not longer). The moment I used the configuration option to select a Speedtest server from the list and stored the configuration, the integration stopped working. It looks like it tries to start, throws above error, then tries to restart itself resulting in an error-loop. I also couldn't change the configuration any more, because when I tried to open the configuration form (the one where I could change the server), I got a pop-up message saying something about a 500 internal error.
I did restart HA in the mean time, and it looks to work properly again now though. It seems to have stored the server I have selected previously, and manually restarting the integration works fine (and results in new speedtest measurements).
Ok So just to clarify. Ha was already running and the integration was working fine and updating it's data. You went and clicked on config entry options for the integration to change the server from the default auto detect to select something. When pressing submit the above error happened?
I somehow don't understand why it would blow up (and doesn't for me when I'm testing.
Ok
So just to clarify.
Ha was already running and the integration was working fine and updating it's data.
You went and clicked on config entry options for the integration to change the server from the default auto detect to select something.
When pressing submit the above error happened?
Yes, exactly.
I somehow don't understand why it would blow up (and doesn't for me when I'm testing.
Interestingly, when looking at the list of available servers, it looked like I only saw a few of the servers I should see. I understand the list is being loaded from speedtest and somehow coming up with nearby servers, but the list I am seeing now is much longer than the list I saw yesterday. Interestingly, the server I have now configured was not always present in this list...
Ok, so speedtest just stopped working again. I didn’t change anything at all since my earlier report that things were working again. The three sensors (up/down/ping) reported unavailable. After reloading the integration, I’m back in the same error-loop as above.
On the bright side: I’m able to reproduce the error message when trying to configure the server when in the error-loop:
Config-flow kon niet geladen worden: 500 Internal Server Error Server got itself in trouble
I'll try to stop spamming after this, but I still believe this is relevant information:
I haven't changed / done anything since the error-loop above, and looking at the graph of the Download entity, I see the following:
It seems that all of a sudden it started working again early in the morning (around 05:30 am), and then stopped working all of a sudden again just now, without any restart, reboot, or anything else happening to the HA system.
More interesting, the logs indicate the following message:
Logger: homeassistant.components.speedtestdotnet.coordinator Source: helpers/update_coordinator.py:345 Integration: Speedtest.net (documentation, issues) First occurred: 3 maart 2024 om 17:52:23 (2 occurrences) Last logged: 08:31:28
Error fetching speedtestdotnet data: Selected server is not found.
That kind of speaks for itself? And that seems to match my earlier findings:
Interestingly, when looking at the list of available servers, it looked like I only saw a few of the servers I should see. I understand the list is being loaded from speedtest and somehow coming up with nearby servers, but the list I am seeing now is much longer than the list I saw yesterday. Interestingly, the server I have now configured was not always present in this list...
Obviously, the selected server (https://t-mobile.speedtestcustom.com) is available and working properly.
Happens to me when configuring.
Following message might appears some times:
Hello,
I've the same issue, I tried to install speedtest from HA (2024.3.3) The only thing that I found in the log related to speedtest integration is the following log :
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/config_flow.py", line 71, in async_step_init
KeyError: 'speedtestdotnet'
Hope that helps
@gjohansson-ST Thank you for the update. I just updated my HomeAssistant to 2024.4 (which has just been released), which includes the fix you mentioned. Since my earlier comment, nothing has changed regarding the Speedtest integration or its settings. Speedtest currently still can't load any results (the Upload, Download and Ping sensors all show 'Unavailable'). When using the 'Configure' option of the integration, no option shows as selected in the 'select server' dropdown (so also not the 'auto detect' option), and the server I had selected earlier is not present in the list of available servers.
The error logs show the following:
2024-04-03 21:21:02.610 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/coordinator.py", line 76, in _async_update_data
return await self.hass.async_add_executor_job(self.update_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/coordinator.py", line 62, in update_data
self.api.get_servers(servers=[server_id])
File "/usr/local/lib/python3.12/site-packages/speedtest.py", line 1353, in get_servers
raise NoMatchedServers()
speedtest.NoMatchedServers
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/coordinator.py", line 78, in _async_update_data
raise UpdateFailed("Selected server is not found.") from err
homeassistant.helpers.update_coordinator.UpdateFailed: Selected server is not found.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/__init__.py", line 35, in _async_finish_startup
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_config_entry_first_refresh
raise ex
homeassistant.exceptions.ConfigEntryNotReady: Selected server is not found.
Your help is very much appreciated. Considering this ticket is closed, please either re-open this ticket or let me know if I should open a new ticket.
@gjohansson-ST I can still confirm the same behavior as before the update: Sometimes the server can't be found, no measurements happen and the sensors report unavailable. Then at seemingly random moments the server is found and proper measurements can be made. Then, just as random, the 'connection' seems to be lost again and the sensors report unavailable again.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The issue is still present.