homebridge / docker-homebridge

Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
https://hub.docker.com/r/homebridge/homebridge/
GNU General Public License v3.0
2.58k stars 242 forks source link

Synology: Host name conflict #35

Closed otherguy closed 6 years ago

otherguy commented 7 years ago

A fresh install (latest image, latest Synology DSM, latest iOS 11) of homebridge does not work for me. The logs show this:

Withdrawing address record for fe80::42:4cff:fea6:2530 on docker0.
Withdrawing address record for 172.17.0.1 on docker0.
Withdrawing address record for 172.16.1.200 on eth0.
Host name conflict, retrying with homebridge-48
Registering new address record for fe80::42:4cff:fea6:2530 on docker0.*.
Registering new address record for 172.17.0.1 on docker0.IPv4.
Registering new address record for 169.254.175.241 on eth1.IPv4.
Registering new address record for 172.16.1.200 on eth0.IPv4.

As you can see, it's already at -48 and this keeps going on forever.

The relevant log messages are:

Starting Avahi daemon
Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
Successfully dropped root privileges.
avahi-daemon 0.6.32 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Loading service file /etc/avahi/services/sftp-ssh.service.
Loading service file /etc/avahi/services/ssh.service.
*** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***
*** WARNING: Detected another IPv6 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***
Joining mDNS multicast group on interface docker0.IPv6 with address fe80::42:4cff:fea6:2530.
New relevant interface docker0.IPv6 for mDNS.
Joining mDNS multicast group on interface docker0.IPv4 with address 172.17.0.1.
New relevant interface docker0.IPv4 for mDNS.
Joining mDNS multicast group on interface eth1.IPv4 with address 169.254.175.241.
New relevant interface eth1.IPv4 for mDNS.
Joining mDNS multicast group on interface eth0.IPv4 with address 172.16.1.200.
New relevant interface eth0.IPv4 for mDNS.
Network interface enumeration completed.

I have no other Docker images running on the Synology, but there is (native) Plex and a few other services. Is something else running an mDNS service that causes this?

My iOS 11 device is not able to find the homebridge. Entering the code manually just shows a loading spinner that is there forever.

oznu commented 6 years ago

@NorthernMan54,

There are two issues. This issue is more about conflicts with other Bonjour/Avahi stacks running that prevents Homebridge running at all. The no-avahi variant of the image would have prevented your plugins from installing at all so I don't think the referenced issue is related to that comment.

The issue you referenced is because Alpine Linux lacks nss-mds, so it can't resolve .local domains using the system dns. I wrote a small library that resolves the .local domain in pure javascript which solved the problem: mdns-resolver.

The homebridge-dacp plugin author got it working using this: https://github.com/grover/homebridge-dacp/commit/63ab4b8f50f51eba7fcbb54265f65b1c23ab2824

NorthernMan54 commented 6 years ago

@oznu

Do you know if mdns-js https://github.com/mdns-js/node-mdns-js https://github.com/mdns-js/node-mdns-js Has the same issue?

Due to other issues I’m switching to that version, the compiling of mdns on various platforms being the biggest.

Tks

On Mar 10, 2018, at 7:59 PM, oznu notifications@github.com wrote:

@NorthernMan54 https://github.com/northernman54,

There are two issues. This issue is more about conflicts with other Bonjour/Avahi stacks running that prevents Homebridge running at all. The no-avahi variant of the image would have prevented your plugins from installing at all so I don't think the referenced issue is related to that comment.

The issue you referenced is because Alpine Linux lacks nss-mds, so it can't resolve .local domains using the system dns. I wrote a small library that resolves the .local domain in pure javascript which solved the problem: mdns-resolver https://github.com/oznu/mdns-resolver.

The homebridge-dacp plugin author got it working using this: grover/homebridge-dacp@63ab4b8 https://github.com/grover/homebridge-dacp/commit/63ab4b8f50f51eba7fcbb54265f65b1c23ab2824 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oznu/docker-homebridge/issues/35#issuecomment-372080300, or mute the thread https://github.com/notifications/unsubscribe-auth/AS5CmKLoi7njptKbRWtniJ1NyswX-Qalks5tdHcDgaJpZM4QaPL_.

