rclone: Windows WSL: "cannot unmarshal DNS message" - sync fails

What is the problem you are having with rclone?

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)

rclone sync -i "sharepoint:path/to/folder" ./tobesynced/

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

Nothing new here.

2021/02/01 11:41:50 DEBUG : rclone: Version "v1.53.4" starting with parameters ["rclone" "sync" "-vv" "-i" "sharepoint:/xyz" "./tobesynced/"]
2021/02/01 11:41:50 DEBUG : Using config file from "/home/xxx/.config/rclone/rclone.conf"
2021/02/01 11:41:50 DEBUG : Creating backend with remote "sharepoint:/xyz"
2021/02/01 11:41:51 DEBUG : Creating backend with remote "./tobesynced/"
2021/02/01 11:41:51 DEBUG : fs cache: renaming cache item "./tobesynced/" to be canonical "/mnt/f/projects/playground/rclone/tobesynced"
...

rest as above

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (15 by maintainers)

Most upvoted comments

@skeltoh This needs a fix in the go stdlib for which there is an issue here https://github.com/golang/go/issues/44135

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 just about to share that I’d root caused this and worked with the Go team to ensure this was merged & backported: https://github.com/golang/go/issues/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. 🎉

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:

@skeltoh This needs a fix in the go stdlib for which there is an issue here golang/go#44135

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.

This solution worked, thanks!

I’m running Microsoft Windows [Version 10.0.19042.746], WSL2 with Ubuntu 20.04

$ ./host  prevasonline.sharepoint.com
Looking up "prevasonline.sharepoint.com"
- Failed with error: lookup prevasonline.sharepoint.com on 172.29.224.1:53: cannot unmarshal DNS message

$ GODEBUG=netdns=go ./host prevasonline.sharepoint.com
Looking up "prevasonline.sharepoint.com"
- Failed with error: lookup prevasonline.sharepoint.com on 172.29.224.1:53: cannot unmarshal DNS message

$ GODEBUG=netdns=cgo ./host prevasonline.sharepoint.com
Looking up "prevasonline.sharepoint.com"
- Addr: 13.107.136.9