Onedrive Bisync "Cannot unmarshal string"

What is the problem you are having with rclone?

When I try to run:
clone bisync "OneDrive Business": ~/OneDrive\ Business --verbose --resync
I get
Failed to create file system for "OneDrive Business:": failed to configure OneDrive: json: cannot unmarshal string into Go value of type oauth2.Token

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

rclone v1.63.1
- os/version: linuxmint 20.3 (64 bit)
- os/kernel: 5.4.0-156-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: none

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

OneDrive - both onedrive personal and onedrive business (not SharePoint, haven't tried that) give the same error. Google Drive works absolutely fine with the same command.

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

rclone bisync "OneDrive Business": ~/OneDrive\ Business --verbose --resync

The rclone config contents with secrets removed.

Current remotes:

Name                 Type
====                 ====
Google Drive         drive
OneDrive Business    onedrive
OneDrive Personal    onedrive

A log from the command with the -vv flag

2023/08/31 19:17:44 DEBUG : rclone: Version "v1.63.1" starting with parameters ["rclone" "bisync" "OneDrive Business:" "/home/jez/OneDrive Business" "--verbose" "--resync" "-vv"]
2023/08/31 19:17:44 DEBUG : Creating backend with remote "OneDrive Business:"
2023/08/31 19:17:44 DEBUG : Using config file from "/home/jez/.config/rclone/rclone.conf"
2023/08/31 19:17:44 Failed to create file system for "OneDrive Business:": failed to configure OneDrive: json: cannot unmarshal string into Go value of type oauth2.Token

I can mount both OneDrives quite happily.

run:

rclone config show

and post output here (remove all secrets).

run:

rclone lsd "OneDrive Business:" -vv

and post output here

type = onedrive
token = "{\"access_token\":\"redacted\",\"token_type\":\"Bearer\",\"refresh_token\":\"M.C105_BAY.-redacted$\",\"expiry\":\"2023-08-27T18:43:46.776446324+01:00\"}"
drive_id = 5d3308e1c0fad43d
drive_type = personal

[OneDrive Business]
type = onedrive
token = "{\"access_token\":\"redacted\",\"token_type\":\"Bearer\",\"refresh_token\":\"M.C105_BAY.-redacted\",\"expiry\":\"2023-08-27T18:43:46.502989616+01:00\"}"
drive_id = 5d3308e1c0fad43d
drive_type = personal

[Google Drive]
type = drive
scope = drive
token = {"access_token":"redacted","token_type":"Bearer","refresh_token":"redacted","expiry":"2023-08-31T00:50:43.664389255+01:00"}
root_folder_id = 0ACEvft-JbtJAUk9PVA
client_id = 
client_secret = 
service_account_file = 
service_account_credentials = 
team_drive = 
auth_owner_only = false
use_trash = false
skip_gdocs = false
shared_with_me = false
trashed_only = false
formats = 
export_formats = 
import_formats = 
allow_import_name_change = false
use_created_date = false
list_chunk = 
impersonate = 
alternate_export = false
upload_cutoff = 
chunk_size = 
acknowledge_abuse = false
keep_revision_forever = false
v2_download_min_size = 
_rclonetray_local_path_map = /home/jez/Google Drive
_rclonetray_custom_args =

and

2023/09/01 09:16:47 DEBUG : rclone: Version "v1.63.1" starting with parameters ["rclone" "lsd" "OneDrive Business:" "-vv"]
2023/09/01 09:16:47 DEBUG : Creating backend with remote "OneDrive Business:"
2023/09/01 09:16:47 DEBUG : Using config file from "/home/jez/.config/rclone/rclone.conf"
2023/09/01 09:16:47 Failed to create file system for "OneDrive Business:": failed to configure OneDrive: json: cannot unmarshal string into Go value of type oauth2.Token

Of course remote name is entirely up to you but maybe it is some clue? You want to use onedrive business? but why it is drive_type=personal ?

rclone lsd does not work so something is wrong with your remote configuration. Until it is working forget about any more complex commands.

Do you have two different onedrive accounts? personal and business?

It's the personal area of a business account, i.e. not sharepoint.

The other personal onedrive remote is actually a totally separate personal account, so yes there are two different accounts.

If this is a problem, why can I mount them both with no issues?

I suspect that your token is corrupted.

Why all thse \ characters there?

Compare it with your working Google token:

You have not posted any details. No idea what you are running.

Try

rclone mount "OneDrive Business:" /path/to/mount/point -vv

and post output

Dunno where the slashes came from, I just pasted it. I didn't modify that response other than deleting the 'redacted' bits.

Will try that command when I get home.

Forgot to say I can mount them using Rclone Browser. I presume that uses the same config Rclone does.

I do not assume it at all:)

Anyway. Go back to the problem.

Could you try to create new test onedrive remote?

rclone config

and name it onedrive_test or similar.

and then try

rclone lsd onedrive_test: -vv

Deleting and recreating both remotes has fixed it. Just have to wait a few hours for them both to finish syncing now lol

Good to hear it works now.

I should probably add that prior to trying to do all this, I hadn't used this machine to connect to any of my remotes for some time, so the tokens had expired. I requested new tokens for all of them, so maybe it seems that the google one worked but the MS ones didn't? Not sure if this is something wrong at MS's end or yours?

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