question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hb-service listening on port 5353 which conflicts with avahi daemon

See original GitHub issue

Current Situation

I currently have homebridge running on a raspberry pi 4, historically the “.local” address for homebridge has not been consistent, presumably due to mDNS. To resolve this issue, I have been using Ciao for mDNS and disabled Avahi. When Homebridge 1.4.0 came out, I switched back to Avahi since Homebridge now supported it.

Unfortunately the issue with homebridge’s “.local” not being accessible has comeback. I started debugging this, the first thing I did was look at Avahi’s log (by running sudo systemctl status avahi-daemon.service), which included the following sentence: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***

Note that this is not always seen in the log since it depends on the order in which the various services listening on port 5353 are started, so after a “clean” restart this usually would not be visible but rather only upon restarting the avahi daemon.

I then proceeded to check which processes were listening on port 5353 (mDNS) and surprisingly discovered that there were 3:

  1. avahi-daemon
  2. chromium-browser
  3. hb-service

I first disabled chromium-browser listening on this port by creating a policy file which disabled Chromium’s media browser, this is done by creating a file named “disable_mediarouter.json” at “/etc/chromium-browser/policies/managed” which contains the following JSON: { “EnableMediaRouter”: false }

I then restarted the server and was indeed happy to discover that Chromium was no longer listening on port 5353. Unfortunately, the warning message still persists because hb-service is still listening on port 5353 in parallel to Avahi. I suspect the problem will persist as well, though I can’t be sure for the time being. If not, then this can just be ignored obviously.

My question is why is hb-service listening on this port given it should be using Avahi as set in the configuration? is there a way to disable it from listening on this port? is this even a problem?

Thanks in advance

Logs

● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2022-01-25 18:05:48 IST; 2s ago
 Main PID: 3579 (avahi-daemon)
   Status: "avahi-daemon 0.7 starting up."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/avahi-daemon.service
           ├─3579 avahi-daemon: running [homebridge.local]
           └─3580 avahi-daemon: chroot helper

Jan 25 18:05:48 homebridge avahi-daemon[3579]: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***

pi@homebridge:~ $ sudo lsof -i:5353
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
hb-servic  882    pi   19u  IPv4  20089      0t0  UDP *:mdns 
avahi-dae 3579 avahi   12u  IPv4  40351      0t0  UDP *:mdns 
avahi-dae 3579 avahi   13u  IPv6  40352      0t0  UDP *:mdns

Configuration

N/A

Environment

  • OS: Rasperry Pi OS
  • Software: Homebridge 1.4.0
  • Node: v16.13.1
  • npm: 8.3.0

Process Supervisor

hb-service

Additional Context

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:26 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
peterneutroncommented, Jan 27, 2022

This should probably also be raise at homebridge-config-ui-x, as that is what hb-service is built into.

Done.

0reactions
seidnerjcommented, Feb 23, 2022

Okay, this has happened again, even with IPv6 disabled. I’m giving up, going back to ciao. Don’t understand why this is happening but don’t have a good way forward. Thanks for everyone here who tried to help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

avahi-daemon binds to eth0 udp ports 5353 and 53791
avahi-daemon continues to bind to eth0 ports 5353 and 53791. Is there any way to tell avahi-daemon to only bind to localhost and...
Read more >
homebridge on Ubuntu 19.04 seems to conflict with my ...
UDP port 5353 is used for mDNS (Avahi). Seems like homebridge is conflicting with the avahi-daemon already running. Any suggestions?
Read more >
Unbound with Pi-hole v3.3.1 - General
port 5353 is by default in use by avahi-daemon according to netstat -anp. ... Wont there be a conflict with avahi if both...
Read more >
dig -p 5353 raspberrypi.local @224.0.0.251
0.251 and UDP port 5353. All devices on your network that are listening on that address will see the query (e.g. Linux systems...
Read more >
CVE - Search Results - MITRE
CVE-2021-26720, avahi-daemon-check-dns.sh in the Debian avahi package through ... sensitive information via port-5353 UDP packets to the Avahi component.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found