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.2k stars 30.57k forks source link

Radio Browser not initialized #67818

Closed githubsteveb closed 2 years ago

githubsteveb commented 2 years ago

The problem

Hi guys - i can't seem to get the new Radio Brower integration working - any idea?

Configuration > Devices and Services > Add > Radio Browser.

Install, but see the following:

image

image

image

What version of Home Assistant Core has the issue?

core-2022.3.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

radio_browser

Link to integration documentation on our website

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

Diagnostics information

Logger: homeassistant.config_entries
Source: components/radio_browser/__init__.py:25
First occurred: 13:48:07 (2 occurrences)
Last logged: 18:15:05

Error setting up entry Radio Browser for radio_browser
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/radio_browser/__init__.py", line 25, in async_setup_entry
    await radios.stats()
  File "/usr/local/lib/python3.9/site-packages/radios/radio_browser.py", line 122, in stats
    response = await self._request("stats")
  File "/usr/local/lib/python3.9/site-packages/backoff/_async.py", line 133, in retry
    ret = await target(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/radios/radio_browser.py", line 73, in _request
    result = await resolver.query("_api._tcp.radio-browser.info", "SRV")
aiodns.error.DNSError: (1, 'DNS server returned answer with no data')

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

radio_browser documentation radio_browser source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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

nzhillnet commented 2 years ago

I can confirm I'm seeing the same behavior. My log output looks like this:

Logger: homeassistant.config_entries
Source: components/radio_browser/__init__.py:25
First occurred: March 9, 2022, 10:09:20 (2 occurrences)
Last logged: March 10, 2022, 08:37:19

Error setting up entry Radio Browser for radio_browser
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/radio_browser/__init__.py", line 25, in async_setup_entry
    await radios.stats()
  File "/usr/local/lib/python3.9/site-packages/radios/radio_browser.py", line 122, in stats
    response = await self._request("stats")
  File "/usr/local/lib/python3.9/site-packages/backoff/_async.py", line 133, in retry
    ret = await target(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/radios/radio_browser.py", line 73, in _request
    result = await resolver.query("_api._tcp.radio-browser.info", "SRV")
aiodns.error.DNSError: (1, 'DNS server returned answer with no data')

Thanks.

7ee1441f5a commented 2 years ago

I also had this problem. After investigating, it turned out the DNS queries to identify the Service records (SRV) were failing.

  File "/usr/local/lib/python3.9/site-packages/radios/radio_browser.py", line 73, in _request
    result = await resolver.query("_api._tcp.radio-browser.info", "SRV")  
aiodns.error.DNSError: (1, 'DNS server returned answer with no data')

I'm using OpenWRT and dnsmasq has been configured to 'filter useless' (in DHCP and DNS -> Advanced Settings).

Once I allowed dnsmasq to forward these queries, I could successfully query the SRV records from my Home Assistant device, and RadioBrowser correctly initialised.

$ dig srv _api._tcp.radio-browser.info @207.67.222.222 +noall +answer  

_api._tcp.radio-browser.info. 293 IN    SRV     1 1 443 fr1.api.radio-browser.info.  
_api._tcp.radio-browser.info. 293 IN    SRV     1 1 443 de1.api.radio-browser.info.  
_api._tcp.radio-browser.info. 293 IN    SRV     1 1 443 nl1.api.radio-browser.info.  
nzhillnet commented 2 years ago

Thanks @7ee1441f5a . As I run dnsmasq, this was the solution for me. @frenck is this just a simple documentation add??

I appreciate the help!

githubsteveb commented 2 years ago

I also had this problem. After investigating, it turned out the DNS queries to identify the Service records (SRV) were failing.

  File "/usr/local/lib/python3.9/site-packages/radios/radio_browser.py", line 73, in _request
    result = await resolver.query("_api._tcp.radio-browser.info", "SRV")  
aiodns.error.DNSError: (1, 'DNS server returned answer with no data')

I'm using OpenWRT and dnsmasq has been configured to 'filter useless' (in DHCP and DNS -> Advanced Settings).

Once I allowed dnsmasq to forward these queries, I could successfully query the SRV records from my Home Assistant device, and RadioBrowser correctly initialised.

$ dig srv _api._tcp.radio-browser.info @207.67.222.222 +noall +answer  

_api._tcp.radio-browser.info. 293 IN    SRV     1 1 443 fr1.api.radio-browser.info.  
_api._tcp.radio-browser.info. 293 IN    SRV     1 1 443 de1.api.radio-browser.info.  
_api._tcp.radio-browser.info. 293 IN    SRV     1 1 443 nl1.api.radio-browser.info.  

Interesting. I'm using a off the shelf D-Link router, stock firmware with no other customization like OpenWRT.

The only thing DNS-y about my home assistant setup it that i'm using Duck DNS...

roussell commented 2 years ago

I'm having the same problem across 3 separate installs of HA: HAOS, Supervised, and docker, all on a UniFI network with a UDM Pro as the firewall/router. I don't see settings for dns filtering or advanced options on the UDMP (although I'd guess it has dnsmasq running in the background).

`dig srv _api._tcp.radio-browser.info @207.67.222.222 +noall +answer

; <<>> DiG 9.16.1-Ubuntu <<>> srv _api._tcp.radio-browser.info @207.67.222.222 +noall +answer ;; global options: +cmd ;; connection timed out; no servers could be reached`

The interesting bit is that radio browser DID work when it was released, I used it randomly for several days before it stopped. Perhaps some hidden Unifi update broke it. Putting this here for others that don't have to flexibility of adjusting DNS filtering. Unsure of a resolution at this point.

frenck commented 2 years ago

is this just a simple documentation add??

I don't think we should add stuff like that. If you choose to run additional advanced networks, we expect you to be able to handle such cases. There are thousands of exceptions we could document for these cases (which doesn't make things clearer as well).

Anyways, closing the issue on this end, as it is clearly not Home Assistant related.

../Frenck