Skip to content
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

Error: dns_sd.DNSServiceRegister dns service error: unknown #613

Closed
nzhome opened this issue Apr 26, 2016 · 16 comments
Closed

Error: dns_sd.DNSServiceRegister dns service error: unknown #613

nzhome opened this issue Apr 26, 2016 · 16 comments

Comments

@nzhome
Copy link

nzhome commented Apr 26, 2016

[4/26/2016, 8:43:29 PM] Loaded plugin: homebridge-legacy-plugins
[4/26/2016, 8:43:29 PM] Registering platform 'homebridge-legacy-plugins.X10'
[4/26/2016, 8:43:29 PM] ---
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
ââââââââââââââ
â 031-45-154 â
ââââââââââââââ
[4/26/2016, 8:43:29 PM] Homebridge is running on port 51826.
/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns /lib/advertisement.js:56
dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
^

Error: dns service error: unknown
at Error (native)
at new Advertisement (/usr/local/lib/node_modules/homebridge/node_modules/ha p-nodejs/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create [as createAdvertisement](/usr/local/lib/node_modules/homeb ridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:64:10)
at Advertiser.startAdvertising (/usr/local/lib/node_modules/homebridge/node_ modules/hap-nodejs/lib/Advertiser.js:43:30)
at Bridge.Accessory._onListening (/usr/local/lib/node_modules/homebridge/nod e_modules/hap-nodejs/lib/Accessory.js:509:20)
at emitNone (events.js:67:13)
at HAPServer.emit (events.js:166:7)
at HAPServer._onListening (/usr/local/lib/node_modules/homebridge/node_modul es/hap-nodejs/lib/HAPServer.js:182:8)
at emitNone (events.js:67:13)
at EventedHTTPServer.emit (events.js:166:7)

@nzhome
Copy link
Author

nzhome commented Apr 26, 2016

node -v
v4.0.0

npm -v
2.14.2

gcc -v
gcc version 4.9.2 (Debian 4.9.2-10) (armv7 armhf)

@rabenhorst
Copy link

Avahi daemon installed?

@nzhome
Copy link
Author

nzhome commented Apr 28, 2016

$> sudo apt-get install libavahi-compat-libdnssd-dev
libavahi-compat-libdnssd-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@nzhome
Copy link
Author

nzhome commented Apr 28, 2016

oh yeah, you were right mactr0n! you're tha man! I need more than what the homebridge installation wiki says. just libavahi-compat-libdnssd-dev is not enough.. I needed the full line that installs all the proper components. someone should update the homebridge installation wiki, no-where on the installation instructions does it mention this. Also I am probably the first one around here running Debian, I found the fix here: agnat/node_mdns#44 I also got homebridge to compile and run on Windows10 64bit Corei7.

HERE IS THE FIX:

sudo apt-get install avahi-daemon avahi-discover libnss-mdns libavahi-compat-libdnssd-dev

@nzhome nzhome closed this as completed Apr 28, 2016
@zyanlu
Copy link

zyanlu commented Jun 27, 2016

I'm getting this error because dbus-daemon is not running , and avahi-daemon is compiled without dbus, after recompile and restart the daemons , everything works fine.

besides,you could edit /etc/avahi/avahi-daemon.conf to see if avahi is compiled with dbus.

[server]
enable-dbus=yes  #default is yes, but if avahi is not compiled with dbus,this will trggier error.

@Dirk23
Copy link

Dirk23 commented Jul 16, 2016

I tried all the things here but unfortunately nothing helped me. I installed everything on Ubuntu 14.04 and it worked for some days. But suddenly home bridge didn't want to run anymore with the error:

[2016-07-16 17:57:39] Homebridge is running on port 51826.
/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56
  dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
         ^
Error: dns service error: unknown
    at Error (native)
    at new Advertisement (/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:64:10)
    at Advertiser.startAdvertising (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:43:30)
    at Bridge.Accessory._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:510:20)
    at emitNone (events.js:86:13)
    at HAPServer.emit (events.js:185:7)
    at HAPServer._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:182:8)
    at emitNone (events.js:86:13)
    at EventedHTTPServer.emit (events.js:185:7)

I don't know why it stopped working. I didn't change anything on the System

node -v
v.6.3.0

