Unable to copy files to or from OneDrive using only IPV6 on Ubuntu

What is the problem you are having with rclone?

Unable to copy to/from OneDrive when using IPV6 exclusively from an Amazon EC2 Ubuntu instance. File listings do work (the ls command) which go to api.onedrive.com but getting files accesses domain 1slsvq.bl.files.1drv.com which resolves to an IPV4 address. If I enable IPV4 then the process works. Using Google Drive works when using IPV6, but not OneDrive.

Run the command 'rclone version' and share the full output of the command.

rclone v1.66.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.5.0-1014-aws (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.1
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

OneDrive Personal

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone -vv copy onedrive:dev/CloudSync/test.txt . --ignore-size --user-agent "ISV|rclone.org|rclone/v1.66.0" --low-level-retries 1

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[onedrive]
type = onedrive
token = XXX
drive_id = XXX
drive_type = personal

A log from the command that you were trying to run with the -vv flag

2024/03/19 12:55:44 DEBUG : rclone: Version "v1.66.0" starting with parameters ["rclone-v1.66.0-linux-amd64/rclone" "-vv" "copy" "onedrive:dev/CloudSync/test.txt" "." "--ignore-size" "--user-agent" "ISV|rclone.org|rclone/v1.66.0" "--low-level-retries" "1"]
2024/03/19 12:55:44 DEBUG : Creating backend with remote "onedrive:dev/CloudSync/test.txt"
2024/03/19 12:55:44 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2024/03/19 12:55:44 DEBUG : fs cache: adding new entry for parent of "onedrive:dev/CloudSync/test.txt", "onedrive:dev/CloudSync"
2024/03/19 12:55:44 DEBUG : Creating backend with remote "."
2024/03/19 12:55:44 DEBUG : fs cache: renaming cache item "." to be canonical "/home/ubuntu"
2024/03/19 12:55:44 DEBUG : test.txt: Need to transfer - File not found at Destination
2024/03/19 12:56:44 INFO  : 
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Transferred:            0 / 1, 0%
Elapsed time:       1m0.6s
Transferring:
 *                                      test.txt: transferring

2024/03/19 12:56:44 DEBUG : pacer: low level retry 1/1 (error Get "https://1slsvq.bl.files.1drv.com/{long-potentially-secret-url-sequence}/test.txt": dial tcp 13.107.42.12:443: i/o timeout)
2024/03/19 12:56:44 DEBUG : pacer: Rate limited, increasing sleep to 20ms
2024/03/19 12:56:44 DEBUG : test.txt: Received error: failed to open source object: Get "https://1slsvq.bl.files.1drv.com/{long-potentially-secret-url-sequence}/test.txt": dial tcp 13.107.42.12:443: i/o timeout - low level retry 0/1
2024/03/19 12:56:44 ERROR : test.txt: Failed to copy: failed to open source object: Get "https://1slsvq.bl.files.1drv.com/{long-potentially-secret-url-sequence}/test.txt": dial tcp 13.107.42.12:443: i/o timeout
2024/03/19 12:56:44 ERROR : Attempt 1/3 failed with 1 errors and: failed to open source object: Get "https://1slsvq.bl.files.1drv.com/{long-potentially-secret-url-sequence}/test.txt": dial tcp 13.107.42.12:443: i/o timeout
2024/03/19 12:56:45 DEBUG : pacer: Reducing sleep to 15ms

Try --bind flag:

--bind ::0

I tried the --bind ::0 command and it failed but failed much faster. The lookup gave a no such host response resolving 1slsvq.bl.files.1drv.com. I wonder if OneDrive requires a different endpoint for IPV6 like S3 does? Here is the log output:

ERROR : Attempt 1/3 failed with 1 errors and: failed to open source object: Get "https://1slsvq.bl.files.1drv.com/{long_url_reference}/test.txt": dial tcp6: lookup 1slsvq.bl.files.1drv.com on 127.0.0.53:53: no such host

Yeap - now it looks like clear cut.

Any reason to use IPv6 only? I think it is not there yet in general.

Pure IPv6 setup does not work nowadays but some limited cases - as your example shows.

You would not reach my small server I run neither. This is how it is. Interesting that BIG Microsoft server is not reachable neither.

The resolver on your system is only returning a IPV4 for that lookup.

If it doesn't give you an IPV6, you can't trick/fix/make rclone use IPV4 since there isn't a host given.

That host only has IPV4 to resolve to:

ost 1slsvq.bl.files.1drv.com
1slsvq.bl.files.1drv.com is an alias for bl-files.fe.1drv.com.
bl-files.fe.1drv.com is an alias for odc-bl-files-geo.onedrive.akadns.net.
odc-bl-files-geo.onedrive.akadns.net is an alias for odc-bl-files-brs.onedrive.akadns.net.
odc-bl-files-brs.onedrive.akadns.net is an alias for bl-files.ha.1drv.com.l-0003.dc-msedge.net.l-0003.l-msedge.net.
bl-files.ha.1drv.com.l-0003.dc-msedge.net.l-0003.l-msedge.net is an alias for l-0003.l-msedge.net.
l-0003.l-msedge.net has address 13.107.42.12

Something with IPV6 returning:

host google.com
google.com has address 142.251.35.174
google.com has IPv6 address 2607:f8b0:4006:81e::200e
google.com mail is handled by 10 smtp.google.com.

So your OS asks for an IP for the name, it only gets IPV4 and you have IPV4 off so it won't ever connect as you have nothing to 'dial'.

Was attempting to use IPV6 only since Amazon AWS started charging a fee for each IPV4 address. Have gotten it to work with IPV6 only on Amazon S3 and Google Drive/Photos but not OneDrive. No other reason than to save $43/year which is more than I was paying for my instance that was running my cloud-to-cloud backups.

Ta for explanation. It is is very interesting lesson here.

My solution until OneDrive supports IPV6 fully is to use EC2 API calls to create/associate an IPV4 address prior to running rclone, then release it when rclone finishes. That way I just pay for it while it is needed. Thanks to all for looking into the issue.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.