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
70k stars 29.08k forks source link

Radarr intergration broken, with recent update? #104894

Open lowson opened 7 months ago

lowson commented 7 months ago

The problem

It appears like the radarr integration isn't working. I noticed today it was failing, so attempted to reconfigure and reconnect but nothing.

I removed the integration and re-added it but it failed, I check the sonarr setup and it had no issues, so i tried using curl and this worked to confirm HA had access removing networking and DNS related issues.

I can't tell when it stopped working but it seems to be related to the crafted URL at least for the integration flow due to an InvalidURL (see logs errors below).

Happy to source more information or logs, didn't know how to grab Diagnostics details now that the Integration was removed.

What version of Home Assistant Core has the issue?

core-2023.11.2

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

radarr

Link to integration documentation on our website

https://www.home-assistant.io/integrations/radarr/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

ErrorLogs when I attempted to add the integration back

File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/radarr/config_flow.py", line 58, in async_step_user
if result := await validate_input(self.hass, user_input):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/radarr/config_flow.py", line 117, in validate_input
return await radarr.async_try_zeroconf()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiopyarr/request_client.py", line 216, in async_try_zeroconf
await self._session.request(
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 508, in _request
req = self._request_class(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 305, in __init__
self.update_host(url)
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 364, in update_host
raise InvalidURL(url)
aiohttp.client_exceptions.InvalidURL: radarr.<removed FQDN>/initialize.js

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (radarr) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `radarr` 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 radarr` 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)


radarr documentation radarr source (message by IssueLinks)

tkdrob commented 7 months ago

From first look, it appears that you are only including the host and path which is not a complete URL. Include the https:// . I assume you are using TLS with an FQDN?

lowson commented 7 months ago

Sorry, correct I am using https a valid SSL cert and a FQDN but the log above doesn’t show the https for some reason, I wonder it f something is cutting it off.

I was doing a bunch of testing so I could have created a red herring in my own logs too. What’s the best way to get debug logs when re-adding integrations ?

I also monitored the radar logs and could see no attempt to connect during testing.

tkdrob commented 7 months ago

There is likely an issue when the code with FQDNs. Can you use the ip address instead?

lowson commented 7 months ago

Had to change my docker setup around to expose the port as I use a vhost proxy (all on a different host)

I can confirm it works directly to the raw IP/PORT.

I was working before with a FQDNs so maybe something within Core changed causing issues ?

tkdrob commented 7 months ago

Maybe, although I don't use FQDNs for internal connections. Could also be Radarr version? Let me know what you find.

lowson commented 7 months ago

I do some more testing.

I was thinking the Radarr version but saw no attempt to even connect on my proxy logs ruling that part out and it is working with the IP.

When I first was debugging the IP address HA had for the FQDN was empty showing the Core system skipped the local DNS server also but it did recovery after the DNS TTL ended. So I suspect core has broken something 😅

issue-triage-workflows[bot] commented 4 months 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.

kilakewe commented 4 months ago

I was able to get it working for me with a FQDN and ssl, but to do it, I had to specify the port in the url.

For example, https://radarr.example.com:443

By adding the port on the end, it worked. Is it possible that if no port is specified in the connection string, it's defaulting to something else?

TheJimmerJammer commented 4 months ago

i still have not been able to get this to work no matter what i try. i have an ultra.cc seedbox. i can ping the seedbox from within the home assistant OS but i cannot connect to radarr or sonarr no matter what i do. is anyone else having this issue?

motoridersd commented 3 months ago

Tha

I was able to get it working for me with a FQDN and ssl, but to do it, I had to specify the port in the url.

For example, https://radarr.example.com:443

By adding the port on the end, it worked. Is it possible that if no port is specified in the connection string, it's defaulting to something else?

Thank you for this. I was having issues adding mine until I added :443 to the URL like you mentioned.

I have Nginx Proxy Manager handling FQDNs and SSL in my internal network

issue-triage-workflows[bot] commented 3 weeks 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.

iggy commented 3 weeks ago

This is still happening on the latest version. Adding the port number is still a valid workaround.

crazyelectron-io commented 3 days ago

Unfortunately, adding the port does not fix the connection issue for me.

When I run curl -I http://radarr-svc.home.svc.cluster.local:80 from within the HA container I get a 401 (Unauthorized) response from Radarr as expected. When using that same URL and the API-key to add the integration I get "Unable to connect" (hand-translated from Dutch).

BTW, the Sonarr integration has the same issue.

@iggy Do you use SSL on port 443 as workaround?