Rclone copy from gdrive to onedrive, pathname length limitations

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

When copying files/folders from gdrive to onedrive sharepoint/etc I get the following error on some files:

invalidRequest: pathIsTooLong: Path is too long

I am not using crypt. These are just regular files. Is there a way to fix this with a flag? etc?

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

rclone v1.64.2

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.120+ (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.3
  • go/linking: static
  • go/tags: none

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

Google Drive and Onedrive

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

rclone copy remote: remote: --drive-acknowledge-abuse --create-empty-src-dirs -v

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

Paste config here

A log from the command that you were trying to run with the -vv flag

Paste  log here

No flag will shorten files' names for you. Onedrive is much more limited compared to Gdrive in this aspect - you have to plan accordingly.

On top of my head onedrive max path is 400 chars vs 10000 (or similar huge) for Google. You can check details in docs.

Only solution is - make sure that your path max length is within limits of your destination.

Thanks! Would moving the main folders to the root directory on gdrive possibly help with that? I'm new to this so I guess my limited understanding is that the path length includes all the different folders and subfolders, plus file name. If i moved it to the root, that would be less subfolders added to the path length?

Or would I have to target the actual filenames themselves? Trying to think of the simplest solution first

Yes you have to count all path you copy. You want to copy it to Onedrive - it has to be less than 400 characters in total.

How you solve it is up to you. rclone will not spell any magic here.

PS. Good lesson here is to always think about what if (e.g. have to move to other provider). Do your research - find limits - and stick to them. Or commit yourself to life to your provider choice. For critical data I always go for the lowest common denominator. base32 crypt encoding, short paths etc. This way it can be always transferred somewhere else without any extra steps.

Thanks! Appreciate the help

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