Skip to content

Skip long titled folder? --max-name-length #762

Open

Description

@scriptzteam
Received error: failed to make directory: HTTP code 400: "400 Bad Request", reponse body: {"message":"1 validation error detected: Value 'BLABLAlooooNG.....ENCRYPTED' at 'name' failed to satisfy constraint: Member must have length less than or equal to 280"}
 - low level retry 1/10

is there a ways to skip that?

Activity

  1. ncw commented on Oct 4, 2016

    @ncw
    Member

    You could probably put a filter rule in.

    if you did --exclude="????...????*" where you need about 175 ? symbols then that will exclude any files which are too long after crypt. You'd need another one for directories too, so I'd probably put them in an --exclude-from file with these two lines in

    ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*
    ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*/
    

    Sorry that isn't very elegant but it is the best I can come up with at the moment!

    Which remote storage system are you using? The rules for name lengths vary for all of them.

  2. scriptzteam commented on Oct 4, 2016

    @scriptzteam
    Author

    Its Amazon Cloud Drive with CRYPT to be exact :)

    i just did for now this -> --low-level-retries 1

  3. camjac251 commented on Oct 5, 2016

    @camjac251

    I am having this issue too. Is there a way to have it not skip the files? I have the same config as scriptzteam with ACD and crypt setup, so crypt is causing the length to go past 280 right? My original path is only 205 characters long including the folders. The encrypted path is 295 characters long

  4. ncw commented on Oct 11, 2016

    @ncw
    Member

    @camjac251 the right solution is #637 which will solve this problem properly. Until then there isn't a nice solution :-(

  5. DurvalMenezes commented on Nov 7, 2016

    @DurvalMenezes
    Contributor

    Hi,

    if you did --exclude="????...????*" where you need about 175 ? symbols then that will exclude any files which are too long after crypt.

    For the record, that didn't work for me: I still had many files that provoked the error above (using Amazon Cloud Drive with rclone encryption).

    I determined empiricaly that the maximum length in my situation is 160 characters; anything above that and I got errors.

    So, for me, the two exclude lines that worked were:

    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*
    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*/
    

    Hope that helps.

    Cheers,

    Durval.

  6. added this to the v1.35 milestone on Nov 7, 2016
  7. ncw commented on Nov 7, 2016

    @ncw
    Member

    That really is very ugly isn't it!

    I'll make a new flag --max-name-length which you can use to filter this explicitly

  8. arionl commented on Nov 7, 2016

    @arionl

    Would it be possible to make this somewhat deterministic based on cloud provider configuration? A pretty common use case is using the crypt overlay on top of a normal provider (I'm doing that with AmazonDrive). So if AmazonDrive is limited to a certain length (as documented in the API) and layered crypt further limits this, could rclone take all of this into account in sync/copy/mkdir operations?

  9. modified the milestones: v1.35, v1.36 on Dec 14, 2016
  10. 2600box commented on Jan 4, 2017

    @2600box

    I have this error and I have tried the suggested --exclude and --low-level-retries but the error still shows up.

    is the error preventing further progress?

  11. removed this from the v1.36 milestone on Feb 14, 2017
  12. 9 remaining items

  13. modified the milestones: v1.38, v1.39 on Sep 30, 2017
  14. xerrni commented on Dec 2, 2017

    @xerrni

    another corner case: If you setup second remote to e.g. other_remote:/my_folder_on_other_remote/
    then standard implementation may fail.

  15. modified the milestones: v1.39, v1.40 on Jan 11, 2018
  16. modified the milestones: v1.40, v1.41 on Mar 19, 2018
  17. modified the milestones: v1.41, Soon on Apr 21, 2018
  18. ivandeex commented on Nov 25, 2020

    @ivandeex
    Member

    Related to #4805

  19. albertony commented on Aug 28, 2025

    @albertony
    Contributor

    With the new convmv functionality introduced in v1.70, you now have the alternative of using option --name-transform "all,truncate=160" with your copy/sync/move command. This only limits the length of individual names (path elements), and you may still hit a limit for the total path length. Also, you risk that two files from the source are transformed into the same name at the destination, which may or may not be what you want.

    Please correct me if I'm wrong, @nielash. :)

  20. nielash commented on Aug 30, 2025

    @nielash
    Contributor

    Please correct me if I'm wrong, @nielash. :)

    That is all correct! I would just add that depending on your use case, --name-transform all,truncate_bytes_keep_extension=N might be a better fit. See fe62a2b

    I also think that --max-name-length is still needed, for situations where skipping is preferable to truncating.

    (Btw, writing this comment caused me to realize that the convmv docs are missing some options! I've submitted PR #8786 to address that.)

  21. ncw commented on Aug 30, 2025

    @ncw
    Member

    I note with the advent of regexp filters we can exclude files longer than 100 quite easily with

    --exclude "{{[^/]{101,}}}"
    

    This could probably be extended to directories too (exercise for student ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions