Skip to content

google drive: directory not found when its name has accent #1675

Closed

Description

@lazaro-binda

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

rclone v1.37-127-ga91448c8β
os/arch: linux/amd64
go version: go1.9

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

Kali Linux 64 bit

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

Google Drive

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

rclone lsd lazaro:GranCursos\ PRÓ

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

2017/09/12 10:06:25 DEBUG : rclone: Version "v1.37-127-ga91448c8β" starting with parameters ["rclone" "lsd" "lazaro:GranCursos PRÓ" "-vv"]
2017/09/12 10:06:27 INFO  : Google drive root 'GranCursos PRÓ': Modify window is 1ms
2017/09/12 10:06:27 ERROR : : error listing: directory not found
2017/09/12 10:06:27 Failed to lsd: directory not found
2017/09/12 10:07:06 DEBUG : rclone: Version "v1.37-127-ga91448c8β" starting with parameters ["rclone" "-vv" "lsd" "lazaro:"]
2017/09/12 10:07:06 INFO  : Google drive root '': Modify window is 1ms
          -1 2017-09-11 21:46:00        -1 GranCursos PRÓ
2017/09/12 10:07:07 DEBUG : Go routines at exit 4
2017/09/12 10:07:07 DEBUG : rclone: Version "v1.37-127-ga91448c8β" finishing with parameters ["rclone" "-vv" "lsd" "lazaro:"]

The problem is the accent in directory name. If I take if off, I can list it.

