Can't add OneDrive account

What is the problem you are having with rclone?

Hi, I'm new to RClone.
I'm adding my accounts to RClone and I had no problem with my Google Drive account. However, my OneDrive account won't be added. I am on Windows and rclone config returns this:

[just the setup]
Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (someid).
 1 /  (personal)
   \ (someid)
config_driveid>1

Failed to query root for drive "someid": HTTP error 403 (403 Forbidden) returned body: "{\"error\":{\"code\":\"accessDenied\",\"message\":\"Access Denied\",\"innerError\":{\"date\":\"2023-12-09T17:33:13\",\"request-id\":\"somekindofid\",\"client-request-id\":\"annotheridhere\"}}}"
[it returns back to onedrive server selection everytime it gets here]
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).

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

I just downloaded RClone (literaly 20 minutes ago from the official website), so I should have the latest version, but here's the command output:

rclone v1.65.0
- os/version: Microsoft Windows 10 Pro 22H2 (64 bit)
- os/kernel: 10.0.19045.3693 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.21.4
- go/linking: static
- go/tags: cmount

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

Microsoft OneDrive

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

rclone config

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

rclone v1.65.0
- os/version: Microsoft Windows 10 Pro 22H2 (64 bit)
- os/kernel: 10.0.19045.3693 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.21.4
- go/linking: static
- go/tags: cmount

[HGStyle]
type = drive
client_id = XXX
client_secret = XXX
token = XXX
team_drive =

[HGStyleYT]
type = onedrive
token = XXX
### 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

Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).
 1 / OneDrive Personal or Business
   \ (onedrive)
 2 / Root Sharepoint site
   \ (sharepoint)
   / Sharepoint site name or URL
 3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
   \ (url)
 4 / Search for a Sharepoint site
   \ (search)
 5 / Type in driveID (advanced)
   \ (driveid)
 6 / Type in SiteID (advanced)
   \ (siteid)
   / Sharepoint server-relative path (advanced)
 7 | E.g. /teams/hr
   \ (path)
config_type> 1

2023/12/09 18:46:48 DEBUG : HGStyleYT: config in: state="choose_type_done", result="onedrive"
2023/12/09 18:46:48 DEBUG : HGStyleYT: config out: out=&{State:onedrive Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2023/12/09 18:46:48 DEBUG : HGStyleYT: config in: state="onedrive", result=""
2023/12/09 18:46:49 DEBUG : HGStyleYT: config out: out=&{State:driveid_final Option:d0ce5b9ee422d988 OAuth:<nil> Error: Result:}, err=<nil>
2023/12/09 18:46:49 DEBUG : HGStyleYT: config: reading config parameter "config_driveid"
Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (d0ce5b9ee422d988).
 1 /  (personal)
   \ (d0ce5b9ee422d988)
config_driveid>

2023/12/09 18:46:50 DEBUG : HGStyleYT: config in: state="driveid_final", result="d0ce5b9ee422d988"
2023/12/09 18:46:51 DEBUG : HGStyleYT: config out: out=&{State:choose_type Option:<nil> OAuth:<nil> Error:Failed to query root for drive "d0ce5b9ee422d988": HTTP error 403 (403 Forbidden) returned body: "{\"error\":{\"code\":\"accessDenied\",\"message\":\"Access Denied\",\"innerError\":{\"date\":\"2023-12-09T17:46:51\",\"request-id\":\"4f1a4ac4-3e25-4685-ad51-19ac174128b9\",\"client-request-id\":\"4f1a4ac4-3e25-4685-ad51-19ac174128b9\"}}}" Result:}, err=<nil>
Failed to query root for drive "d0ce5b9ee422d988": HTTP error 403 (403 Forbidden) returned body: "{\"error\":{\"code\":\"accessDenied\",\"message\":\"Access Denied\",\"innerError\":{\"date\":\"2023-12-09T17:46:51\",\"request-id\":\"4f1a4ac4-3e25-4685-ad51-19ac174128b9\",\"client-request-id\":\"4f1a4ac4-3e25-4685-ad51-19ac174128b9\"}}}"

2023/12/09 18:46:51 DEBUG : HGStyleYT: config in: state="choose_type", result=""
2023/12/09 18:46:51 DEBUG : HGStyleYT: config out: out=&{State:choose_type_done Option:onedrive OAuth:<nil> Error: Result:}, err=<nil>
2023/12/09 18:46:51 DEBUG : HGStyleYT: config: reading config parameter "config_type"
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).  [it loops infinitely]

I understand that there is a login problem, but I have no idea how to fix it, anyone knows ? Sorry if the solution is obvious/written in the docs, I checked but I didn't find anything.

You press ENTER here?

Also what sort of onedrive account it is?

Hi, yes, I pressed enter here for the default option. I have a personnal free OneDrive account.

By any chance are you using client_id/secret?

No, I'm not using my own client id and secret. Should I do ? And how ?

It is advisable (for performance reason) but all should work without it. Do not add them until it is working IMO - no reason to complicate it for now.

FYI - I have just tried to configure onedrive remote - and all works perfectly - I press ENTER for everything, authenticate in web browser and working account is ready.

Can you post all steps you take to configure your account?

Hi, I retried with default options, like how you did, but it still doesn't work.
I had the idea to try with annother app, and it doesn't works too.
Looks like it's a Microsoft problem, any ideas on how to fix it ?
I have also opened a thread in Microsoft support, since it doesn't seems to be a problem with RClone. Anyways, any ideas on how to fix it are welcome.

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