Cannot list OneDrive

I've encountered the same issue as listed here (found by google) Can not list Onedrive - Help and Support - rclone forum

What is the problem you are having with rclone?

I've created a new config for a OneDrive (personal) remote on a VPS hosted in Germany.
I have re-created this config multiple times and also tried copying my local rclone config file to the VPS and always get the same error.
error listing: couldn't list files: invalidRequest: The item does not reside in the drive

Running the same command on my local laptop in a different country works.
Using the same version of rclone as far as I can tell.
Somehow it appears to try to connect to a different MS service.

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

VPS: ** NOT WORKING **

rclone v1.69.2
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-138-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.2
- go/linking: static
- go/tags: none

local laptop ** working **

rclone v1.69.2
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.167.4-microsoft-standard-WSL2 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.2
- go/linking: static
- go/tags: none

Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads
--> yes

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 lsd od:

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

Enter configuration password:
password:
[od]
type = onedrive
token = XXX
drive_id = XXX
drive_type = personal
### Double check the config for sensitive info before posting publicly

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

VPS: ** NOT WORKING **

remoteuser@vps:~$ rclone --config ./.config/rclone/od.conf lsd od: -vv --dump=headers --retries 1
2025/05/04 23:19:36 NOTICE: Automatically setting -vv as --dump is enabled
2025/05/04 23:19:36 DEBUG : rclone: Version "v1.69.2" starting with parameters ["rclone" "--config" "./.config/rclone/od.conf" "lsd" "od:" "-vv" "--dump=headers" "--retries" "1"]
2025/05/04 23:19:36 DEBUG : Creating backend with remote "od:"
Enter configuration password:
password:
2025/05/04 23:19:39 DEBUG : Using config file from "/home/remoteuser/.config/rclone/od.conf"
2025/05/04 23:19:39 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2025/05/04 23:19:39 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:19:39 DEBUG : HTTP REQUEST (req 0xc0002aef00)
2025/05/04 23:19:39 DEBUG : GET /v1.0/drives/driveIDlowercase/root HTTP/1.1
Host: graph.microsoft.com
User-Agent: rclone/v1.69.2
Authorization: XXXX
Accept-Encoding: gzip

2025/05/04 23:19:39 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:19:40 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:19:40 DEBUG : HTTP RESPONSE (req 0xc0002aef00)
2025/05/04 23:19:40 DEBUG : HTTP/2.0 200 OK
Cache-Control: no-store, no-cache
Client-Request-Id: c07e700f-dc3d-4578-94d9-470806c89fb2
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Sun, 04 May 2025 11:19:39 GMT
Odata-Version: 4.0
Request-Id: c07e700f-dc3d-4578-94d9-470806c89fb2
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"005","RoleInstance":"FR3PEPF000002DA"}}

2025/05/04 23:19:40 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:19:40 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:19:40 DEBUG : HTTP REQUEST (req 0xc0004572c0)
2025/05/04 23:19:40 DEBUG : GET /v1.0/drives/differentIDmixedcaseandspecialcharacters/items/driveIDuppercase!sea8cc6beffdb43d7976fbc7da445c639/children?$top=1000 HTTP/1.1
Host: graph.microsoft.com
User-Agent: rclone/v1.69.2
Authorization: XXXX
Accept-Encoding: gzip

2025/05/04 23:19:40 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:19:40 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:19:40 DEBUG : HTTP RESPONSE (req 0xc0004572c0)
2025/05/04 23:19:40 DEBUG : HTTP/2.0 400 Bad Request
Client-Request-Id: 570990c2-171a-4a70-96a5-9e79df77907a
Content-Type: application/json
Date: Sun, 04 May 2025 11:19:39 GMT
Request-Id: 570990c2-171a-4a70-96a5-9e79df77907a
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"005","RoleInstance":"FR3PEPF000002DA"}}

