node_mdns icon indicating copy to clipboard operation
node_mdns copied to clipboard

Node 8.5 on raspberry breaks the current GetAddrInfo call

Open timoly opened this issue 9 years ago • 3 comments

With node 8.5 on raspbian /usr/bin/node[18904]: ../src/cares_wrap.cc:1944:void node::cares_wrap::{anonymous}::GetAddrInfo(const v8::FunctionCallbackInfov8::Value&): Assertion `args[4]->IsBoolean()' failed.

This seems to be due to dns: add verbatim option to dns.lookup() on https://github.com/nodejs/node/commit/e007f66ae211192f385dc253bfa19a84e7fc649a

reflecting to https://github.com/agnat/node_mdns/blob/master/lib/resolver_sequence_tasks.js#L153

timoly avatar Sep 19 '17 18:09 timoly

I'm having the same issue on Mac OSX :( did you find any workaround until mdns get a fix ?

jaumard avatar Oct 22 '17 10:10 jaumard

I got that error and applied the patch from https://github.com/bnoordhuis/node_mdns/commit/bd0c7aea810e2b2759831b07e50d3e920eae463f but it was still crashing with

Error: getaddrinfo -3008
    at errnoException (/home/admin/Documents/UnitLabs/other_implementations/node/test_libs/mdns/node_modules/mdns/lib/resolver_sequence_tasks.js:199:11)
    at getaddrinfo_complete (/home/admin/Documents/UnitLabs/other_implementations/node/test_libs/mdns/node_modules/mdns/lib/resolver_sequence_tasks.js:112:10)
    at GetAddrInfoReqWrap.oncomplete (/home/admin/Documents/UnitLabs/other_implementations/node/test_libs/mdns/node_modules/mdns/lib/resolver_sequence_tasks.js:120:9)

After some digging: changed

req.oncomplete = function oncomplete(err, addresses) {
        getaddrinfo_complete(err, addresses, cb);
    }

to

req.oncomplete = function oncomplete(err, addresses) {
    	if(addresses == null) return;
        getaddrinfo_complete(err, addresses, cb);
    }

As addresses were coming null... it works now, but I am a little confused with that code there... investigating :)

tachyon-ops avatar Oct 23 '17 06:10 tachyon-ops

ok... node_modules/mdns/lib/resolver_sequence_tasks.js Line 112, changing from cb(errnoException(err, 'getaddrinfo')); to cb(undefined, []); made my ip appear again.

tachyon-ops avatar Oct 23 '17 08:10 tachyon-ops