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

Raspberry PI 2 : Apple Bonjour compatibility layer of Avahi #141

Open
jaumard opened this issue Aug 10, 2015 · 10 comments
Open

Raspberry PI 2 : Apple Bonjour compatibility layer of Avahi #141

jaumard opened this issue Aug 10, 2015 · 10 comments

Comments

@jaumard
Copy link

jaumard commented Aug 10, 2015

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 ?

@ronkorving
Copy link
Collaborator

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

@jaumard
Copy link
Author

jaumard commented Aug 21, 2015

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)

@acidicX
Copy link

acidicX commented Dec 2, 2015

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.

@chameleonbr
Copy link

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)

@CaptainRon47
Copy link

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 mdns@2.3.1 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

@rektide
Copy link

rektide commented Jun 12, 2016

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!

@acidicX
Copy link

acidicX commented Jun 13, 2016

@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.

@timoschilling
Copy link

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

@fridgerator
Copy link

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

Same here

@awgrass
Copy link

awgrass commented Jun 15, 2020

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!

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

9 participants