-
-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HA helper function is failing to retrieve URL #98702
Comments
This is an issue in a custom component thus I am going to close this. Apparently the port passed into this transformation function is "local" which isn't a port, thus it raises an error. |
Ok, thanks for the reply. The developer answered this to me: "Report this to Home Assistant github issues. This is not this integration issue, HA helper function is failing to retrieve URL for your HA instance." |
The problem lies in |
@joostlek I am the custom integration developer. It is passing the HA needs to handle this case internally because it looks like it can be misconfigured in a way this exception is not caught, disregarding the origin of the error. |
Maybe I closed this too fast, but let's try to figure out what might cause this. We need to figure out what To me this sounds like a configuration issue but I'm willing to help figure out. |
@joostlek thank you! @exceldatei please download this branch manually: https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/tree/debug_isUsingHTTPS, mainly the custom_components/tapo_control/utils.py - you can copy the content of the file from the link, replace it in your HA and restart. I added the logs required there. You should then see something like this in your logs, probably "None" logs will be something else on your machine. |
Oh thanks for creating the branch :) |
@JurajNyiri Thank you! I tried it out and copied it into utils.py but after restart its the same. I see the logs as you said but the integration is still not working. 2023-08-20 21:11:49.789 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Fire Tablet' for fully_kiosk integration not ready yet: Cannot connect to host 192.168.1.103:2323 ssl:False [Connect call failed ('192.168.1.103', 2323)]; Retrying in background |
@exceldatei do you see http://192.168.1.120:local under Settings - System - Network - Home Assistant URL? What do you see there? Could you tell us more about your ENV setup, how are you running HA, have you added this URL there manually etc? |
I am really wondering how he ended up in this situation |
HA is set up on a RP4. Indeed I wrote it manually once. Just tried to set it to automatically and it works now. |
Right, I will check in a moment if we actually validate this address before storing it to avoid stuff like this in the future |
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. |
The problem
Cant integrate Tado Camera Controller. Always throws back an integration error.
2023-08-20 12:36:09.457 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.150 for tapo_control
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/yarl/_url.py”, line 191, in new
port = val.port
^^^^^^^^
File “/usr/local/lib/python3.11/urllib/parse.py”, line 182, in port
raise ValueError(f"Port could not be cast to integer value as {port!r}")
ValueError: Port could not be cast to integer value as ‘local’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/tapo_control/init.py”, line 186, in async_setup_entry
if isUsingHTTPS(hass):
^^^^^^^^^^^^^^^^^^
File “/config/custom_components/tapo_control/utils.py”, line 46, in isUsingHTTPS
base_url = get_url(hass, prefer_external=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 145, in get_url
return _get_internal_url(
^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 221, in _get_internal_url
internal_url = yarl.URL(hass.config.internal_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/yarl/_url.py”, line 193, in new
raise ValueError(
What version of Home Assistant Core has the issue?
2023.8.3
What was the last working version of Home Assistant Core?
2023.8.3
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tapo: Cameras Control
Link to integration documentation on our website
No response
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
The text was updated successfully, but these errors were encountered: