Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Can't use localhost in Dial (Go v1.5) #153
Comments
ryanfaerman
commented
Aug 20, 2015
|
|
|
Thanks for the notice. Will have a look. |
|
I have the same bug on a Docker container running Ubuntu 12.04. What's curious is that it works fine when I create an SSH tunnel to a remote Mongo instance. |
kgdev
commented
Aug 21, 2015
|
+1 |
|
I looked a little into this bug: Since MongoDB disables ipv6 support by default the connection fails with Go 1.5.
Should I do a PR? |
|
If you can do that in the next couple of hours, that would be welcome. Otherwise I will have to look into it. For background on that unusual resolver, Go doesn't support timeouts on address resolution, so that's an attempt to workaround it. More details in that upstream issue: |
|
I don't see any easy fix. I would change the dial to be udp4 in resolveAddr and add an IPv6 bool to DialInfo to do a udp or udp6 dial when it is true. It would only break for users that enabled ipv6 in Mongo and use an IPv6 address in the net.bindIp setting. But I guess there are not many (if any?) users in this case. |
|
I'll just move into resolving IPv4 only for now.. this will unblock the vast majority of people, until we find the best solution. |
|
|
added a commit
that referenced
this issue
Aug 21, 2015
niemeyer
closed this
Aug 21, 2015
added a commit
that referenced
this issue
Aug 21, 2015
bz2
commented
Sep 1, 2015
|
This change breaks the juju/testing test suite:
|
|
Sorry about that. The proper fix is coming. Will try to land something today or tomorrow. |
|
For the record, another step towards proper IPv6 support is in, and got feedback from @bz2 that it fixed juju's breakage. |
tomponline
commented
Sep 16, 2015
|
This commit broke the mgo driver for our uses, we use IPv6 with named hosts using AAAA records for IPv6 addresses. Since commit d650c4e we have been unable to use the mgo driver and have had to roll back to before that commit. Would it be possible to restore that commit, and add a special case for "locahost" hostnames instead? |
tomponline
referenced this issue
Sep 16, 2015
Closed
Not able to use hostnames with AAAA records #162
|
Sorry for the trouble. It was well known that this particular configuration would break, and I generally don't do such partial fixes, but this is a special case as we had several developers complaining of the breakage with Go 1.5, so we had to take action quickly and that was the short term alternative. We cannot special case localhost because this is just a symptom, not the actual issue. The real problem is that the resolution behavior has changed in 1.5, and thus I did a fix to bring back the correctness of IPv4 resolution, which is by far the most used, and then started to bring back the correctness of IPv6 resolution. The first step was already done: if you use an IPv6 literal address, it should work fine. I will now fix actual resolution and ping you so you have a chance to test it before it goes live, if that's okay? Let's please move this conversation into the ticket #162 which you opened, as it's more specific to that problem. |
added a commit
that referenced
this issue
Sep 21, 2015
dhrp
commented
Jul 18, 2016
|
I'd like to mention that a similar issue is causing trouble when running go in Docker containers. Since Docker 1.11, Docker no longer writes the host names of linked containers into the /etc/hosts file, but relies on programs to use it's internal DNS server. MGO, when asked to connect to a host like: |
jimtsao commentedAug 20, 2015
Replacing with 127.0.0.1 resolves this.