2025/05/04 23:19:40 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:19:40 ERROR : : error listing: couldn't list files: invalidRequest: The item does not reside in the drive
2025/05/04 23:19:40 DEBUG : 6 go routines active
2025/05/04 23:19:40 NOTICE: Failed to lsd with 2 errors: last error was: couldn't list files: invalidRequest: The item does not reside in the drive

--
local laptop ** working **

localuser@pc:~$ rclone lsd od: -vv --dump=headers
2025/05/04 23:16:54 NOTICE: Automatically setting -vv as --dump is enabled
2025/05/04 23:16:54 DEBUG : rclone: Version "v1.69.2" starting with parameters ["rclone" "lsd" "od:" "-vv" "--dump=headers"]
2025/05/04 23:16:54 DEBUG : Creating backend with remote "od:"
Enter configuration password:
password:
2025/05/04 23:16:59 DEBUG : Using config file from "/home/localuser/.config/rclone/rclone.conf"
2025/05/04 23:16:59 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2025/05/04 23:16:59 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:16:59 DEBUG : HTTP REQUEST (req 0xc0001ca780)
2025/05/04 23:16:59 DEBUG : GET /v1.0/drives/driveIDlowercase/root HTTP/1.1
Host: graph.microsoft.com
User-Agent: rclone/v1.69.2
Authorization: XXXX
Accept-Encoding: gzip

2025/05/04 23:16:59 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:16:59 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:16:59 DEBUG : HTTP RESPONSE (req 0xc0001ca780)
2025/05/04 23:16:59 DEBUG : HTTP/2.0 200 OK
Cache-Control: private
Client-Request-Id: b71b22b8-0c53-4d08-8020-95d6936c8fa4
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Sun, 04 May 2025 11:16:58 GMT
Odata-Version: 4.0
Request-Id: b71b22b8-0c53-4d08-8020-95d6936c8fa4
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"Australia East","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"SY1PEPF000026FD"}}

2025/05/04 23:16:59 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:16:59 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:16:59 DEBUG : HTTP REQUEST (req 0xc000b3b180)
2025/05/04 23:16:59 DEBUG : GET /v1.0/drives/driveIDlowercase/items/driveIDuppercase!105/children?$top=1000 HTTP/1.1
Host: graph.microsoft.com
User-Agent: rclone/v1.69.2
Authorization: XXXX
Accept-Encoding: gzip

2025/05/04 23:16:59 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/04 23:17:00 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/04 23:17:00 DEBUG : HTTP RESPONSE (req 0xc000b3b180)
2025/05/04 23:17:00 DEBUG : HTTP/2.0 200 OK
Cache-Control: no-store
Client-Request-Id: 769d3710-f931-44fc-ac51-58b89797e337
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Sun, 04 May 2025 11:16:59 GMT
Odata-Version: 4.0
Request-Id: 769d3710-f931-44fc-ac51-58b89797e337
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"Australia East","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"SY1PEPF000026FD"}}

2025/05/04 23:17:00 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
*** file listing output redacted ***

welcome to the forum,

maybe try --onedrive-region=global

Kia ora :slight_smile:

Thanks for the suggestion, it looks like an obvious solution and gave me an "oh no should have rtfm"-moment.
Unfortunately, when I tried it this morning, it didn't work.

user@vps:~$ rclone --config ./.config/rclone/od.conf lsd od: -vv  --onedrive-region=global
2025/05/05 09:09:54 DEBUG : rclone: Version "v1.69.2" starting with parameters ["rclone" "--config" "./.config/rclone/od.conf" "lsd" "od:" "-vv" "--onedrive-region=global"]
2025/05/05 09:09:54 DEBUG : Creating backend with remote "od:"
Enter configuration password:
password:
2025/05/05 09:09:57 DEBUG : Using config file from "/home/user/.config/rclone/od.conf"
2025/05/05 09:09:57 ERROR : : error listing: couldn't list files: invalidRequest: The item does not reside in the drive
2025/05/05 09:09:57 DEBUG : 6 go routines active
2025/05/05 09:09:57 NOTICE: Failed to lsd with 2 errors: last error was: couldn't list files:
invalidRequest: The item does not reside in the drive 

Dumping the headers, I can see it's still connecting to the West Germany server despite the flag.

About 12 hours later this issue appears to have fixed itself. :-1: So it must be an "intermittent issue" or something in OneDrive that rclone isn't always able to interpret correctly. :frowning:

Now it works with or without the flag, and looking at the headers nothing much has changed?

If there's any way in which I can assist with more troubleshooting this, let me know.

For what it's worth, here are the headers of the successful request from the VPS:

rclone --config ./.config/rclone/od.conf lsd od: --dump headers
2025/05/05 22:15:54 NOTICE: Automatically setting -vv as --dump is enabled
2025/05/05 22:15:54 DEBUG : rclone: Version "v1.69.2" starting with parameters ["rclone" "--config" "./.config/rclone/od.conf" "lsd" "od:" "--dump" "headers"]
2025/05/05 22:15:54 DEBUG : Creating backend with remote "od:"
Enter configuration password:
password:
2025/05/05 22:15:56 DEBUG : Using config file from "/home/user/.config/rclone/od.conf"
2025/05/05 22:15:56 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2025/05/05 22:15:56 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/05 22:15:56 DEBUG : HTTP REQUEST (req 0xc0000b2dc0)
2025/05/05 22:15:56 DEBUG : GET /v1.0/drives/ONEDRIVE_ID/root HTTP/1.1
Host: graph.microsoft.com
User-Agent: rclone/v1.69.2
Authorization: XXXX
Accept-Encoding: gzip

2025/05/05 22:15:56 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/05 22:15:57 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/05 22:15:57 DEBUG : HTTP RESPONSE (req 0xc0000b2dc0)
2025/05/05 22:15:57 DEBUG : HTTP/2.0 200 OK
Cache-Control: private
Client-Request-Id: 6221f165-6193-48c9-984e-27862a499c96
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Mon, 05 May 2025 10:15:56 GMT
Odata-Version: 4.0
Request-Id: 6221f165-6193-48c9-984e-27862a499c96
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"FR2PEPF00000B2C"}}

2025/05/05 22:15:57 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/05 22:15:57 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/05 22:15:57 DEBUG : HTTP REQUEST (req 0xc0005ffa40)
2025/05/05 22:15:57 DEBUG : GET /v1.0/drives/ONEDRIVE_ID/items/ONEDRIVE_ID!105/children?$top=1000 HTTP/1.1
Host: graph.microsoft.com
User-Agent: rclone/v1.69.2
Authorization: XXXX
Accept-Encoding: gzip

2025/05/05 22:15:57 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2025/05/05 22:15:57 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2025/05/05 22:15:57 DEBUG : HTTP RESPONSE (req 0xc0005ffa40)
2025/05/05 22:15:57 DEBUG : HTTP/2.0 200 OK
Cache-Control: no-store
Client-Request-Id: 95d95b48-58b6-41e3-965f-12d142dfed02
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date: Mon, 05 May 2025 10:15:56 GMT
Odata-Version: 4.0
Request-Id: 95d95b48-58b6-41e3-965f-12d142dfed02
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"FR2PEPF00000B2C"}}

2025/05/05 22:15:57 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
          -1 2025-04-11 22:27:47        16 Apps

I note that the GET request has changed to GET /v1.0/drives/ONEDRIVE_ID/items/ONEDRIVE_ID!105/children?$top=1000 HTTP/1.1 which is similar to what I worked on my laptop yesterday (the 105 part) and different to what didn't work on the VPS yesterday (instead of 105 it had a much longer uuid-like string).

If you serach this forum you will see that OneDrive DE is constant source of issues. Why? Only MS knows. In theory all data centres should be the same. But in practice they are not.

1 Like