question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Raspberry PI 2 getaddrinfo 3008 error

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:4
  • Comments:22 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
jswetzencommented, Jul 12, 2015

I guess you’ve found out by now, but for future reference you can change this:

var browser = mdns.createBrowser(mdns.tcp('http'));

into this:

var sequence = [
    mdns.rst.DNSServiceResolve(),
    'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]}),
    mdns.rst.makeAddressesUnique()
];
var browser = mdns.createBrowser(mdns.tcp('http'), {resolverSequence: sequence});

That resolver sequence made it work for me on Raspberry Pi.

6reactions
tberthecommented, Apr 20, 2015

Hello, I have the same kind of problem with either io.js 1.6.4 or node 0.12.2 I found use the following workaround: adding this line mdns.Browser.defaultResolverSequence[1] = 'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]}); right after the require. var mdns = require('mdns');

Read more comments on GitHub >

github_iconTop Results From Across the Web

Raspberry PI mdns getaddrinfo 3008 error - Stack Overflow
Just for your information, getaddrinfo error codes can be translated into human-readable text using gai_strerror , defined in netdb.h . Unfortunately, the error...
Read more >
Can't access internet - Raspberry Pi Forums
After some more research, I found out that it is an internet access problem rather than the Node-RED itself. From the terminal I...
Read more >
VSC Code Error-Message in Panel -> Output (Ausgabe)
When using VSC with OH-Extension, I get amongst other things the following error-message in the panel: Error: getaddrinfo ENOTFOUND ...
Read more >
Node.js Error Message “getaddrinfo ENOTFOUND localhost ...
In my case one line from the Hosts file was missing on my computer and I had to figure out how to add...
Read more >
#getaddrinfo - YouTube
Connecting to MongoDb using mongoose - Error getaddrinfo ENOTFOUND - NodeJS ... Raspberry PI mdns getaddrinfo 3008 error - NodeJS.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found