[GODRIVER-829] Go 1.11 LookupSRV cannot unmarshal DNS message Created: 13/Feb/19 Updated: 27/Oct/23 Resolved: 11/Apr/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Connections |
| Affects Version/s: | 0.3.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Wan Bachtiar | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
go1.11.5 |
||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Connecting to MongoDB using connection URI SRV in Go v1.11 generates an error: cannot unmarshal DNS message. The following code works in Go v1.10 but not in Go v1.11:
Also, the same code above works with non-SRV URI in Go v1.11. This looks to be related to the change in the net package: https://github.com/golang/go/issues/10622 The call below would work in Go v1.10 but failed in Go v1.11:
|
| Comments |
| Comment by Bagus Prasetyo [ 17/Jun/20 ] | |||||||||||||||||||||||||||||||||
|
I still get same problem : code :
return :
Specs:
| |||||||||||||||||||||||||||||||||
| Comment by Syed Gillani [ 29/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi Wan, According to my understanding, the docker container copies the DNS properties from the host on startup. However, it was not the case and I had to manually set the DNS while running the container. Thanks for looking into it and it worked with the proposed changes. I believe that there should be a fix of it at client level.
Syed | |||||||||||||||||||||||||||||||||
| Comment by Wan Bachtiar [ 29/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi syd, The `/etc/resolv.conf` that you posted is from your macOS (the Docker host). What you need to update is the `/etc/resolv.conf` within your Docker container that runs your Go application. | |||||||||||||||||||||||||||||||||
| Comment by Syed Gillani [ 28/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi Jeff, Following is the content of my `/etc/resolv.conf` file:
| |||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 27/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
That does look like the same error. What DNS server do you have configured in /etc/resolv.conf? | |||||||||||||||||||||||||||||||||
| Comment by Syed Gillani [ 27/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi Jeff,
Following is the error after the docker build:
| |||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 27/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi Syed, Please post the specific error message you're seeing. It must be a different issue that you're encountering, or else you're doing something subtly different than wan.bachtiar. | |||||||||||||||||||||||||||||||||
| Comment by Syed Gillani [ 27/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi Jeff, I've already tried the suggested workaround from Wan but It didn't resolve my issue.
| |||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 26/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
syd, please see wan.bachtiar's comment from March 15 on this issue. He provides a workaround to the problem. | |||||||||||||||||||||||||||||||||
| Comment by Syed Gillani [ 26/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Is there any update on this issue? I'm having the same issue with the docker!!
| |||||||||||||||||||||||||||||||||
| Comment by ollevche [ 15/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
No, im not using docker. It's ubuntu installed on my machine. Have fixed by replacing DNS server. Thank you! | |||||||||||||||||||||||||||||||||
| Comment by Wan Bachtiar [ 15/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
I could reproduce this in Docker with Ubuntu 18.04 instance, but not in macOS. To reproduce this, I have attached a Dockerfile for the code snippet above. Dockerfile After looking into my issue further, it seems to be a combination of two things. The first one being the Docker DNS server and the second one being the change of SRV resolver in go1.11 (So I think is no longer relevant for this issue to be in MongoDB Go driver). The solution is to replace the `nameserver` in `/etc/resolv.conf` to a public DNS server i.e. `1.1.1.1` or `8.8.8.8`. | |||||||||||||||||||||||||||||||||
| Comment by ollevche [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
What do you think it is fixed in Go 1.12? I can test in ~20 hours and post the results | |||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Looking for Go platform-related issues, and found: https://github.com/golang/go/issues/27546. | |||||||||||||||||||||||||||||||||
| Comment by ollevche [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
I have faced it with Go v1.11.5 but haven't tried with Go v1.10 | |||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi ollevche, Can you also not reproduce this using Go v1.10? | |||||||||||||||||||||||||||||||||
| Comment by ollevche [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
I'm on ubuntu 18.04 | |||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Hi wan.bachtiar, can you help us to reproduce this? We were unable to do so on on OS X Mojave. | |||||||||||||||||||||||||||||||||
| Comment by ollevche [ 14/Mar/19 ] | |||||||||||||||||||||||||||||||||
|
Had the same issue with the latest driver version (1.0.0) and Go 1.11.5. Can we hope for a fix? | |||||||||||||||||||||||||||||||||
| Comment by Isabella Siu (Inactive) [ 22/Feb/19 ] | |||||||||||||||||||||||||||||||||
|
Hi wan.bachtiar, I tried these with Go 1.11.5 and the most recent version of the driver, and I wasn't able to get them to reproduce. Is this still a problem? |