npm -v
3.10.3

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)```

@chymerix
Copy link

I'm getting the exact same error on Bash on Ubuntu on Windows 10 despite trying all the fixes. Does anyone have ideas for how to resolve this?

@Dirk23
Copy link

Dirk23 commented Sep 19, 2016

Still no fix on Ubuntu 14.04?? i am not on Windows with that error

@Dirk23
Copy link

Dirk23 commented Sep 19, 2016

i oversaw this now homebridge seems to run, because i uncommented the bus line!

@erhsch
Copy link

erhsch commented Feb 12, 2017

I had the same Problem:

*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister>
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: dns service error: unknown
    at Error (native)
    at Advertisement.on_service_registered (/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:42:24)
    at SocketWatcher.MDNSService.self.watcher.callback (/usr/lib/node_modules/homebridge/node_modules/mdns/lib/mdns_service.js:18:40)
*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.

The homebridge is running but I can not pair my iphone with "Home" or "Eve". It is tried a few minutes and then canceled. Like a timeout. It does not matter how much the config file was changed.

My mistake was: I had installed after the installation of homebrige (here everything worked) pi-hole. This filters my DNS requests and blocks them.
As soon as this service was switched off, the coupling functioned again. Thus the homebridge must not be on servers with pi-hole, No Track or similar.
So I will install homebridge on another pi in the network.

Maybe someone has the same problem and I could help someone with it.

@teejay-87
Copy link

Got this problem too.
Running Debian Chroot on Synology Nas.

It worked fine till some months ago (I had time to check only now), then it suddenly stopped working.
I think this is ha something to do with a avahi-daemon update.
Something has changed with it because before I had this problem, the Synology interface was showing "avahi-daemon" as running, and now it states it is stopped, but I checked with ps and the result is:

root@DiskStation:/# ps -A | grep avahi
9611 ? 00:00:00 avahi-daemon

Anyone can help?

Also I checked the webpage linked in the errors homebridge prints at startup but they give you a 404.

@cusco
Copy link

cusco commented Jul 19, 2017

I read somewhere that I needed to start the service dbus, and avahi-daemon
did and homebridge started fine:

`root@kali:~# homebridge
*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
[2017-7-19 15:36:19] No plugins found. See the README for information on installing plugins.
[2017-7-19 15:36:19] config.json (/root/.homebridge/config.json) not found.
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐
│ 031-45-154 │
└────────────┘

/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56
dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
^

Error: dns service error: unknown
at new Advertisement (/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create [as createAdvertisement] (/usr/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:64:10)
at Advertiser.startAdvertising (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:43:30)
at Bridge.Accessory._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:532:20)
at emitOne (events.js:115:13)
at HAPServer.emit (events.js:210:7)
at HAPServer._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:190:8)
at emitOne (events.js:115:13)
at EventedHTTPServer.emit (events.js:210:7)
at EventedHTTPServer. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:65:10)
root@kali:# /etc/init.d/dbus start
[ ok ] Starting dbus (via systemctl): dbus.service.
root@kali:
# /etc/init.d/avahi-daemon start
[ ok ] Starting avahi-daemon (via systemctl): avahi-daemon.service.
root@kali:~# homebridge
*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
[2017-7-19 15:36:30] No plugins found. See the README for information on installing plugins.
[2017-7-19 15:36:30] config.json (/root/.homebridge/config.json) not found.
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐
│ 031-45-154 │
└────────────┘

[2017-7-19 15:36:30] Homebridge is running on port 46373.
`

@zesming
Copy link

zesming commented Jul 25, 2017

I have the same error, and I have tried all the solutions above, unfortunately, it doesn't work for me. Then I just have tried to reconfigure all the environment, and found a way to fix the error.

This is my system info

╭─root@raspberrypi ~ ‹ruby-2.4.0› 
╰─➤  uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
╭─root@raspberrypi ~ ‹ruby-2.4.0› 
╰─➤  node -v
v6.11.1
╭─root@raspberrypi ~ ‹ruby-2.4.0› 
╰─➤  npm -v
3.10.10

If you installed homebridge with the README.md - Installation, and only run the command to install avahi.

sudo apt-get install libavahi-compat-libdnssd-dev

Just try to reinstall it.

sudo apt-get remove libavahi-compat-libdnssd-dev
sudo apt-get install libavahi-compat-libdnssd-dev

And comment the config line in /etc/avahi/avahi-daemon.conf because the apt-get command would autoinstall libdbus-1-dev, and it requires dbus lib.

[server]
#enable-dbus=yes # default is yes.

@davehun
Copy link

davehun commented Aug 21, 2017

I get this error too when running without dbus and avahi-daemon.conf has:
enable-dbus=no

@thunderleo
Copy link

I start dbus,then avahi-daemon manually.
Go to work

@ixtli
Copy link

ixtli commented Dec 22, 2017

If you're here because you're trying to make this run on docker, it seems that this works:

FROM node:9.3

RUN apt-get -y update

RUN apt-get -y upgrade

RUN apt-get -y install avahi-daemon avahi-discover libnss-mdns

RUN apt-get -y install libavahi-compat-libdnssd-dev

RUN npm install -g --unsafe-perm homebridge

CMD service dbus start && service avahi-daemon start && homebridge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests