node_mdns: Raspberry PI 2 getaddrinfo 3008 error
I’ve this sample script:
var mdns = require('mdns');
var browser = mdns.createBrowser(mdns.tcp('http'));
browser.on('error', function (error) {
console.log("error");
console.log(error);
});
browser.on('serviceUp', function (service) {
console.log("serviceUp");
console.log(service);
});
browser.start();
On my Mac it’s working fine, and two services is found. If I run the exact same script on my Raspberry PI 2 running Raspbean (connected to the same network), I get this output:
pi@raspberrypi ~ $ node mdns.js
*** 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>
error
{ [Error: getaddrinfo -3008] code: -3008, errno: -3008, syscall: 'getaddrinfo' }
error
{ [Error: getaddrinfo -3008] code: -3008, errno: -3008, syscall: 'getaddrinfo' }
This issue, states that it’s fair to ignore the warnings.
But what about the two errors? Is this an issue with this module or some kind of configuration issue on Raspberry PI?
About this issue
- Original URL
- State: open
- Created 9 years ago
- Reactions: 4
- Comments: 22 (4 by maintainers)
Commits related to this issue
- scanner: workaround a problem when resolving MDNS names The root cause is a bit fuzzy. See https://github.com/agnat/node_mdns/issues/130 for more information. — committed to vincentbernat/nodecastor by vincentbernat 9 years ago
- adding resolver chain workaround for raspberry pi adding the workaround from https://github.com/agnat/node_mdns/issues/130 to fix #140 — committed to KraigM/homebridge-yamaha by luxus 9 years ago
- adding resolver chain workaround for raspberry pi adding the workaround from https://github.com/agnat/node_mdns/issues/130 to fix #140 — committed to SphtKr/homebridge-zway by luxus 9 years ago
- Fix mDNS discovery bug on RPi https://github.com/agnat/node_mdns/issues/130 — committed to SignalK/signalk-js-client by tkurki 8 years ago
- Fix RaspberryPi's MDNS browser https://github.com/agnat/node_mdns/issues/130 — committed to vervallsweg/cast-web-api by vervallsweg 7 years ago
- try to fixdiscovery on Linux :bug: see also agnat/node_mdns#130 — committed to derhuerst/search-fasp-receivers by derhuerst 6 years ago
- Fix: Error: getaddrinfo -3008 $ node examples/findPrinters.js *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to us... — committed to kangear/ipp by deleted user 6 years ago
- fix mdns issue on linux https://stackoverflow.com/questions/29589543/raspberry-pi-mdns-getaddrinfo-3008-error https://github.com/agnat/node_mdns/issues/130 — committed to things-factory/print-proxy-service by heartyoh 4 years ago
- fix mdns issue on linux https://stackoverflow.com/questions/29589543/raspberry-pi-mdns-getaddrinfo-3008-error https://github.com/agnat/node_mdns/issues/130 — committed to things-factory/screencast-proxy-service by heartyoh 4 years ago
- Trying to fix some issues with IPV6 and AVAHI on RPI. (See https://github.com/agnat/node_mdns/issues/130) — committed to concordant/c-service by balegas 5 years ago
- Trying to fix some issues with IPV6 and AVAHI on RPI. (See https://github.com/agnat/node_mdns/issues/130) — committed to concordant/c-service by balegas 5 years ago
- Trying to fix some issues with IPV6 and AVAHI on RPI. (See https://github.com/agnat/node_mdns/issues/130) — committed to concordant/c-service by balegas 5 years ago
- Trying to fix some issues with IPV6 and AVAHI on RPI. (See https://github.com/agnat/node_mdns/issues/130) — committed to concordant/c-service by balegas 5 years ago
- Trying to fix some issues with IPV6 and AVAHI on RPI. (See https://github.com/agnat/node_mdns/issues/130) — committed to concordant/c-service by balegas 5 years ago
- release Service REST API Refactoring tests and responsibilities of datasource and connection; Added offline support. Update README.md Offline tests with CRDTs Exports and type definitions Exports... — committed to concordant/c-service by balegas 5 years ago
- release Service REST API Refactoring tests and responsibilities of datasource and connection; Added offline support. Update README.md Offline tests with CRDTs Exports and type definitions Exports... — committed to concordant/c-service by itoumlilt 5 years ago
I guess you’ve found out by now, but for future reference you can change this:
into this:
That resolver sequence made it work for me on Raspberry Pi.
Hello, I have the same kind of problem with either
io.js 1.6.4
ornode 0.12.2
I found use the following workaround: adding this linemdns.Browser.defaultResolverSequence[1] = 'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]});
right after the require.var mdns = require('mdns');
Look like the issue on my machine is with resolving IPv6 addresses. I have a tempoarary workaround (for me at least). If I modify Browser.defaultResolverSequence in lib/browser.js to only use IPv4 my issue goes away.
here is my new Browser.defaultResolverSequence:
After some debugging on debian/stretch, I’ve found some more info on this : error -3008 is from
uv_getaddrinfo
, returningUV__EAI_NONAME
, which is -3008 (ref.)It’s not “normal behaviour” as the service has been detected so there must be a way to reach it.
Meanwhile, a more intuitive handling might be done by modifying
lib/resolver_sequence_tasks.js :109
I’m not even sure
getaddrinfo
could return ‘ENOENT’ btw?Concerning the core issue of having a service without any valid reaching address, I’m still looking into it but as previously said by others, it most probably comes from a malformed network stack configuration.