Onedrive impersonation

Hello rclone! Who isn’t using this?!

I have been tasked with backing up business onedrive accounts. I thought --drive-impersonation was they key… but that’s only for Google, right?

Anyone using O365 impersonation to use rclone? Or am I barking up the wrong tree?

Thanks to all who work on this!

That is only for google drive, yes.

We don’t support service accounts with onedrive yet, but we could.

Fancy finding some docs and making a new issue on github with links in so we can discuss what needs to be done?

Thanks for the response! We did end up using the branch just released by olihey.

We are close! We got a token with an admin account and for every user we are creating a different drive_id and remote: for rclone. It seems to work after following all the instructions on sites that reference O365 impersonation. Very large team sites are getting difficult to clone… They often crash and the clone has to be restarted. If we spread them out with a set of cron jobs, it survives. Are we doing this right? Well, what I mean is… Would you recommend a different way?


How does it crash? Is there something in the log you could share? Rclone shouldn’t crash :wink:

Turns out there are two separate issues. One is the impersonation (which we think by using olihey’s branch is working!), but the other is a crash when we are pushing our own Sharepoint library (we are a consulting company, doing this for a client. We wanted to eat our own dog food. Their’s is working, ours is ~800GB):

I tried to put the error in here and it says that new users can only put 2 links in a post. The links are things like:*Item).IsRemote(…)

But the gist of the error is:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x170 pc=0xa4b727]

There is a lot more… let me know where else I can paste the rest of the error please… we are loving this software!

This looks like a serious error that almost definitely indicates a bug… Can you try using the “Preformatted text” button in the editor? If not, can you try for example and share with us the error? That would be of much help. Thanks!

Thanks for the suggestion on pastebin… never even thought of that…

Let us know what we can do to help!

Thanks for the error message. I’m looking at the code for problems now.

Just to confirm: You’re using the version found at is that correct?

I see that you are encountering this problem when uploading something to the remote. Are you source files in your local file system, or in another remote? Are there any other log messages that you can share (obtained with -vv argument) with us? For example some network or file system errors? Any additional clues would be appreciated!

(More detailed info: There seem to be no good reason that nil is passed into the function setMetaData. I doubt if a size of 0 is passed into uploadMultipart.)

1 Like


The latest one (I believe 1.42-144) has now gone 7 hours on our nearly 1TB without a crash… so someone fixed something between 1.42-133!!

We are watching it closely!