Activity

  1. ncw commented on Sep 12, 2017

    @ncw
    Member

    I can replicate this

    $ rclone mkdir "drive:test/GranCursos PRÓ"
    $ rclone ls "drive:test/GranCursos PRÓ"
    2017/09/12 13:48:31 ERROR : : error listing: directory not found
    2017/09/12 13:48:31 Failed to ls: directory not found
    $ rclone lsd "drive:test"
              -1 2017-09-12 12:48:24        -1 GranCursos PRÓ
    

    Debugging further...

    rclone -vv --dump-bodies ls "drive:test/GranCursos PRÓ" 2>&1 | less
    

    Gives this, which means that drive isn't finding the entry when rclone searches for it.

    2017/09/12 21:43:05 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    2017/09/12 21:43:05 INFO  : Google drive root 'test/GranCursos PRÓ': Modify window is 1ms
    2017/09/12 21:43:05 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    2017/09/12 21:43:05 DEBUG : HTTP REQUEST (req 0xc420200600)
    2017/09/12 21:43:05 DEBUG : GET /drive/v2/files?alt=json&fields=items%28id%2CdownloadUrl%2CexportLinks%2CfileExtension%2CfullFileExtension%2CfileSize%2Clabels%2Cmd5Checksum%2CmodifiedDate%2CmimeType%2Ctitle%29%2CnextPageToken&maxResults=1000&q=trashed%3Dfalse+and+%270BzSw5cyzKmgvWi1CMXBnckJHSEE%27+in+parents+and+title%3D%27GranCursos+PR%C3%93%27+and+mimeType%3D%27application%2Fvnd.google-apps.folder%27 HTTP/1.1
    Host: www.googleapis.com
    User-Agent: rclone/v1.37-124-gae836784-onedrive_business.bak
    Authorization: XXXX
    Accept-Encoding: gzip
    
    2017/09/12 21:43:05 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    2017/09/12 21:43:06 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    2017/09/12 21:43:06 DEBUG : HTTP RESPONSE (req 0xc420200600)
    2017/09/12 21:43:06 DEBUG : HTTP/1.1 200 OK
    Content-Length: 17
    Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35"
    Cache-Control: private, max-age=0, must-revalidate, no-transform
    Content-Type: application/json; charset=UTF-8
    Date: Tue, 12 Sep 2017 20:43:06 GMT
    Etag: "qGKpLTApfAmcN95SK7GXZAX7q2A/skD00QgZZ0FB6U5ufzrrxrFjqyA"
    Expires: Tue, 12 Sep 2017 20:43:06 GMT
    Server: GSE
    Vary: Origin
    Vary: X-Origin
    X-Content-Type-Options: nosniff
    X-Frame-Options: SAMEORIGIN
    X-Xss-Protection: 1; mode=block
    
    {
     "items": []
    }
    

    I tried the equivalent query in the API explorer with no results also

    trashed=false and '0BzSw5cyzKmgvWi1CMXBnckJHSEE' in parents and title='GranCursos PRÓ' and mimeType='application/vnd.google-apps.folder'
    

    Which makes me wonder if this is a bug in drive itself...

    If I try with a very similar (encoding wise) unicode character it works fine

    $ rclone mkdir "drive:test/GranCursos PR£"
    $ rclone ls "drive:test/GranCursos PR£"
    $
    
    >>> u"£".encode("utf-8")
    '\xc2\xa3'
    >>> u"Ó".encode("utf-8")
    '\xc3\x93'
    

    Which again points to a bug in drive. I found a possibly related stack overflow question.

  2. added this to the Known Problem milestone on Sep 12, 2017
  3. changed the title [-]Directory not found when its name has accent[/-] [+]google drive: directory not found when its name has accent[/+] on Sep 12, 2017
  4. ncw commented on Sep 13, 2017

    @ncw
    Member

    A bit more searching found that this is a known issue in google drive which was acknowledged on 18th August 2017, so hopefully they will fix it soon.

  5. robjlg commented on Sep 21, 2017

    @robjlg

    Hi, I also reached this error. My tests showed that only names with upper case accents character has this error. Accents lower case character are OK!

    CONVENÇÕES == ERROR
    Convenções == OK !

    Ç == ERROR
    ç == OK !

    rclone can sync or copy folders with upper case accents characters but can not see it after copy resulting in duplicate folders names on next sync.

    Important to note that gdrive ( https://github.com/prasmussen/gdrive ) can find those folders but drive (https://github.com/odeke-em/drive ) can not.

    Besides the files and folders are there, this bug are generating lots of duplicate folders and files and left a mess behind it. On some cases it is almost impossible to sync because of lots of unnecessary file transfers that are already on DRIVE.

    It appears that rclone dedup can fix the mess but can take a lot to finish and the mess is made again on the syncs to come.

    Please, let me know if more information is needed.

    Thank you

    Roberto

    rclone: Version "v1.37" s

    rclone: Version "v1.37-157-g5a3a56abβ"

    gdrive: 2.1.0
    Golang: go1.6
    OS/Arch: linux/amd64

    drive version: 0.3.9.1
    Commit Hash: '1cb01ece65b6d9d39060da1ecf2a440a90b24954'
    Go Version: go1.8.3
    OS: linux/amd64
    BuildTime: 2017-05-29 14:38:38.77322112 -0300 BRT

    LINUX CENTOS

  6. robjlg commented on Sep 21, 2017

    @robjlg

    I do not know how rclone and gdrive implement the folder / file search but, maybe, the gdrive's strategy could be used as a workaround for this bug

  7. robjlg commented on Sep 28, 2017

    @robjlg

    Hi,

    I will provide here some more information about this error in an hope that can help in some way.

    It fast become a major problem because, for some folders, it is almost impossible to sync. Rclone will transfer lots of big folders (which has upper case accents characters on it's name) instead of just a few changed files.

    My new tests include the --backup-dir option and showed the following details:

    1 - Just folders are affected. Files worked as expected, even if it has upper case accent characters on name.

    Example: rclone sync Contrução works like a charm ( --backup-dir=TST_UPPER_ACCENT_BAK )

    
     rclone lsl  GDRV_SYNC:MHA_RSYNC/TST_UPPER_ACCENT
          157 2017-09-28 14:18:05.887000000 Construção/ACENTUAÇÃO.txt
          157 2017-09-28 14:17:47.638000000 Construção/Acentuação.txt
    
       rclone lsl  GDRV_SYNC:MHA_RSYNC/TST_UPPER_ACCENT/Construção
          225 2017-09-28 15:09:34.801000000 ACENTUAÇÃO.txt
          224 2017-09-28 15:09:20.333000000 Acentuação.txt
    
       rclone lsl  GDRV_SYNC:MHA_RSYNC/TST_UPPER_ACCENT_BAK
          157 2017-09-28 14:18:05.887000000 Construção/ACENTUAÇÃO.txt__2017_09_28_150804
          190 2017-09-28 15:00:54.551000000 Construção/ACENTUAÇÃO.txt__2017_09_28_150940
          157 2017-09-28 14:17:47.638000000 Construção/Acentuação.txt__2017_09_28_150804
          190 2017-09-28 15:01:17.446000000 Construção/Acentuação.txt__2017_09_28_150940
    
    

    2 - rclone ls can not list the whole path but can correctly list it's parents

    Example: rclone sync CONSTRUÇÃO creates a new folder every sync and, naturally, not send older files to the --backup_dir. After 3 syncs, there are 3 folders CONSTRUÇÃO !

    
      rclone lsl  GDRV_SYNC:MHA_RSYNC/TST_UPPER_ACCENT/CONSTRUÇÃO
    2017/09/28 15:00:08 ERROR : : error listing: directory not found
    2017/09/28 15:00:08 Failed to lsl: directory not found
    
     rclone lsl  GDRV_SYNC:MHA_RSYNC/TST_UPPER_ACCENT
          225 2017-09-28 15:09:34.801000000 Construção/ACENTUAÇÃO.txt
          224 2017-09-28 15:09:20.333000000 Construção/Acentuação.txt
           79 2017-09-28 14:13:13.454000000 CONSTRUÇÃO/ACENTUAÇÃO.txt
           80 2017-09-28 14:12:52.605000000 CONSTRUÇÃO/Acentuação.txt
           79 2017-09-28 14:13:13.454000000 CONSTRUÇÃO/ACENTUAÇÃO.txt
           80 2017-09-28 14:12:52.605000000 CONSTRUÇÃO/Acentuação.txt
           79 2017-09-28 14:13:13.454000000 CONSTRUÇÃO/ACENTUAÇÃO.txt
           80 2017-09-28 14:12:52.605000000 CONSTRUÇÃO/Acentuação.txt
    
    
    

    3 - rclone dedupe did not work as it find 3 identical files which, at really was not

    Example: rclone -vvv dedupe --dedupe-mode newest GDRV_SYNC:/MHA_RSYNC/TST_UPPER_ACCENT

    2017/09/28 16:18:06 DEBUG : rclone: Version "v1.37" starting with parameters ["rclone" "-vvv" "dedupe" "--dedupe-mode" "newest" "GDRV_SYNC:/MHA_RSYNC/TST_UPPER_ACCENT" "--log-file=gdrive/log/rc_dedup_TST_ACCENT___2017_09_28_161806.log"]
    2017/09/28 16:18:08 INFO  : Google drive root 'MHA_RSYNC/TST_UPPER_ACCENT': Modify window is 1ms
    2017/09/28 16:18:08 INFO  : Google drive root 'MHA_RSYNC/TST_UPPER_ACCENT': Looking for duplicates using newest mode.
    2017/09/28 16:18:10 NOTICE: CONSTRUÇÃO/ACENTUAÇÃO.txt: Found 3 duplicates - deleting identical copies
    2017/09/28 16:18:10 NOTICE: CONSTRUÇÃO/ACENTUAÇÃO.txt: Deleting 2/3 identical duplicates (md5sum "04f7b7e7f88eba4e90722888bbfb6ee3")
    2017/09/28 16:18:11 INFO  : CONSTRUÇÃO/ACENTUAÇÃO.txt: Deleted
    2017/09/28 16:18:11 ERROR : CONSTRUÇÃO/ACENTUAÇÃO.txt: Couldn't delete: googleapi: Error 404: File not found: 0BzCak_U8Q6SpbjNnZmRiQThfcU0, notFound
    2017/09/28 16:18:11 NOTICE: CONSTRUÇÃO/ACENTUAÇÃO.txt: All duplicates removed
    2017/09/28 16:18:11 NOTICE: CONSTRUÇÃO/Acentuação.txt: Found 3 duplicates - deleting identical copies
    2017/09/28 16:18:11 NOTICE: CONSTRUÇÃO/Acentuação.txt: Deleting 2/3 identical duplicates (md5sum "abcff84bf3f207024205f6526c032e70")
    2017/09/28 16:18:11 INFO  : CONSTRUÇÃO/Acentuação.txt: Deleted
    2017/09/28 16:18:12 ERROR : CONSTRUÇÃO/Acentuação.txt: Couldn't delete: googleapi: Error 404: File not found: 0BzCak_U8Q6SpcVdMeFB3NE9pZVk, notFound
    2017/09/28 16:18:12 NOTICE: CONSTRUÇÃO/Acentuação.txt: All duplicates removed
    2017/09/28 16:18:12 DEBUG : Go routines at exit 10
    
    
    

    Any more info, please let me know

    Thank you

    Roberto

  8. ncw commented on Sep 29, 2017

    @ncw
    Member

    Alas this is a problem with Google drive - see the issue I linked above. Some kind of workaround may be possible though, however I'm hoping Google will fix the issue instead!

  9. ncw commented on Oct 9, 2017

    @ncw
    Member

    I'm going to re-open this so other users can track the progress

  10. reopened this on Oct 9, 2017
  11. B4dM4n commented on Jan 29, 2018

    @B4dM4n
    Collaborator

    Once #2007 is merged i propose the commit referenced above to work around this issue as there is no update from Google until now.

  12. 8 remaining items

  13. modified the milestones: Known Problem, v1.40 on Feb 27, 2018
  14. B4dM4n commented on Feb 27, 2018

    @B4dM4n
    Collaborator

    I will close this issue, as the workaround merged.

    Once Google fixes issue 64468406 the workaround can be removed.

  15. oshliaer commented on Jun 8, 2018

    @oshliaer

    The issue 64468406 is marked as fixed

  16. ncw commented on Jun 8, 2018

    @ncw
    Member

    What do you think @B4dM4n - remove this work-around now?

  17. B4dM4n commented on Jun 8, 2018

    @B4dM4n
    Collaborator

    Unfortunately not completely.

    Running the query name = 'TestÄ' in a folder containing the entries Testä and TestÄ yields the following result:

    {
     "kind": "drive#fileList",
     "incompleteSearch": false,
     "files": [
      {
       "kind": "drive#file",
       "id": "1-Lnf__NarPOxWUASeTlqP-jBo3D0Gn08",
       "name": "TestÄ",
       "mimeType": "application/vnd.google-apps.folder"
      },
      {
       "kind": "drive#file",
       "id": "1eJt_Ojk9rs1nZKgtuZZ0LvP0c1aOhs4k",
       "name": "Testä",
       "mimeType": "application/vnd.google-apps.folder"
      }
     ]
    }

    Before the fix name = 'TestÄ' would return nothing, now it returns multiple entries.

    We can change the contains operator in drive.go#L297 to =, but the cleanup code in drive.go#L345 needs to stay.

  18. ncw commented on Jun 8, 2018

    @ncw
    Member

    It seems from a quick bit of testing that the = operator is case insensitive (which no-one ever noticed!) - that doesn't seem to be documented.

    So we can remove that contains which I guess may make things more efficient.

  19. added a commit that references this issue on Jun 10, 2018
  20. ncw commented on Jun 10, 2018

    @ncw
    Member

    I've changed the contains to = in 4d793b8

  21. vlakoff commented on Aug 15, 2018

    @vlakoff

    As I stated on the Google ticket, there's still trouble with folders meeting these criterias:

    • folder name contains a single quote (e.g. foo'bar)
    • and folder is not empty
  22. B4dM4n commented on Aug 15, 2018

    @B4dM4n
    Collaborator

    This issue has been fixed in rclone since v1.40.

    If you still have problems with Google Drive, please open a new issue with more error details.

  23. Inambe commented on Oct 11, 2020

    @Inambe

    For me it was that I was running rclone ls google-drive and not rclone ls google-drive:/

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

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions