-
Notifications
You must be signed in to change notification settings - Fork 7.3k
http.get fails on Android and FreeBSD #8540
Comments
What code are you running that gives you this error? |
I'm running:
I'm just making a simple http request, something like: 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. :/ |
Some suggestions of mine:
https.get('https://google.com', function() {}); Note the use of |
$ ./node --version
v0.13.0-pre
I previously tried with https, same problem. |
@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 |
Maybe this is an emulator issue? https://groups.google.com/forum/#!topic/android-developers/sEU32CfE-eE |
thanks for commenting :) @hertzg, nope, real device @misterdjules, good point. |
@javihernandez Did you have some time to investigate what |
Hey @misterdjules, not really (been quite busy at work), but a quick search gave me the following: /* * Flag values for getaddrinfo() */ #define AI_PASSIVE 0x00000001 /* get address to use bind() */ #define AI_CANONNAME 0x00000002 /* fill ai_canonname */ #define AI_NUMERICHOST 0x00000004 /* prevent host name resolution */ #define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */ and just below we can see ... /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ AI_ADDRCONFIG) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ #define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */ #define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */ Any hint about how/where this should be addressed? |
up |
Very similar issue on freebsd 10:
Code: http = require('http');
http.get("www.google.com", function(a,b,c) {}); man 3 getaddrinfo https://gist.github.com/josser/ccad69a7c767aa0d3159 node --version |
Also, I don't have such error on OS X, but it have a bit more extended list of AI_FLAGS: 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. |
I have a similar error after updating from node-0.10.35 to 0.12.0 on Freebsd 10.1.
|
Please see the patch, Thanks. |
More background for the issue on FreeBSD here, with the related source change here. nodejs/node@04bea9f seems it would definitely fix this issue, however I'm wondering whether we should fix this in In my opinion the question boils down to: do we want explicit calls to Instead, we could remove the @joyent/node-coreteam Thoughts? |
That's a possibility, but also an API change. I guess for node that means the patch goes into v0.14.0 |
@piscisaureus I don't understand why it would be an API change, could you please elaborate? The other candidate for a fix I had in mind is available here: https://gist.github.com/misterdjules/8b451749630de0b17218. In my opinion, this is a behavior change that only affects a single platform where the previous behavior is not available and fails all the time, so I would qualify it as a bug fix, but I may be missing something. Also, again to make sure we're on the same page, if https://gist.github.com/misterdjules/8b451749630de0b17218 qualifies as a breaking API change, then my understanding is that nodejs/node@04bea9f would also be considered as a breaking change. Thanks! |
@misterdjules |
I'm working from memory here but Fedor's patch disables AI_V4MAPPED iff it's not an AAAA query and the platform is FreeBSD. Julien's patch looks wrong to me because it disables it unconditionally on FreeBSD, regardless of the query type. Side note: OpenBSD doesn't support AI_V4MAPPED at all, see nodejs/node@ca039b4. |
@bnoordhuis Ok, based on this post: http://lists.freebsd.org/pipermail/freebsd-bugs/2008-February/028260.html, I thought FreeBSD also did not support It seems that the code example in this message does an AAAA query with |
That mailing list post is about FreeBSD 7, which is ancient. io.js's minimum requirement is FreeBSD 10 and that seems to support AI_V4MAPPED fine for AAAA queries. |
I think we better remove this flag at the query time since V4MAPPED is On Monday, March 2, 2015, Ben Noordhuis notifications@github.com wrote:
|
I had some more time to continue my investigations. So it seems that FreeBSD 10.1 does not support
which is also reflected in the behavior of latest io.js when using
So as I understand it, nodejs/node@04bea9f does not fix So it seems to me we have several different ways to fix this problem:
@joyent/node-coreteam We need to make a decision and I want your input on this. My preference goes to 1 because it fixes the most common use case and it doesn't fail silently for the other explicit |
1 sounds good |
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes nodejs#8540.
@trevnorris Thank you for the feedback, created #18204. |
Downgrading to P-2 since it seems to be fixed in FreeBSD ports. |
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes nodejs#8540 and nodejs#9204.
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes nodejs#8540 and nodejs#9204.
Fixed by 0e392f3, thank you everyone! |
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: nodejs#1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1. Thus, do not set this flag in net.connect on FreeBSD. Fixes: nodejs/node-v0.x-archive#8540 Fixes: nodejs/node-v0.x-archive#9204 PR-URL: nodejs/node-v0.x-archive#18204 PR-URL: #1555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Hi,
when making a simple http request I'm getting the following error:
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
The text was updated successfully, but these errors were encountered: