home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.21k stars 30.58k forks source link

SpeedTest "URL can't contain control characters." #84159

Closed djpremier closed 1 year ago

djpremier commented 1 year ago

The problem

Unexpected error fetching speedtestdotnet data: URL can't contain control characters. ' sp1.rbt.psi.br' (found at least ' ')

What version of Home Assistant Core has the issue?

2022.12.6

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

SpeedTest

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?

Logger: homeassistant.components.speedtestdotnet
Source: components/speedtestdotnet/__init__.py:115
Integration: Speedtest.net (documentation, issues)
First occurred: 3:45:37 AM (8 occurrences)
Last logged: 7:48:47 PM

Unexpected error fetching speedtestdotnet data: URL can't contain control characters. ' sp1.rbt.psi.br' (found at least ' ')
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/__init__.py", line 127, in async_update
    return await self.hass.async_add_executor_job(self.update_data)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/speedtestdotnet/__init__.py", line 115, in update_data
    best_server = self.api.get_best_server()
  File "/usr/local/lib/python3.10/site-packages/speedtest.py", line 1466, in get_best_server
    h = SpeedtestHTTPConnection(
  File "/usr/local/lib/python3.10/site-packages/speedtest.py", line 418, in __init__
    HTTPConnection.__init__(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/http/client.py", line 853, in __init__
    self._validate_host(self.host)
  File "/usr/local/lib/python3.10/http/client.py", line 1235, in _validate_host
    raise InvalidURL(f"URL can't contain control characters. {host!r} "
http.client.InvalidURL: URL can't contain control characters. ' sp1.rbt.psi.br' (found at least ' ')

Additional information

I'm from Brazil.

home-assistant[bot] commented 1 year ago

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` Change the title of 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.

(message by CodeOwnersMention)


speedtestdotnet documentation speedtestdotnet source (message by IssueLinks)

issue-triage-workflows[bot] commented 1 year ago

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.