Connect: cannot assign requested address (onedrive)

What is the problem you are having with rclone?

Hi everyone, I've had quite some problems trying to migrate a large group of files between two mounted drives (both with onedrive): when I run the command, it attemps it 3 times and returns me the error: Failed to copy: couldn't list files: Get "https://graph.microsoft.com/v1.0/drives/driveid": dial tcp [xxxx:xxxx:xxxx:xx::xx]:xxx: connect: cannot assign requested address (there are some parts changed due to privacy issues)

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

rclone v1.63.1
- os/version: debian 11.7 (64 bit)
- os/kernel: 6.1.21-v8+ (aarch64)
- os/type: linux
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.20.6
- go/linking: static
- go/tags: none

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

Onedrive

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

rclone copy -vP --ignore-existing --transfers 10 "drivename1":"path1/folder1" "drivename2":"path2"

The rclone config contents with secrets removed.

Current remotes:

Name                 Type
====                 ====
KILLER QUEEN         drive
drivename1            onedrive
drivename3            onedrive
drivename2            onedrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> 

(ignore the other 2 drives, there are not included in this problem)

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

Paste  log here

(I can't copy all the debug )

I've tried the same command in another windows pc and it works perfectly. I also tried to disable IPv6, but anything seems to work.

Thank you in advance for your help.

It is not really rclone problem but your computer environment networking.

Trying IPv4 only is good approach as similar issues are often caused by misconfigured IPv6 setup (can be your computer, your router, your ISP - or any mix of it).

There were some issues with --bind 0.0.0.0 flag before, only fixed recently so I suggest try the latest v1.64 beta:

sudo -v ; curl https://rclone.org/install.sh | sudo bash -s beta

and --bind 0.0.0.0 flag.

I updated it with rclone selfupdate --beta because it didn't work with the other command.

Unfortunately, when trying to copy the files again with the --bind 0.0.0.0 flag, it returns me this error:

Failed to copy: couldn't list files: Get "https://graph.microsoft.com/v1.0/drives/driveid/items/driveid/children?$top=1000": dial tcp4: lookup graph.microsoft.com on 192.168.1.1:53: no such host

You have problem with networking on your system. can you try ping graph.microsoft.com

Below results from my computer:

$ ping graph.microsoft.com
PING www.tm.prd.ags.akadns.net (40.126.41.96): 56 data bytes
64 bytes from 40.126.41.96: icmp_seq=0 ttl=113 time=32.980 ms
64 bytes from 40.126.41.96: icmp_seq=1 ttl=113 time=44.739 ms
64 bytes from 40.126.41.96: icmp_seq=2 ttl=113 time=42.179 ms
64 bytes from 40.126.41.96: icmp_seq=3 ttl=113 time=37.877 ms

you can also try to have a look at DNS responses:

dig graph.microsoft.com
dig graph.microsoft.com @1.1.1.1

Using ping graph.microsoft.com:

root@LOLITA:/# ping graph.microsoft.com
PING www.tm.prd.ags.akadns.net (20.190.159.100) 56(84) bytes of data.
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=1 ttl=110 time=33.1 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=2 ttl=110 time=32.1 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=3 ttl=110 time=31.9 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=4 ttl=110 time=50.8 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=5 ttl=110 time=31.9 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=6 ttl=110 time=32.5 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=7 ttl=110 time=31.9 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=8 ttl=110 time=32.2 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=9 ttl=110 time=32.2 ms
64 bytes from 20.190.159.100 (20.190.159.100): icmp_seq=10 ttl=110 time=32.2 ms
^C
--- www.tm.prd.ags.akadns.net ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9014ms
rtt min/avg/max/mdev = 31.886/34.079/50.805/5.584 ms

Using dig graph.microsoft.com:

; <<>> DiG 9.16.42-Debian <<>> graph.microsoft.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12734
;; flags: qr rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;graph.microsoft.com.		IN	A

;; ANSWER SECTION:
graph.microsoft.com.	13108	IN	CNAME	ags.privatelink.msidentity.com.
ags.privatelink.msidentity.com.	135 IN	CNAME	www.tm.prd.ags.akadns.net.
www.tm.prd.ags.akadns.net. 170	IN	A	20.190.159.161
www.tm.prd.ags.akadns.net. 170	IN	A	20.190.159.31
www.tm.prd.ags.akadns.net. 170	IN	A	20.190.159.32
www.tm.prd.ags.akadns.net. 170	IN	A	20.190.159.33
www.tm.prd.ags.akadns.net. 170	IN	A	40.126.31.163
www.tm.prd.ags.akadns.net. 170	IN	A	40.126.31.98
www.tm.prd.ags.akadns.net. 170	IN	A	20.190.159.100
www.tm.prd.ags.akadns.net. 170	IN	A	40.126.31.164

;; Query time: 8 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Sep 05 13:59:48 CEST 2023
;; MSG SIZE  rcvd: 256

Using dig graph.microsoft.com @1.1.1.1:

; <<>> DiG 9.16.42-Debian <<>> graph.microsoft.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32153
;; flags: qr rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;graph.microsoft.com.		IN	A

;; ANSWER SECTION:
graph.microsoft.com.	14262	IN	CNAME	ags.privatelink.msidentity.com.
ags.privatelink.msidentity.com.	162 IN	CNAME	www.tm.prd.ags.akadns.net.
www.tm.prd.ags.akadns.net. 162	IN	A	20.190.159.99
www.tm.prd.ags.akadns.net. 162	IN	A	20.190.159.162
www.tm.prd.ags.akadns.net. 162	IN	A	40.126.31.163
www.tm.prd.ags.akadns.net. 162	IN	A	20.190.159.31
www.tm.prd.ags.akadns.net. 162	IN	A	20.190.159.33
www.tm.prd.ags.akadns.net. 162	IN	A	20.190.159.100
www.tm.prd.ags.akadns.net. 162	IN	A	40.126.31.98
www.tm.prd.ags.akadns.net. 162	IN	A	20.190.159.161

;; Query time: 8 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Sep 05 14:02:23 CEST 2023
;; MSG SIZE  rcvd: 256

OK - looks good

and what about now:

rclone lsd drivename1: -vv

Here you have:

<7>DEBUG : rclone: Version "v1.64.0-beta.7323.ddc7059a7" starting with parameters ["rclone" "lsd" "drivename1:" "-vv"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "drivename1:"
<7>DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
          -1 2023-08-05 09:39:45        28 folder1
          -1 2023-06-02 20:08:01         0 folder2
          -1 2023-07-05 14:30:24         6 folder3
<7>DEBUG : 7 go routines active

and your copy command works now too?

nope, it keeps me getting the same errors

192.168.1.1 has a working dns server listening on port 53?

It looks that yes....

I don't know what else to do. Do you know, at least, some similar problems to look up?

not sure, but these issues seem to be network, not rclone
first error was dhcp, second error was dns.

for testing, perhaps
stop using 192.168.1.1:53
and/or
run a local dns server, such as https://dnscrypt.info/

I would try extremely throttled command:

rclone copy -vP --ignore-existing --checkers 1 --transfers 1 --tpslimit 1 --tpslimit-burst 0 "drivename1":"path1/folder1" "drivename2":"path2"

interesting if it works.

Also try to disable any antivirus programs if you use any.

Wait... if it has something to do with setting a local DNS, I've set one with duckdns for hosting a vpn server and stuff on my rpi. If that's the case, how can I change the IP 192.168.1.1:53?

the internet is full of howto guides for linux

Tell you what... it works perfectly. However, and as expected, it goes way more slower.

I'll have a look

ok, good!
what is it, what did you change to get it to work perfectly

so something in all processing path breaks when going faster...

Errors you encountered clearly point into some network issues but I am not sure what it can be. Definitely worth to try different DNS - 1.1.1.1 and 9.9.9.9 are ones I always configure.