-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Return {error,{conn_failed,{error,econnrefused}}} on master #162
Comments
see #159 We've just hit this after upgrading to After that change in 555f707, ibrowse now prefers the ipv6 address The problem goes away if we use The problem goes away if you remove the |
It's probably important to note I am seeing this behaviour in MacOS 10.13.6 |
I've been able to hit this bug after updating to |
I'm also seeing something somewhat similar. After updating to 4.4.1 we started seeing connection failures of the form I think PR #155 is incomplete, in that it uses the availability of an IPv6 address to decide what to do. A host being resolvable as IPv6 doesn't guarantee it being routable. So that change breaks things for people with IPv4 only connectivity; connections fail and AFAIK there's not a great workaround for it. Reverting the PR isn't appealing; I don't want to break IPv6 only environments either. So we need some kind of fix. I'm willing to take a shot at it, and a couple of options occur to me.
Thoughts? Here's the debugging to support my theory of what's going on. First, a little bit of poking with redbug reveals that we're using the inet6 option for sockets:
Removing the inet6 option makes the call suceed
As you might expect, this option is set because the gethostbyname call returns an ipv6 address
So it looks like we can connect to jigsaw via v4, but not v6. To confirm:
|
Same issue here, reverting back to 4.4.0 solves the issue for me: Any request I try to make always return |
Thanks for all the bug reports. I think option (2) suggested by @markan is the best way forward. I'll try and come up with an emergency patch. |
I think to preserve backwards compatibility, I will add an option 'prefer_ipv6'. If this is not supplied, it will default to using ipv4. |
default to ipv4 would be great @cmullaparthi thanks! |
I've pushed a commit to master. I meant to push it to a branch for everyone to try but fat fingers... Default behaviour without any options specified and connecting to a IPv4 host 11> ibrowse:send_req("http://ipv4.test-ipv6.noroutetohost.net/", [], get, [], []).
(<0.221.0>) call gen_tcp:connect("ipv4.test-ipv6.noroutetohost.net",80,[{nodelay,true},binary,{active,false}],30000) ({ibrowse_http_client,
send_req_1,
8})
(<0.221.0>) returned from gen_tcp:connect/4 -> {ok,#Port<0.46206>}
{ok,"200",
[{"Date","Fri, 21 Sep 2018 06:14:34 GMT"},
{"Server","Apache/2.4.25"},
{"Content-Location","index.html.en_US"},
{"Vary","negotiate,accept-language,accept-encoding"},
{"TCN","choice"},
{"Last-Modified","Fri, 21 Sep 2018 03:36:59 GMT"},
{"ETag","\"576595a1f3bd3\""},
{"Accept-Ranges","bytes"},
{"Content-Length","30935"},
{"Content-Type","text/html; charset=utf-8"},
{"Content-Language","en-us"}],
... Default behaviour without any options specified and connecting to a IPv6 host 12> ibrowse:send_req("http://ipv6.test-ipv6.noroutetohost.net/", [], get, [], []).
{error,{conn_failed,{error,nxdomain}}} Behaviour with the new option to prefer IPv6 specified and connecting to a IPv6 host 13> ibrowse:send_req("http://ipv6.test-ipv6.noroutetohost.net/", [], get, [], [{prefer_ipv6, true}]).
(<0.218.0>) call gen_tcp:connect("ipv6.test-ipv6.noroutetohost.net",80,[{nodelay,true},binary,{active,false},inet6],30000) ({ibrowse_http_client,
send_req_1,
8})
(<0.218.0>) returned from gen_tcp:connect/4 -> {ok,#Port<0.46205>}
{ok,"200",
[{"Date","Fri, 21 Sep 2018 06:12:11 GMT"},
{"Server","Apache/2.4.25"},
{"Content-Location","index.html.en_US"},
{"Vary","negotiate,accept-language,accept-encoding"},
{"TCN","choice"},
{"Last-Modified","Fri, 21 Sep 2018 03:36:59 GMT"},
{"ETag","\"576595a1f3bd3\""},
{"Accept-Ranges","bytes"},
{"Content-Length","30935"},
{"Content-Type","text/html; charset=utf-8"},
{"Content-Language","en-us"}],
... |
Any news on this ticket? |
Not that I'm aware of. We moved on to a different HTTP client. |
I noticed that on latest master if there is a web server running on the local machine:
But calling it with 127.0.0.1 host instead would work fine.
This same behaviour is not reproducible on v4.4.0.
The text was updated successfully, but these errors were encountered: