When copying files with long paths (more than 260 characters) to a remote, I get a load of I/O errors and rclone fails to copy the files. Copying through a mount or copying via CLI both produce this error.
In the linked thread, it was suggested to enable long paths through the registry/group policy editor (gpedit.msc). So I did that, but the errors still keep popping up (OP also mentioned this).
My question is, is this something that Windows users just have to live with? Or is there something I can do to fix the errors?
It would be great if there actually is a way to handle longer paths with rclone on Windows.
Also, sorry for creating a new thread, but the old one drifted off the main question, never reached a solution and got closed due to inactivity.
And please note that I really appreciate all the work you guys do for rclone; this issue is my only gripe with rclone, apart from that it's been the perfect tool for managing all my cloud data.
What is your rclone version (output from rclone version)
rclone v1.53.3
os/arch: windows/amd64
go version: go1.15.5
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Windows 10 Education 64 bit
Which cloud storage system are you using? (eg Google Drive)
Simple log (without -vv) when copying file into mount through explorer:
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: vfs cache: detected external removal of cache file
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: vfs cache: failed to open item: vfs cache item: check object failed: vfs cache item: open truncate failed: vfs cache: truncate: failed to open cache file: The system cannot find the path specified.
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: Non-out-of-space error encountered during open
2020/12/07 17:35:25 ERROR : IO error: cache open with O_TRUNC: failed to truncate: open RW handle failed to open cache file: vfs cache item: check object failed: vfs cache item: open truncate failed: vfs cache: truncate: failed to open cache file: The system cannot find the path specified.
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: vfs cache: detected external removal of cache file
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: vfs cache: failed to open item: vfs cache item: check object failed: vfs cache item: open truncate failed: vfs cache: truncate: failed to open cache file: The system cannot find the path specified.
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: Non-out-of-space error encountered during open
2020/12/07 17:35:25 ERROR : IO error: cache open with O_TRUNC: failed to truncate: open RW handle failed to open cache file: vfs cache item: check object failed: vfs cache item: open truncate failed: vfs cache: truncate: failed to open cache file: The system cannot find the path specified.
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: vfs cache: detected external removal of cache file
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: vfs cache: failed to open item: vfs cache item: check object failed: vfs cache item: open truncate failed: vfs cache: truncate: failed to open cache file: The system cannot find the path specified.
2020/12/07 17:35:25 ERROR : video/movie/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu) [1080p x265 10bit BD Dual Audio AAC 5.1]/[Arukoru] Steins Gate the Movie - Load Region of Deja Vu (Steins Gate - Fuka Ryouiki no Deja vu).mkv: Non-out-of-space error encountered during open
2020/12/07 17:35:25 ERROR : IO error: cache open with O_TRUNC: failed to truncate: open RW handle failed to open cache file: vfs cache item: check object failed: vfs cache item: open truncate failed: vfs cache: truncate: failed to open cache file: The system cannot find the path specified.
Yeah, now that you mention it I remember reading about that limitation in the docs, but I never really thought about it. And I've been uploading files to the crypt remote with paths that are up to 260 chars (definitely over ~143) without any issues.
I just tried again with "rclone copy" and this time it worked out, even though the path is longer than 260. I don't know what I did different from when I tried yesterday, but it worked out. This effectively is a good enough workaround for me.
The question would be, why does it error out when copying to the mount through explorer?
I'm reasonably sure this is the VFS cache not using UNC paths on Windows but I'm not 100% certain. If it is that problem then you'll see problems with vfs cache mode full but not off.
I should really look at the code more before making wild statments...
It looks like the cache backend does support UNC paths
And the log here supports that
However from the log above it looks like the paths haven't been converted to UNC paths
2020/12/09 01:50:35 DEBUG : vfs cache: root is "F:vfs\\local\\C\\test"
2020/12/09 01:50:35 DEBUG : vfs cache: metadata root is "F:vfs\\local\\C\\test"
Looking at the code it seems to be expecting the drive letter to end with a \ - if you don't then isn't it making a relative path? If it isn't making a relative path then the library needs fixing. Some guidance from Windows users here would be helpful
Try using --cache-dir F:\ - hopefully that will work.
the current behaviour is correct, no fix should be needed. dir c: is the equivalent to dir . and dir .\
the OP made a common mistake or a typo, that was around when i was using DOS.
if i set --cache-dir=c:test, then a folder named test will be created in a sub-folder of the current working folder.
2020/12/09 17:47:06 DEBUG : rclone: Version "v1.53.3" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "mount" "gdrive-a1b2:" "b:\\mount\\rclone\\gdrive-a1b2" "--dir-cache-time=15s" "--rc" "--log-file=.\\log.mount.gdrive-a1b2.txt" "--log-level=DEBUG" "--vfs-cache-mode=full" "--cache-dir=c:test"]
2020/12/09 17:47:06 NOTICE: Serving remote control on http://127.0.0.1:5572/
2020/12/09 17:47:06 DEBUG : Creating backend with remote "gdrive-a1b2:"
2020/12/09 17:47:06 DEBUG : Using RCLONE_CONFIG_PASS password.
2020/12/09 17:47:06 DEBUG : Using config file from "c:\\data\\rclone\\scripts\\rclone.conf"
2020/12/09 17:47:06 DEBUG : gdrive-a1b2: Loaded invalid token from config file - ignoring
2020/12/09 17:47:07 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
2020/12/09 17:47:07 DEBUG : gdrive-a1b2: Saved new token in config file
2020/12/09 17:47:07 DEBUG : vfs cache: root is "c:test\\vfs\\gdrive-a1b2"
2020/12/09 17:47:07 DEBUG : vfs cache: metadata root is "c:test\\vfs\\gdrive-a1b2"
2020/12/09 17:47:07 DEBUG : Creating backend with remote "c:test\\vfs\\gdrive-a1b2"
2020/12/09 17:47:07 DEBUG : fs cache: renaming cache item "c:test\\vfs\\gdrive-a1b2" to be canonical "//?/c:/data/rclone/scripts/rr/other/mount/test/vfs/gdrive-a1b2"
2020/12/09 17:47:07 DEBUG : fs cache: switching user supplied name "c:test\\vfs\\gdrive-a1b2" for canonical name "//?/c:/data/rclone/scripts/rr/other/mount/test/vfs/gdrive-a1b2"
2020/12/09 17:47:07 DEBUG : Google drive root '': Mounting on "b:\\mount\\rclone\\gdrive-a1b2"
Where the cache directory is created won't change with the patch above
The same thing will happen, however rclone will use UNC paths which will mean paths longer than 260 chars will work properly - you can see it isn't using UNC paths here.
I just tried the patch and passed in "F:" as the cache dir (without the trailing backslash) and it did use UNC paths.
I also tried the current stable version (v1.53.3) and passed in "F:\" as the cache dir (with a trailing backslash, as suggested by @asdffdsa), and this also caused it to use UNC paths.
I'm not too sure whether I understood the previous messages correctly, but when not adding a backslash to the cache dir (--cache-dir "F:"), rclone didn't treat it as a relative path, but an absolute one, meaning the cache files were created in the root of drive F: Not sure whether this is relevant though.