You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows WSL: "cannot unmarshal DNS message" - sync fails #4984
rclone sync won't actually fetch the files. Instead, I receive this:
2021/02/01 11:36:23 ERROR : Local file system at /mnt/f/projects/playground/rclone/tobesynced: not deleting files as there were IO errors
2021/02/01 11:36:23 ERROR : Local file system at /mnt/f/projects/playground/rclone/tobesynced: not deleting directories as there were IO errors
2021/02/01 11:36:23 ERROR : Attempt 1/3 failed with 1 errors and: failed to open source object: Get "https://xxx.sharepoint.com/sites/xyz/download.aspx?UniqueId=5b8d...3VEd2WkNiekVzdz0&ApiVersion=2.1": dial tcp: lookup xxx.sharepoint.com on 123.123.123.123:53: cannot unmarshal DNS message
I can ping xxx.sharepoint.com just fine and I can also just download the file by using the exact URL rsync outputs in my browser.
What is your rclone version (output from rclone version)
rclone v1.53.4
- os/arch: linux/amd64
- go version: go1.15.7
Running in Ubuntu Fossa inside WSL2.
Which cloud storage system are you using? (e.g. Google Drive)
MS Sharepoint
The command you were trying to run (e.g. rclone copy /tmp remote:tmp)
That should give enough info for me to report a go bug. If you could provide as much info as you can about your Windows version and WSL version and OS that you are running under it that would be helpful too.
You've tried the beta which means the latest go stable has been tried.
It looks like from that issue that GODEBUG=netdns=cgo is a work-around. However that will need an rclone compiled with CGO which the standard build doesn't do.
If you want to give it a go then you'll need to build it with go build (or make) on a Linux machine (I expect WSL will do). When you've built it rclone version needs to say
go/linking: dynamic
Set the environment variable
export GODEBUG=netdns=cgo
Then try rclone. It might work without the GODEBUG as well.
I was testing RCLONE with WSL2 today and connection with a SharePoint client, and figured I'd reply with the exact steps that I took in order to get this working properly, as there were a few minor hurdles I ran into while trying to figure this out.
Ensure you have the latest version of Golang installed in WSL (do NOT install from the apt repository as this version is too old)
wget https://dl.google.com/go/go1.17.6.linux-amd64.tar.gz
sudo tar -xvf go1.17.6.linux-amd64.tar.gz
sudo mv go /usr/local
Add evironment settings for Golang to your user's .bashrc file:
git clone https://github.com/rclone/rclone.git
cd rclone
go build
./rclone version
The last command above should indicate that RCLONE is built with latest version and go/linking: dynamic support
If all looks good, copy the built RCLONE execuatble into your local execuatable path:
sudo cp ./rclone /usr/bin/
Now add the GODEBUG enviroment label to your user's .bashrc file as well:
export GODEBUG=netdns=cgo
Refresh your terminal or execute the command source ~/.bashrc and now RCLONE should work properly with WSL2 without this cannot unmarshal DNS message error message!
Now you can remove all source files and such and are good to go. Hope this helps anyone trying to achieve the same thing.
😄 I was just about to share that I'd root caused this and worked with the Go team to ensure this was merged & backported: golang/go#51127
I'm going through and finding GitHub issues where people have reported "cannot unmarshal DNS" and saw this. Awesome to see this fix already making its way out to people. 🎉
I've finally managed to build the latest beta with go1.17.8 (there was a problem with action/setup-go here which needed fixing actions/setup-go#205 and that in turn needed this fix f8073a7 and finally github actions was down yesterday!).
So if everyone who is having a problem with this issue could give the beta a test that would be great. I'm going to release 1.58 today hopefully so you can test that instead if you prefer.
Activity
black-snow commentedon Feb 1, 2021
Works fine on a Debian Buster system. So this is prob. either an issue with Fossa or WSL(2).
ncw commentedon Feb 1, 2021
Can you try compiling rclone from source? That will use the system resolvers which may give a different result?
black-snow commentedon Feb 2, 2021
@ncw
ncw commentedon Feb 2, 2021
This has come up in various places before - this go issue suggests that the problem might be in systemd-resolved.
With your self compiled go binary can you try these flags, one at a time
Can you try a different nameserver?
Can you try updating systemd-resolved (assuming that you are using it).
hstaugaard commentedon Feb 3, 2021
I am also seeing this. Seems to be a WSL problem, as the Windows version, on the same machine, works.
ncw commentedon Feb 3, 2021
Interesting...
I've attached a little go program (with a linux/amd64 build) which resolves hostnames
host.zip
Unpack the zip and use it like this
Can you try it with the troublesome DNS addresses?
If you find a failing address, does it fail with
That should give enough info for me to report a go bug. If you could provide as much info as you can about your Windows version and WSL version and OS that you are running under it that would be helpful too.
[-]"cannot unmarshal DNS message" - sync fails[/-][+]Windows WSL: "cannot unmarshal DNS message" - sync fails[/+]hstaugaard commentedon Feb 4, 2021
I'm running Microsoft Windows [Version 10.0.19042.746], WSL2 with Ubuntu 20.04
ncw commentedon Feb 4, 2021
Thanks for testing.
So you should find that running rclone you compiled yourself works with GODEBUG=netdns=cgo
Tomorrow I'll try to replicate the problem (not at desk right now!)
ncw commentedon Feb 6, 2021
I can't replicate the problem on my linux machines, so I think, as you said, this must be Windows WSL2 specific somehow
I have reported this upstream here: golang/go#44135
Can you @hstaugaard and @black-snow respond to queries on that issue if more tests are needed running under WSL2?
16 remaining items
ivandeex commentedon Oct 1, 2021
See detailed ivestigation of go vs native dns resolver at <habr.com>
skeltoh commentedon Oct 5, 2021
This solution worked, thanks!
ivandeex commentedon Oct 21, 2021
Better put the
netdns=gohack in documentationouija commentedon Jan 27, 2022
I was testing RCLONE with WSL2 today and connection with a SharePoint client, and figured I'd reply with the exact steps that I took in order to get this working properly, as there were a few minor hurdles I ran into while trying to figure this out.
Golanginstalled in WSL (do NOT install from the apt repository as this version is too old)Golangto your user's.bashrcfile:source ~/.bashrcgo version(should return asgo version go1.17.6 linux/amd64or similar)go/linking: dynamicsupportGODEBUGenviroment label to your user's.bashrcfile as well:source ~/.bashrcand now RCLONE should work properly with WSL2 without this cannot unmarshal DNS message error message!Now you can remove all source files and such and are good to go. Hope this helps anyone trying to achieve the same thing.
ncw commentedon Mar 3, 2022
It looks like this problem will be resolved in go1.18 - see golang/go#51127
This will most likely be for rclone 1.59 as go1.18 isn't quite released yet.
realansgar commentedon Mar 9, 2022
This problem is already resolved in the backported go1.17.8, released on 3/3/22. rclone built with this version should resolve the issue, See:
AaronFriel commentedon Mar 15, 2022
😄 I was just about to share that I'd root caused this and worked with the Go team to ensure this was merged & backported: golang/go#51127
I'm going through and finding GitHub issues where people have reported "cannot unmarshal DNS" and saw this. Awesome to see this fix already making its way out to people. 🎉
ncw commentedon Mar 18, 2022
I've finally managed to build the latest beta with go1.17.8 (there was a problem with action/setup-go here which needed fixing actions/setup-go#205 and that in turn needed this fix f8073a7 and finally github actions was down yesterday!).
So if everyone who is having a problem with this issue could give the beta a test that would be great. I'm going to release 1.58 today hopefully so you can test that instead if you prefer.
@AaronFriel thank you for your work on this :-)
ncw commentedon Mar 20, 2022
This should be fixed in 1.58 so I'm going to close this issue. If it isn't then ping me here!