Can't access to Onedrive

What is the problem you are having with rclone?

I can't access to onedrive storage, but the onedrive can be found in remote config list.

What is your rclone version (output from rclone version)

v1.53.1

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Raspberrypi:linux

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

Onedrive

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

Paste command here
```rclone ls onedrv22:


#### The rclone config contents with secrets removed.  
<!--  You should use 3 backticks to begin and end your paste to make it readable.   -->

Paste config here




#### A log from the command with the `-vv` flag  
<!-- You should use 3 backticks to begin and end your paste to make it readable.  Or use a service such as https://pastebin.com or https://gist.github.com/   -->

Paste log here

2020/10/27 11:13:41 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2020/10/27 11:13:41 DEBUG : Creating backend with remote "onedrv22:"
2020/10/27 11:13:41 Failed to create file system for "onedrv22:": unable to get drive_id and drive_type - if you are upgrading from older versions of rclone, please run `rclone config` and re-configure this backend

You need to paste your config, because that's what rclone is moaning about.

My working config (for personal onedrive) looks like

[OneDriveSweh]
type = onedrive
token = { ... magic! ...}
drive_id = 123456789012345
drive_type = personal

Your config is missing the drive_id and drive_type values

My config is like following:

[onedrv22]
type = onedrive
scope = onedrive
config_is_local = false
token = {"access_token":"XXX","expiry":"2020-10-23T11:43:51.995755+09:00"}

Yeah, you should rerun rclone config and edit that entry because it's missing important values.

Thank you so much! I will try it.

I made the connection with RPi to OneDrive storage using the following command:
rclone config create onedrv22 onedrive scope onedrive config_is_local false.

How to set the drive_id by command?

Well, your token has expired, though that is not always a problem. I am not an expert on the OneDrive API but I have had issues. Especially since it is refreshed so often...

When I've had issues with OneDrive, I've just set it up again and it worked. I would try that before jumping too far down the rabbit hole. Just delete the remote and start from scratch!

Thanks for your reply!
The token is update automatically, so it is not a problem.

The point is that I want to set drive_id by the command.

You can pass it in with --onedrive-drive-id if you just want it on that command.

Or if you want to change the config file then you use rclone config update YourRemote drive_id whatever

Thaks a lot!
The steps I did is like following:

  1. Create a onedrive remote by command:
    ・rclone config create onedrv22 onedrive scope onedrive config_is_local false
  2. Access to the remote(onedrv22) by command:
    ・rclone ls onedrv22:
    ・error: Failed to create file system for "onedrv22:": unable to get drive_id and drive_type - if you are upgrading from older versions of rclone, please run rclone config and re-configure this backend

After step1, how can I get the drive_id, and set it?

Reference to the following picture, I think I can not set the drive_id as whatever. I have to get drvie_id from the remote(onedrv22), is it right?

If you know the drive_id you can add it here

rclone config create onedrv22 onedrive scope onedrive config_is_local false drive_id 23942309

I'm not sure the onedrive configuration is working properly like this...

Do you have a user to enter choices here? Or are you trying to script the entire process?

Yes, I am trying to script the entire process.
If you know the way, please tell me it.

I'm not sure it is possible at the moment unless you know the drive_id - a user may have access to multiple drives.

Can you find out the drive id?

Thanks your reply.
I can't get the drive id by script yet.

How does the interactive process determine the value? I don't know anything about that backend. If possible, something like having drive_id=auto (which would be the default) to make it follow the same path would help.

It is quite complicated! It asks the user this

Choose a number from below, or type in an existing value
 1 / OneDrive Personal or Business
   \ "onedrive"
 2 / Sharepoint site
   \ "sharepoint"
 3 / Type in driveID
   \ "driveid"
 4 / Type in SiteID
   \ "siteid"
 5 / Search a Sharepoint site
   \ "search"

Then can ask more questions. At the end there will be a list of drive_ids for the user to choose one.

So that is a lot of potential choices to automate!

It is possible to "preload" the config question machinery with answers so maybe that mechanism needs extending to say "config_onedrive_type=onedrive" and "config_drive_list=first" or something like that.

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