oznu commented 6 years ago

Hi @NorthernMan54,

This library is a pure-javascript implementation of Bonjour which I would recommend, for just discovering devices the master version should be fine:

https://www.npmjs.com/package/bonjour

A pending pull request for HAP-NodeJS uses this in place of the mdns library.

It works great on Linux, macOS and Windows (you don't even need to install Apple Bonjour).

The trick to making any of the mdns libraries work on Alpine Linux is to resolve the .local domain to an IP address in JavaScript.

NorthernMan54 commented 6 years ago

@oznu

Tks for the recommendation. I just tried it, and it worked on first try. Much appreciated

On Mar 11, 2018, at 9:11 PM, oznu notifications@github.com wrote:

Hi @NorthernMan54 https://github.com/northernman54,

This library is a pure-javascript implementation of Bonjour which I would recommend, for just discovering devices the master version should be fine:

https://www.npmjs.com/package/bonjour https://www.npmjs.com/package/bonjour A pending pull request for HAP-NodeJS https://github.com/KhaosT/HAP-NodeJS/pull/495 uses this in place of the mdns library.

It works great on Linux, macOS and Windows (you don't even need to install Apple Bonjour).

The trick to making any of the mdns libraries work on Alpine Linux is to resolve the .local domain to an IP address in JavaScript.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oznu/docker-homebridge/issues/35#issuecomment-372167276, or mute the thread https://github.com/notifications/unsubscribe-auth/AS5CmMecUsdl6_QxISxb-J3-3m5vWW-4ks5tdctHgaJpZM4QaPL_.

JDogg016 commented 6 years ago

So I used the https://github.com/oznu/homebridge-syno-spk link and it worked perfectly for about a month.

I then turned on Bonjour to enable time machine backup.

The container will no longer start and I have documented such on the 'Issues' page of syno-spk. I've also disabled bonjour to see whether that would fix the problem. It did not.

It seem my issue may be related with this issue, but I am unsure.

oznu commented 6 years ago

Homebridge 0.4.39 has been released and drops the mdns dependency. To ensure plugins that depend on mdns still work I'll still be including Avahi in the default image.

The no-avahi version of this image will still be maintained with both Avahi and dbus disabled. People who are using the no-avahi version at the moment should download latest version of that tag which now includes the offical Homebridge package instead of my customised version.

carbonide commented 5 years ago

After updating the GUI Plugin for Homebridge today, I'm getting the same error as the OP.

Homebridge still works fine, I just can't access the GUI anymore.

oznu commented 5 years ago

@carbonide - please see https://github.com/oznu/homebridge-config-ui-x/issues/262#issuecomment-485211571

carbonide commented 5 years ago

I used the command inside the Docker image to update and restarted the container. Everything works fine again now.

Thanks a lot!

szerglyiphone commented 4 years ago

See:

This hostname must match what DSM is using exactly or else it will still fail.

image

Let me know if this does not work for you.

Its fixed the hostname problem. :) Thank you!

giss69 commented 4 years ago

Hi, i have 7 oznu/homebridge running since almost one year without problems. since a couple of days a have the same issue on my containers. ipv6 is deactivated, change status of Bonjour service no success, setup DSM_HOSTNAME no success. What strange is, that it's trying to use ip address of gateway of my docker bridge 172.17.0.1 My DSM_HOSTNAME=HOME-NAS DS IP 192.168.1.50

hier is a couple exemples out of different logs of HB. with setting DSM_HOSTNAME and without. Host name conflict, retrying with HOME-NAS-66 Registering new address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9.*. Registering new address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0.*. Registering new address record for fe80::d419:66ff:fec6:44d2 on docker610261f.*. Registering new address record for fe80::42:16ff:fecb:7444 on docker0.*. Registering new address record for 172.17.0.1 on docker0.IPv4. Registering new address record for 192.168.1.50 on eth0.IPv4. crond[354]: USER root pid 431 cmd run-parts /etc/periodic/15min Withdrawing address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9. Withdrawing address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0. Withdrawing address record for fe80::d419:66ff:fec6:44d2 on docker610261f. Withdrawing address record for fe80::42:16ff:fecb:7444 on docker0. Withdrawing address record for 192.168.1.50 on eth0. Host name conflict, retrying with HOME-NAS-67 Registering new address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9.*. Registering new address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0.*. Registering new address record for fe80::d419:66ff:fec6:44d2 on docker610261f.*. Registering new address record for fe80::42:16ff:fecb:7444 on docker0.*. Registering new address record for 172.17.0.1 on docker0.IPv4. Registering new address record for 192.168.1.50 on eth0.IPv4. without Host name conflict, retrying with hb-alexa-copy-2416 Registering new address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9.*. Registering new address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0.*. Registering new address record for fe80::d419:66ff:fec6:44d2 on docker610261f.*. Registering new address record for fe80::42:16ff:fecb:7444 on docker0.*. Registering new address record for 172.17.0.1 on docker0.IPv4. Registering new address record for 192.168.1.50 on eth0.IPv4. Withdrawing address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9. Withdrawing address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0. Withdrawing address record for fe80::d419:66ff:fec6:44d2 on docker610261f. Withdrawing address record for fe80::42:16ff:fecb:7444 on docker0. Withdrawing address record for 192.168.1.50 on eth0. Host name conflict, retrying with hb-alexa-copy-2417 Registering new address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9.*. Registering new address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0.*. Registering new address record for fe80::d419:66ff:fec6:44d2 on docker610261f.*. Registering new address record for fe80::42:16ff:fecb:7444 on docker0.*. Registering new address record for 172.17.0.1 on docker0.IPv4. Registering new address record for 192.168.1.50 on eth0.IPv4. Host name conflict, retrying with hb-shelly-copy-2419 Registering new address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9.*. Registering new address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0.*. Registering new address record for fe80::d419:66ff:fec6:44d2 on docker610261f.*. Registering new address record for fe80::42:16ff:fecb:7444 on docker0.*. Registering new address record for 172.17.0.1 on docker0.IPv4. Registering new address record for 192.168.1.50 on eth0.IPv4. Withdrawing address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9. Withdrawing address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0. Withdrawing address record for fe80::d419:66ff:fec6:44d2 on docker610261f. Withdrawing address record for fe80::42:16ff:fecb:7444 on docker0. Withdrawing address record for 192.168.1.50 on eth0. Host name conflict, retrying with hb-shelly-copy-2420 Registering new address record for fe80::bce7:faff:fe83:ccd3 on dockereab6db9.*. Registering new address record for fe80::e849:a8ff:fe05:977b on dockercdfbee0.*. Registering new address record for fe80::d419:66ff:fec6:44d2 on docker610261f.*. Registering new address record for fe80::42:16ff:fecb:7444 on docker0.*. Registering new address record for 172.17.0.1 on docker0.IPv4. Registering new address record for 192.168.1.50 on eth0.IPv4. Hope you can help me. Thank you

oznu commented 4 years ago

@giss69 swap to the no-avahi image tag:

https://github.com/oznu/docker-homebridge/wiki#image-variants

giss69 commented 4 years ago

sorry i've opened a new issue. ist it a right version DS 218+ no-avahi | amd64, arm32v6, arm64v8 | Alpine Linux what is the easiest way to swap? or should i delete container and setup a new one?

stephenjmcmahon commented 4 years ago

Also been having this issue. I'm a new user so don't have any historical knowledge but just chiming in as well.

oznu commented 4 years ago

@stephenjmcmahon this comment is still up-to date:

https://github.com/oznu/docker-homebridge/issues/35#issuecomment-619371572

Or use this package: https://github.com/oznu/homebridge-syno-spk

And make sure you select the default option (no-avahi) when prompted.

stephenjmcmahon commented 4 years ago

@oznu appreciate the quick reply! I I've spun up no-avahi and will report back

I also tried "DSM_HOSTNAME" and a matching network hostname as well but no dice there.

stephenjmcmahon commented 4 years ago

@oznu changing to no-avahi per #35 (comment) has seemed to work for me - thank you!

maisun commented 4 years ago

Hi, the same problem with QNAP container station. The hostname is set to the name of the container.