rclone: Unable to copy to OneDrive for Business

What is the problem you are having with rclone?

Not able to upload to OneDrive for Business however uploading to OneDrive personal works

What is your rclone version (eg output from rclone -V)

rclone v1.40

  • os/arch: windows/amd64
  • go version: go1.10

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

Windows 10

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

OneDrive for Business

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

rclone -v copy c:/temp/jack.jpg remote:Backup

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

C:\Temp\rclone-v1.40-windows-amd64>rclone -vv copy c:/temp/jack.jpg remote:Backup 2018/04/14 11:08:11 DEBUG : rclone: Version “v1.40” starting with parameters [“rclone” “-vv” “copy” “c:/temp/jack.jpg” “remote:Backup”] 2018/04/14 11:08:11 DEBUG : Using config file from “C:\Users\David\.config\rclone\rclone.conf” 2018/04/14 11:08:12 INFO : One drive root ‘Backup’: Modify window is 1s 2018/04/14 11:08:12 DEBUG : rclone-v1.40-windows-amd64: Excluded from sync (and deletion) 2018/04/14 11:08:12 DEBUG : test: Excluded from sync (and deletion) 2018/04/14 11:08:12 INFO : One drive root ‘Backup’: Waiting for checks to finish 2018/04/14 11:08:12 INFO : One drive root ‘Backup’: Waiting for transfers to finish 2018/04/14 11:08:12 DEBUG : jack.jpg: Starting multipart upload 2018/04/14 11:08:12 DEBUG : pacer: Rate limited, increasing sleep to 20ms 2018/04/14 11:08:12 DEBUG : pacer: low level retry 1/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:13 DEBUG : pacer: Rate limited, increasing sleep to 40ms 2018/04/14 11:08:13 DEBUG : pacer: low level retry 2/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:13 DEBUG : pacer: Rate limited, increasing sleep to 80ms 2018/04/14 11:08:13 DEBUG : pacer: low level retry 3/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:13 DEBUG : pacer: Rate limited, increasing sleep to 160ms 2018/04/14 11:08:13 DEBUG : pacer: low level retry 4/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:13 DEBUG : pacer: Rate limited, increasing sleep to 320ms 2018/04/14 11:08:13 DEBUG : pacer: low level retry 5/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:13 DEBUG : pacer: Rate limited, increasing sleep to 640ms 2018/04/14 11:08:13 DEBUG : pacer: low level retry 6/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:14 DEBUG : pacer: Rate limited, increasing sleep to 1.28s 2018/04/14 11:08:14 DEBUG : pacer: low level retry 7/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:14 DEBUG : pacer: Rate limited, increasing sleep to 2s 2018/04/14 11:08:14 DEBUG : pacer: low level retry 8/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:16 DEBUG : pacer: low level retry 9/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:18 DEBUG : pacer: low level retry 10/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:18 DEBUG : jack.jpg: Received error: generalException: An unspecified error has occurred. - low level retry 1/10 2018/04/14 11:08:18 DEBUG : jack.jpg: Starting multipart upload 2018/04/14 11:08:20 DEBUG : pacer: low level retry 1/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:22 DEBUG : pacer: low level retry 2/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:24 DEBUG : pacer: low level retry 3/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:26 DEBUG : pacer: low level retry 4/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:28 DEBUG : pacer: low level retry 5/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:30 DEBUG : pacer: low level retry 6/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:32 DEBUG : pacer: low level retry 7/10 (error generalException: An unspecified error has occurred.) 2018/04/14 11:08:34 DEBUG : pacer: low level retry 8/10 (error generalException: An unspecified error has occurred.)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 18 (7 by maintainers)

Commits related to this issue

Most upvoted comments

It looks like Microsoft have fixed the issue at their end.

There unfortunately was a regression with the handling of those timestamps, but as you’ve observed the issue was patched over the weekend. I haven’t checked deployment status today, but it’s possible the patch is still rolling to a few tenants so waiting will probably help.

So I’m going to close this issue now 😃

Ha. That was it.

I know nothing about the GO language but I managed to hack up the OneDrive api/types.go and onedrive.go files to implement the changes I mentioned above, and it worked!

It took me awhile to figure out how to compile and re-compile after changes, but it works. Now hopefully @ncw can work his magic and make a release. It was a 5-line change for me; hopefully he can do it properly.

I did notice another difference between rclone and the other client. They use a different URL. Where rclone uses /_api/v2.0/drives/me/root:/..... etc they use /_api/v2.0/me/drive/items/root:/.... I didn’t change that since it seems to work either way.

Edit / addendum: For anyone who wants to try this for themselves, here’s a diff of my changes:

diff -r rclone/backend/onedrive/api/types.go rclone.mod/backend/onedrive/api/types.go
180a181,183
> type ConflictBehavior struct {
>       ConflictBehavior string `json:"@name.conflictBehavior"`
> }
182c185,186
<       Item SetFileSystemInfo `json:"item"`
---
>       //Item SetFileSystemInfo `json:"item"`
>       Item ConflictBehavior `json:"item"`
diff -r rclone/backend/onedrive/onedrive.go rclone.mod/backend/onedrive/onedrive.go
1104,1105c1104,1106
<       createRequest.Item.FileSystemInfo.CreatedDateTime = api.Timestamp(modTime)
<       createRequest.Item.FileSystemInfo.LastModifiedDateTime = api.Timestamp(modTime)
---
>       createRequest.Item.ConflictBehavior = "rename"
>       //createRequest.Item.FileSystemInfo.CreatedDateTime = api.Timestamp(modTime)
>       //createRequest.Item.FileSystemInfo.LastModifiedDateTime = api.Timestamp(modTime)

Please stay calm, no changes needed for now. It seems the OneDrive API has an issue: https://github.com/OneDrive/onedrive-api-docs/issues/832

@sandersonb It’s not stated anywhere in the docs that conflictBehavior is needed. It’s just used in all examples, so that might be a bit misleading. @ncw I agree, that the default should be replace which is actually the ‘default’ setting if it’s missing 😄 @nsymms Without the FileSystemInfo structure we will loose the ability to set the last modification date, so 🤞 that Microsoft fixes that, also rclone is not yet using the new Microsoft Graph API for accessing your data, so that’s might why the URLs doesn’t match with other client that might use the Graph API