node_mdns icon indicating copy to clipboard operation
node_mdns copied to clipboard

Raspberry PI 2 : Apple Bonjour compatibility layer of Avahi

Open jaumard opened this issue 9 years ago • 10 comments

Hi,

I'm trying to implement this module on raspberry pi 2 with node v0.10.5, npm v2.5.0 and mdns v2.2.9. Everything is working on my mac but on Raspberry pi 2 I have this message :

*** 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>

This is normal ?

jaumard avatar Aug 10 '15 07:08 jaumard

As far as I'm aware, this is totally normal and everything should work just fine :+1:

ronkorving avatar Aug 10 '15 10:08 ronkorving

I have this error I see it a lot on internet but not a clear solution if anyone have one Error: dns service error: unknown at Error (native) at new Advertisement (/var/www/bonjour/node_modules/mdns/lib/advertisement.js:56:10) at Object.create as createAdvertisement at Object. (/var/www/bonjour/server.js:11:15) 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 Function.Module.runMain (module.js:501:10) at startup (node.js:129:16)

jaumard avatar Aug 21 '15 15:08 jaumard

I'm getting the same. This fails when I run npm test on a Pi B+ with Arch:

✘ DNSServiceRegister()          [16/20]
Error: dns service error: unknown
{ [Error: dns service error: unknown] errorCode: -65537 }
AssertionError: File descriptor must not be -1 after initialization
{ [AssertionError: File descriptor must not be -1 after initialization]
  name: 'AssertionError',
  actual: -1,
  expected: -1,
  operator: '!==',
  message: 'File descriptor must not be -1 after initialization',
  generatedMessage: false }
AssertionError: DNSServiceRef must be initialized
{ [AssertionError: DNSServiceRef must be initialized]
  name: 'AssertionError',
  actual: false,
  expected: true,
  operator: '===',
  message: 'DNSServiceRef must be initialized',
  generatedMessage: false }
Error: dns service error: unknown
{ [Error: dns service error: unknown] errorCode: -65537 }
/home/volumio/volumio/node_modules/mdns/tests/test_dns_sd.js:379
  dns_sd.DNSServiceRegister(serviceRef, 0, 0, null, service_type,
         ^

Error: dns service error: unknown
    at Error (native)
    at exports.DNSServiceProcessResult() (/home/volumio/volumio/node_modules/mdns/tests/test_dns_sd.js:379:10)
    at run_testcase (/home/volumio/volumio/node_modules/mdns/utils/testrun:191:3)
    at Array.<anonymous> (/home/volumio/volumio/node_modules/mdns/node_modules/slide/lib/bind-actor.js:15:8)
    at LOOP (/home/volumio/volumio/node_modules/mdns/node_modules/slide/lib/chain.js:15:14)
    at /home/volumio/volumio/node_modules/mdns/node_modules/slide/lib/chain.js:18:7
    at EventEmitter.done (/home/volumio/volumio/node_modules/mdns/utils/testrun:189:5)
    at exports.DNSServiceRegister() (/home/volumio/volumio/node_modules/mdns/tests/test_dns_sd.js:314:5)
    at run_testcase (/home/volumio/volumio/node_modules/mdns/utils/testrun:191:3)
    at Array.<anonymous> (/home/volumio/volumio/node_modules/mdns/node_modules/slide/lib/bind-actor.js:15:8)
npm ERR! Test failed.  See above for more details.

acidicX avatar Dec 02 '15 08:12 acidicX

I'm getting the same on Debian to Banana Pi(Bananian)

*** 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>
/root/banacast/node_modules/mdns/lib/browser.js:86
  dns_sd.DNSServiceBrowse(self.serviceRef, flags, ifaceIdx, '' + requested_type,
         ^

Error: dns service error: unknown
    at Error (native)
    at new Browser (/root/banacast/node_modules/mdns/lib/browser.js:86:10)
    at Object.create [as createBrowser] (/root/banacast/node_modules/mdns/lib/browser.js:114:10)
    at Object.<anonymous> (/root/banacast/index.js:4:20)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)

chameleonbr avatar Jan 05 '16 18:01 chameleonbr

I am following a prescription for installing the SignalK node server on a Raspberry Pi 3. one step is to $sudo apt-get install mdns I receive errors : make failed with error code 2 ../src/mdns.hpp:32:20 fatal error dns_sd.h: No such file or directory

ERR Failed at the [email protected] install script 'node-gyp rebuild'. This is most likely a problem with the mdns package not with npm itself. Tell the author that this fails on our system

There is a debug file, but I am too new to figure out how to get this off the pi to a pc.

Can you help or point me in the right direction

thanks, ron

CaptainRon47 avatar Mar 28 '16 04:03 CaptainRon47

I fixed this by editing /etc/nsswitch.conf, and adding mdns6_minimal to the hosts: resolvers line as so:

hosts: files mdns4_minimal mdns6_minimal [NOTFOUND=return] dns

Without this a Linux system will not resolve mdns on ipv6. I saw a lot of options above for only looking at ipv4 addresses, and figured my system was probably not setup for IPv6 resolving. This appears to be the case. This is a Debian/testing laptop, but I tend to believe most Linux desktops will be configured this way.

Title should definitely be edited to remove the Raspberry Pi red herring!

rektide avatar Jun 12 '16 19:06 rektide

@rektide this is not an issue about configuration. It's about node_mdns not building and/or failing tests on a raspberry pi. The title is correct because those problems seem to be specific to the raspberry pi.

acidicX avatar Jun 13 '16 06:06 acidicX

I have the same problem using ubuntu inside a Docker image.

timoschilling avatar Jul 03 '16 12:07 timoschilling

I have the same problem using ubuntu inside a Docker image.

Same here

fridgerator avatar Dec 21 '16 16:12 fridgerator

I am having the problem on a Raspberry Pi 4! I just want a reliable library to detect mdns services in the local network. I know about mdns-js, but this tool gives me only the IP but not the port of a service!

awgrass avatar Jun 15 '20 19:06 awgrass