Skip to content

Windows WSL: "cannot unmarshal DNS message" - sync fails #4984

Closed

Description

@black-snow

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

Activity

  1. black-snow commented on Feb 1, 2021

    @black-snow
    Author

    Works fine on a Debian Buster system. So this is prob. either an issue with Fossa or WSL(2).

  2. ncw commented on Feb 1, 2021

    @ncw
    Member

    Can you try compiling rclone from source? That will use the system resolvers which may give a different result?

  3. black-snow commented on Feb 2, 2021

    @black-snow
    Author

    @ncw

    $ rclone version
    rclone v1.53.4
    - os/arch: linux/amd64
    - go version: go1.15.7
    $ rclone copy sharepoint_test:xxx/xxx ./
    2021/02/02 14:03:17 ERROR : _deploy: Failed to copy: failed to open source object: Get "https://xxx.sharepoint.com/personal/xxx/_layouts/15/download.aspx?UniqueId=1a23...czQybHB5UT0&ApiVersion=2.1": dial tcp: lookup xxx.sharepoint.com on 172.30.32.1:53: cannot unmarshal DNS message
    ...
  4. ncw commented on Feb 2, 2021

    @ncw
    Member

    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

    export GODEBUG=netdns=go    # force pure Go resolver
    export GODEBUG=netdns=cgo   # force cgo resolver
    

    Can you try a different nameserver?

    Can you try updating systemd-resolved (assuming that you are using it).

  5. hstaugaard commented on Feb 3, 2021

    @hstaugaard

    I am also seeing this. Seems to be a WSL problem, as the Windows version, on the same machine, works.

  6. ncw commented on Feb 3, 2021

    @ncw
    Member

    I am also seeing this. Seems to be a WSL problem, as the Windows version, on the same machine, works.

    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

    $ ./host bbc.com 8j98kj93k.org cnn.com
    Looking up "bbc.com"
    - Addr: 151.101.64.81
    - Addr: 151.101.128.81
    - Addr: 151.101.0.81
    - Addr: 151.101.192.81
    - Addr: 2a04:4e42:400::81
    - Addr: 2a04:4e42:600::81
    - Addr: 2a04:4e42::81
    - Addr: 2a04:4e42:200::81
    
    Looking up "8j98kj93k.org"
    - Failed with error: lookup 8j98kj93k.org: No address associated with hostname
    
    Looking up "cnn.com"
    - Addr: 151.101.129.67
    - Addr: 151.101.193.67
    - Addr: 151.101.65.67
    - Addr: 151.101.1.67
    - Addr: 2a04:4e42::323
    - Addr: 2a04:4e42:200::323
    - Addr: 2a04:4e42:600::323
    - Addr: 2a04:4e42:400::323
    

    Can you try it with the troublesome DNS addresses?

    If you find a failing address, does it fail with

    GODEBUG=netdns=go ./host failing.com
    GODEBUG=netdns=cgo ./host failing.com
    

    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.

  7. changed the title [-]"cannot unmarshal DNS message" - sync fails[/-] [+]Windows WSL: "cannot unmarshal DNS message" - sync fails[/+] on Feb 3, 2021
  8. hstaugaard commented on Feb 4, 2021

    @hstaugaard

    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
    
  9. ncw commented on Feb 4, 2021

    @ncw
    Member

    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!)

  10. ncw commented on Feb 6, 2021

    @ncw
    Member

    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?

  11. 16 remaining items

  12. ivandeex commented on Oct 1, 2021

    @ivandeex
    Member

    See detailed ivestigation of go vs native dns resolver at <habr.com>

  13. skeltoh commented on Oct 5, 2021

    @skeltoh

    @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!

  14. modified the milestones: v1.57, v1.58 on Oct 20, 2021
  15. ivandeex commented on Oct 21, 2021

    @ivandeex
    Member

    Better put the netdns=go hack in documentation

  16. ouija commented on Jan 27, 2022

    @ouija

    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.

    1. 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
    
    1. Add evironment settings for Golang to your user's .bashrc file:
    export GOROOT=/usr/local/go
    export GOPATH=$HOME/go
    export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
    
    1. Refresh your terminal or execute the command source ~/.bashrc
    2. Now ensure that your go version is the latest by running go version (should return as go version go1.17.6 linux/amd64 or similar)
    3. Build RCLONE from source (as per https://rclone.org/install):
    git clone https://github.com/rclone/rclone.git
    cd rclone
    go build
    ./rclone version
    
    1. The last command above should indicate that RCLONE is built with latest version and go/linking: dynamic support
    2. If all looks good, copy the built RCLONE execuatble into your local execuatable path:
    sudo cp ./rclone /usr/bin/
    
    1. Now add the GODEBUG enviroment label to your user's .bashrc file as well:
    export GODEBUG=netdns=cgo
    
    1. 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.

  17. modified the milestones: v1.58, v1.59 on Mar 3, 2022
  18. ncw commented on Mar 3, 2022

    @ncw
    Member

    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.

  19. realansgar commented on Mar 9, 2022

    @realansgar
  20. AaronFriel commented on Mar 15, 2022

    @AaronFriel

    😄 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. 🎉

  21. ncw commented on Mar 18, 2022

    @ncw
    Member

    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 :-)

  22. ncw commented on Mar 20, 2022

    @ncw
    Member

    This should be fixed in 1.58 so I'm going to close this issue. If it isn't then ping me here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions