When I setup or renew OneDrive (Global, Personal) I only get an access token for 1h.
Contrary to @ncw's statement apparently rclone doesn't auto-renew it as it reproducible runs into
2023/03/29 05:38:40 DEBUG : [file n]: Unchanged skipping
2023/03/29 05:38:40 DEBUG : [file n+1]: Size and modification time the same (differ by 0s, within tolerance 1s)
2023/03/29 05:38:40 DEBUG : [file n+2]: Unchanged skipping
2023/03/29 05:38:40 ERROR : [file n+3]: error reading destination directory: couldn't list files: InvalidAuthenticationToken: CompactToken validation failed with reason code: 80049228.
2023/03/29 05:38:40 ERROR : [file n+4]: error reading destination directory: couldn't list files: InvalidAuthenticationToken: CompactToken validation failed with reason code: 80049228.
2023/03/29 05:38:40 ERROR : [file n+5]: error reading destination directory: couldn't list files: InvalidAuthenticationToken: CompactToken validation failed with reason code: 80049228.
Run the command 'rclone version' and share the full output of the command.
rclone v1.62.0
os/version: Microsoft Windows 10 Pro 20H2 (64 bit)
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 sync S: OneDrive:
The rclone config contents with secrets removed.
[OneDrive]
type = onedrive
region = global
token = {"access_token":"Ew[snipped]or","expiry":"2023-03-29T06:41:51.5998802+02:00"}
drive_id = 5[snipped]9
drive_type = personal
A log from the command with the -vv flag
2023/03/29 06:34:25 DEBUG : rclone: Version "v1.62.0" starting with parameters ["rclone" "sync" "S:" "OneDrive:" "-vv"]
2023/03/29 06:34:25 DEBUG : Creating backend with remote "S:"
2023/03/29 06:34:27 DEBUG : Creating backend with remote "OneDrive:"
[...]
2023/03/29 06:41:33 INFO : [file n]: Copied (new)
2023/03/29 06:41:33 INFO : [file n+1]: Copied (new)
2023/03/29 06:41:33 INFO : [file n+2]: Copied (new)
2023/03/29 06:41:33 DEBUG : [file n+3]: Starting multipart upload
2023/03/29 06:41:34 DEBUG : [file n+4]: Starting multipart upload
2023/03/29 06:41:34 ERROR : [file n+3]: Failed to copy: InvalidAuthenticationToken: CompactToken validation failed with reason code: 80049228.
2023/03/29 06:41:34 ERROR : [file n+4]: Failed to copy: InvalidAuthenticationToken: CompactToken validation failed with reason code: 80049228.
2023/03/29 06:41:34 DEBUG : [file n+5]: Starting multipart upload
2023/03/29 06:41:34 ERROR : [file n+5]: Failed to copy: InvalidAuthenticationToken: CompactToken validation failed with reason code: 80049228.
[...]
2023/03/29 06:42:00 INFO : Signal received: interrupt
I found the issue: rclone.conf was r/o.
Works great for Koofr and pCloud, quite obviously doesn't work for OneDrive.
Feature request:
Please do more detailled error reporting in debug mode (in this case "write error [errno] to rclone.conf" or alike or just print out whatever the OS reports back to rclone).
It made debugging the setup much easier.
.
For others finding this thread:
Also make sure you have access to (ATM, 2023/03/29)
rclone.conf was on a r/o file system.
rclone.conf is in my primary cloud storage and I use a high-bandwidth VPS (off site, 3rd parties could access it, so I deem it a 'not trustworthy environment') to replicate it to secondary and tertiary CS.
To protect my primary CS the VPS only has r/o access. I created/renewed the OneDrive token from home.
Now I mounted a separate folder of primary CS as r/w drive to host rclone.conf and it works like a charm.