This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
http.get fails on Android and FreeBSD #8540
Closed
Description
Hi,
when making a simple http request I'm getting the following error:
Error: getaddrinfo EAI_BADFLAGS at Object.exports._errnoException (util.js:742:11) at errnoException (dns.js:46:15) at Object.onlookup [as oncomplete] (dns.js:91:26)
Did a few tests and tried to follow the error through the code, but at this point all I can say is that I'm lost. Any ideas? As usually, I'll be happy to help on fixing this.
Resulting object from calling http.get can be found here
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
brendanashworth commentedon Oct 15, 2014
What code are you running that gives you this error?
javihernandez commentedon Oct 15, 2014
@brendanashworth,
I'm running:
I'm just making a simple http request, something like:
http.get("www.google.com", function(a,b,c) {});
Hope this answers to your question.
Also, I checked if cares.getaddrinfo was failing but it's not. It seems to be a problem elsewhere but I'm not experienced enough to diagnose the offending code. :/
brendanashworth commentedon Oct 16, 2014
Some suggestions of mine:
v0.13.0-pre
, do you mean another version?Note the use of
https
, nothttp
as Google redirects tohttps
anyways.javihernandez commentedon Oct 16, 2014
@brendanashworth,
$ ./node --version v0.13.0-pre
I previously tried with https, same problem.
misterdjules commentedon Oct 16, 2014
@javihernandez Could you please try with a build from the v0.12 branch? Some fixes that are in this branch have not yet been ported to master.
Also, your issue seems like Node.js doesn't pass the right flags to
getaddrinfo
, or that the flags it passes are not supported on your platform. Could you please tell us what flags are supported by Android forgetaddrinfo
?hertzg commentedon Oct 17, 2014
Maybe this is an emulator issue?
https://groups.google.com/forum/#!topic/android-developers/sEU32CfE-eE
javihernandez commentedon Oct 17, 2014
thanks for commenting :)
@hertzg, nope, real device
@misterdjules, good point.
Switched to 0.12 branch, fixed a v8-related build error (perhaps it's worth to be reported) and finally got it building well, BUT, still getting the same error.
So yes, seems to be a problem with
getaddrinfo
's flags. I'll try to find out which flags are supported.misterdjules commentedon Nov 14, 2014
@javihernandez Did you have some time to investigate what
getaddrinfo
flags are supported on Android?javihernandez commentedon Nov 14, 2014
Hey @misterdjules,
not really (been quite busy at work), but a quick search gave me the following:
and just below we can see ...
Any hint about how/where this should be addressed?
javihernandez commentedon Dec 3, 2014
up
josser commentedon Feb 11, 2015
Very similar issue on freebsd 10:
Code:
man 3 getaddrinfo https://gist.github.com/josser/ccad69a7c767aa0d3159
node --version
v0.12.0
josser commentedon Feb 11, 2015
Also, I don't have such error on OS X, but it have a bit more extended list of AI_FLAGS:
Additional flags which I found in os x but didn't find in freebsd:
AI_ALL If the AI_ALL bit is set with the AI_V4MAPPED bit, then getaddrinfo() shall return all matching IPv6 and IPv4 addresses. The AI_ALL bit without the AI_V4MAPPED bit is ignored.
AI_V4MAPPED If the AI_V4MAPPED flag is specified along with an ai_family of AF_INET6, then getaddrinfo() shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( ai_addrlen shall be 16). The AI_V4MAPPED flag shall be ignored unless ai_family equals AF_INET6.
52 remaining items