Uploads to OneDrive fail with “HTTP error 400 (400 Bad Request)”

What is the problem you are having with rclone?

For some time now I have been using my Microsoft OneDrive account as an encrypted remote for backups of an Android device. In the last week or so these have started to fail with an “HTTP error 400”. It only seems to happen after uploading around 1GB of data. The logs on Pastebin below show the output of a copy of a 1GB (works) and a 2GB (fails) file directly to the OneDrive remote. Commands such as “ls”, “delete”, “cleanup”, etc. all work OK. I have also tested the same actions using the same version / config of Rclone on a Linux (OpenSUSE) client and the results are the same.

I’m not sure if this is related to the latest release of Rclone, some sort of change by Microsoft on their end, or something else.

Any help / advice is much appreciated.

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

rclone v1.71.0-termux
- os/version: unknown
- os/kernel: 4.14.356-openela-rc1-g5d7843bef401 (aarch64)
- os/type: android
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.24.5
- go/linking: dynamic
- go/tags: noselfupdate

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

Microsoft OneDrive (personal)

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

rclone copy --verbose --verbose {file} OneDrive:

The rclone config contents with secrets removed.

[OneDrive]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = personal

A log from the command with the -vv flag

test-1G : https://pastebin.com/Fbihd2EC
test-2G : https://pastebin.com/0tYjuv9V

welcome to the forum,

so you copied the config file from termux machine to opensuse machine?
or
created a new config file on the opensuse machine?

I copied the config over.

400 Bad Request

for a deeper look, try a --dump such as --dump=headers

All I can see is a bunch of PUT requests that receive a “202 Accepted” response, then suddenly a request receives a “400 Bad Request” response.

Log with headers:

test-2G.log (759.9 KB)

I think I've found the cause.

I suddenly started seeing messages such as:

ERROR : Personal Vault: error listing: couldn't list files: invalidRequest: invalidResourceId: ObjectHandle is Invalid

when running commands such as “ls".

This led me to:

I can confirm that adding:

--exclude='/Personal Vault/**'

to every command resolves all problems.

I'd never even heard of a “Personal Vault” until this problem. Appears to be something being rolled out to all accounts, and can't be disabled.

I will monitor the issue above, but I think this thread can be marked as resolved.

Thanks for the assistance.

1 Like

It is NEVER good idea to use such remote root for any operations. OneDrive and many others similar companies are not just storage providers and have multiple ideas about what other, useful or not, services to offer.

Keep your rclone synced data always in remote:mydata dedicated directory. Or switch to some pure storage provider if you can not live without root storage access.