OneDrive sync problem - InvalidAuthenticationToken

BY DELETING THIS COMMENT, I AM CONFIRMING I HAVE READ THIS AND WILL USE THE TEMPLATE BELOW FOR MY POST.

What is the problem you are having with rclone?

I've a problem when sync onedrive to another onedrive in randon times give this error

InvalidAuthenticationToken: Access token has expired or is not yet valid

This happen when error occur.

2021-12-23 00:07:41 ERROR : Attempt 1/3 failed with 1807 errors and: failed to open source object: InvalidAuthenticationToken: Access token has expired or is not yet valid.
2021-12-23 00:07:42 ERROR : One drive root '': error reading source root directory: couldn't list files: InvalidAuthenticationToken: Access token has expired or is not yet valid.
2021-12-23 00:07:42 ERROR : One drive root '': not deleting files as there were IO errors
2021-12-23 00:07:42 ERROR : One drive root '': not deleting directories as there were IO errors
2021-12-23 00:07:42 ERROR : Attempt 2/3 failed with 1 errors and: couldn't list files: InvalidAuthenticationToken: Access token has expired or is not yet valid.
2021-12-23 00:07:44 ERROR : One drive root '': error reading source root directory: couldn't list files: InvalidAuthenticationToken: Access token has expired or is not yet valid.
2021-12-23 00:07:44 ERROR : One drive root '': not deleting files as there were IO errors
2021-12-23 00:07:44 ERROR : One drive root '': not deleting directories as there were IO errors
2021-12-23 00:07:44 ERROR : Attempt 3/3 failed with 1 errors and: couldn't list files: InvalidAuthenticationToken: Access token has expired or is not yet valid.
Transferred:       13.149 GiB / 13.149 GiB, 100%, 323.867 KiB/s, ETA 0s
Errors:                 1 (retrying may help)
Checks:                26 / 26, 100%
Transferred:           48 / 48, 100%
Elapsed time:   1h21m26.4s
2021/12/23 00:07:44 Failed to sync: couldn't list files: InvalidAuthenticationToken: Access token has expired or is not yet valid.

What is your rclone version (output from rclone version)

rclone v1.57.0

  • os/version: debian 10.9 (64 bit)
  • os/kernel: 4.19.0-16-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.2
  • 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 sync -P OneDrive: OneDrive2:

The rclone config contents with secrets removed.

[OneDrive]
type = onedrive
chunk_size = 200M
token = 
drive_type = business
client_id = 
client_secret = 

[OneDrive2]
type = onedrive
chunk_size = 200M
token = 
drive_type = business
client_id = 
client_secret = 

A log from the command with the -vv flag

2021/12/23 00:33:30 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "--dump" "responses" "-vv" "lsd" "OneDrive:"]
2021/12/23 00:33:30 DEBUG : Creating backend with remote "OneDrive:"
2021/12/23 00:33:30 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2021/12/23 00:33:30 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding asding was in effect. In this case the body of the request will be gunzipped before showing it.
2021/12/23 00:33:30 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/12/23 00:33:30 DEBUG : HTTP REQUEST (req 0xc000734e00)
Host: graph.microsoft.com
User-Agent: rclone/v1.57.0
Authorization: XXXX
Accept-Encoding: gzip

2021/12/23 00:33:30 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/12/23 00:33:30 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/12/23 00:33:30 DEBUG : HTTP RESPONSE (req 0xc000734e00)
2021/12/23 00:33:30 DEBUG : HTTP/1.1 401 Unauthorized
Transfer-Encoding: chunked
Client-Request-Id: 87a9450d-544b-4496-a069-91e7b7e3ebd8
Content-Type: application/json
Date: Thu, 23 Dec 2021 06:33:30 GMT
Request-Id: 87a9450d-544b-4496-a069-91e7b7e3ebd8
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
Www-Authenticate: Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"3","ScaleUnit":"000","R

104
{"error":{"code":"InvalidAuthenticationToken","message":"Access token has expired or is not yet valid.","innerE9-91e7b7e3ebd8"}}}
0

2021/12/23 00:33:30 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Is the the whole rclone.conf?

Doesn't look like it has been authorized.

rclone config reconnect OneDrive:
rclone config reconnect OneDrive2:

You should see a token line in your rclone.conf.

Yes whole config.

Of course i remove sensitive data.

hi,

i know this is a basic thing, to make sure the clock and timezone are accurate.

https://forum.rclone.org/t/certificate-error-one-drive/3958

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