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 service error: unknown #104

Closed
StefanKiendl opened this issue Nov 12, 2014 · 12 comments
Closed

Error: dns service error: unknown #104

StefanKiendl opened this issue Nov 12, 2014 · 12 comments

Comments

@StefanKiendl
Copy link

I use mdns embedded in AirSonos (via NodeTunes) and always get the following error.

The developer of AirSonos sent me here.

Error message:

Error: dns service error: unknown
at new Advertisement (/usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create as createAdvertisement
at NodeTunes. (/usr/lib/node_modules/airsonos/node_modules/nodetunes/lib/server.js:65:21)
at Server.g (events.js:180:16)
at Server.emit (events.js:92:17)
at net.js:1055:10
at process._tickCallback (node.js:419:13)

@agnat
Copy link
Owner

agnat commented Nov 12, 2014

Hi @StefanKiendl

looks like this is your first (public) contribution, like, ever. So, welcome!

Regarding the issue, I'm afraid but I'm going to send you right back. I guess AirSonos is some sort of embedded device running linux and NodeTunes is an application on said device. About right? I also assume that avahi is used.

As you can see the avahi error message is not very helpful. From another issue (#56) I recall that you get an error like that when avahi is not running/reachable. So my best guess at this point is: avahi is installed, including the required compat library but it is not running. So, it is a system issue.

I hope this helps.

@agnat
Copy link
Owner

agnat commented Nov 12, 2014

Ok, AirSonos is an application, too. Whatever... still looks like avahi is not running.

@StefanKiendl
Copy link
Author

Many thanks for the warm welcome!

Just for your information:
AirSonos (https://github.com/stephen/airsonos) is a small Node.js Server which is basically a wrapper around NodeTunes (https://github.com/stephen/nodetunes) and NicerCast () for allowing Apple Airplay streams to a Sonos Multiroom Soundsystems (which does not support AirPlay out of the box). Everything is running on a Synology NAS (x86, Atom CPU) in my setup in a Debian 7.4 chroot environment.

In the background "avahi" is used (Debian packages: libavahi-compat-libdnssd-dev libasound2-dev). It seems running.

But thank you for the hint with that it is probably an avahi problem. I will try to get more logging from avahi, maybe I find the problem there.

@agnat
Copy link
Owner

agnat commented Nov 12, 2014

Not sure it is an avahi problem. The thing with unknown errors is they are ... unknown. My gut feeling still says it is on the system level. Note, that avahi requires dbus. The chroot env might also be at play. If you can compare it to a more ordinary setup. Ubuntu desktop system, no chroot or something. A vbox works well, though.

@beenje
Copy link

beenje commented Nov 13, 2014

I had the same error on my Raspberry Pi.
avahi-daemon was actually not running. When starting I got the error message “avahi-daemon disabled because there is a unicast .local domain”. Setting AVAHI_DAEMON_DETECT_LOCAL=0 in /etc/default/avahi-daemon fixed the problem. See http://www.jackenhack.com/raspberry-pi-avahi-daemon-disabled-because-there-is-a-unicast-local-domain-solved/

Hope it helps.

@siboulet
Copy link

I'm also having a similar problem.

Debian Jessie (testing)
libavahi-compat-libdnssd-dev 0.6.31-4+b1 amd64
Node v0.11.14

*** 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
*** WARNING *** The program 'nodejs' called 'DNSServiceBrowse()' 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=DNSServiceBrowse
xxx/node_modules/mdns/lib/browser.js:76
dns_sd.DNSServiceBrowse(self.serviceRef, flags, ifaceIdx, '' + requested_typ
^
Error: dns service error: unsupported
at Error (native)
at new Browser (xxx/node_modules/mdns/lib/browser.js:76:10)
at Function.create (xxx/node_modules/mdns/lib/browser.js:104:10)
at Object.browseThemAll (xxx/node_modules/mdns/lib/browser.js:116:18)
at Object. (xxx:7:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)

@agnat
Copy link
Owner

agnat commented Nov 22, 2014

Again, this is not the same issue. @siboulet is getting unsupported, which is very different from unknown...

@beckmx
Copy link

beckmx commented Jun 26, 2015

I get the unknown error for OSX, I guess I need avahi or bonjour?

events.js:85
throw er; // Unhandled 'error' event
^
Error: dns service error: unknown
at Error (native)
at Advertisement.on_service_registered (/Users/myself/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:42:24)
at SocketWatcher.MDNSService.self.watcher.callback (/Users/myself/HAP-NodeJS/node_modules/mdns/lib/mdns_service.js:18:40)

@bobvanderlinden
Copy link

I hope I'm not highjacking this issue with a unrelated one, but the problem seems very similar and has the same exception. Output:

*** WARNING *** The program 'node' 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=node>
*** WARNING *** The program 'node' 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=node&f=DNSServiceRegister>
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: dns service error: unknown
    at Error (native)
    at MDNSService.on_resolver_done (/home/bob/projects/node-machinetalk-example/node_modules/machinetalk/node_modules/mdns/lib/resolver_sequence_tasks.js:19:30)
    at SocketWatcher.MDNSService.self.watcher.callback (/home/bob/projects/node-machinetalk-example/node_modules/machinetalk/node_modules/mdns/lib/mdns_service.js:18:40)

The errorCode (of on_resolver_done here) is -65537. I couldn't figure out why this code was sent (any idea?).

This happens while Avahi is running. It seems like it is a timeout from resolving a service on a machine that is non-existant. It might have to do with Avahi having cached a number of services while the machine has been powered off in the meantime. It would explain the semi-randomness I'm seeing.

@agnat
Copy link
Owner

agnat commented Oct 29, 2015

Sorry, no idea. :-/

As a workaround you could obviously trap all unknown errors and (optionally) start a new browser to refresh your lists.

@bobvanderlinden
Copy link

@agnat Yes, I trap the error, but restarting the browser will again result in an error when it again tries to resolve the incorrect. This even happens when restarting the node process.

That said, reproducing this issue is very flaky (I haven't found a good pattern yet). I'll report back if it happens again.

@agnat
Copy link
Owner

agnat commented Oct 29, 2015

I see. Sounds nasty. Best of luck though!

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

6 participants