Problem with too long path-/filenames >259 characaters (caused by FreefileySync): cannot delete them anymore

Hello,

I mounted two cryptomator-volumes as drive letters P and G on Windows 10 x64 1903 using Dokany and Cryptomator 1.4.15.
When trying to compare their contents with FreeFileSync a lot of garbage-files are created. Due to a bug in freefilesync - most probably a recursion - the filenames get longer and longer until they are too long.
I cannot delete these files anymore.
They’re longer than 259 characters including the path:

#Powershell
gci G:\ -recurse | select-object FullName, @{Name="Nlength";Expression={$_.Name.Length}} | sort-object FullName | export-Csv -path D:\listD.txt
#Output in D:\listD.txt
\Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del","259"

The explorer view looks like this:

I can delete a few of the shorter ones, but at some point they’re just too long for windows or something like that. Even the shell doesn’t help me:

G:\Myfolder>del *.sync.ffs_lock
G:\Myfolder\Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.sync.ffs_lock
Das System kann den angegebenen Pfad nicht finden.
G:\Myfolder\Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.sync.ffs_lock
Das System kann den angegebenen Pfad nicht finden.
G:\Myfolder\Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.sync.ffs_lock
Das System kann den angegebenen Pfad nicht finden.
G:\Myfolder\Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.sync.ffs_lock
Das System kann den angegebenen Pfad nicht finden.

The debuglog of cryptomator states nothing unusual, e.g. when listing the folder:

13:15:09.555 [Thread-4605] TRACE o.c.frontend.dokany.ReadWriteAdapter - Try to open /MyFolder/del* as File.
13:15:09.555 [Thread-4605] TRACE o.c.frontend.dokany.ReadWriteAdapter - Could not read file attributes.
13:15:09.556 [Thread-4605] TRACE o.c.frontend.dokany.ReadWriteAdapter - File /MyFolder/del* not found.
13:15:09.556 [Thread-4606] TRACE o.c.frontend.dokany.ReadWriteAdapter - zwCreateFile() is called for /MyFolder with the following parameters:
	CreateDisposition -- OPEN_EXISTING
	createOptions -- EnumIntegerSet(elements=[FILE_DIRECTORY_FILE, FILE_SYNCHRONOUS_IO_NONALERT])
	accessMasks -- EnumIntegerSet(elements=[SYNCHRONIZE])
	fileAccessMasks -- EnumIntegerSet(elements=[])
	fileAttributes -- EnumIntegerSet(elements=[]).
13:15:09.557 [Thread-4606] TRACE o.c.frontend.dokany.ReadWriteAdapter - Try to open /MyFolder as Directory.
13:15:09.558 [Thread-4606] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) /MyFolder opened successful with handle 1172.
13:15:09.558 [Thread-4607] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) findFiles() is called for /MyFolder.
13:15:09.559 [Thread-4607] TRACE o.c.cryptofs.CryptoDirectoryStream - OPEN 27f7ea50-907c-4758-a020-23b61f1c60c4
13:15:09.571 [Thread-4607] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) findFiles(): found file Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del
13:15:09.572 [Thread-4607] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) findFiles(): found file Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del

[stripped due to max body size here in the forum]

13:15:09.714 [Thread-4607] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) findFiles(): found file Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del.Del
13:15:09.714 [Thread-4607] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) Successful searched content in /MyFolder.
13:15:09.715 [Thread-4607] TRACE o.c.cryptofs.CryptoDirectoryStream - CLOSE 27f7ea50-907c-4758-a020-23b61f1c60c4
13:15:09.717 [Thread-4608] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) cleanup() is called for /MyFolder.
13:15:09.717 [Thread-4610] TRACE o.c.frontend.dokany.ReadWriteAdapter - (1172) closeFile() is called for /MyFolder.
13:15:12.382 [Thread-4611] TRACE o.c.frontend.dokany.ReadWriteAdapter - zwCreateFile() is called for / with the following parameters:
	CreateDisposition -- OPEN_EXISTING
	createOptions -- EnumIntegerSet(elements=[FILE_DIRECTORY_FILE, FILE_SYNCHRONOUS_IO_NONALERT])
	accessMasks -- EnumIntegerSet(elements=[SYNCHRONIZE])
	fileAccessMasks -- EnumIntegerSet(elements=[])

I had to delete most parts as the debug log is too big for this post.

How can I get rid of these files, please?

(the powershell script was taken from this thread.

1 Like

There’s a problem when using WebDAV instead of Dokany too:
The affected folder that contains the super-long filename looks empty in Windows Explorer.
Other folders are fine, but this one is just empty.

13:31:19.822 [webdav-061] DEBUG o.c.w.core.filters.LoggingFilter - RESPONSE 110:
404
Date: Wed, 28 Aug 2019 11:31:19 GMT

13:31:20.463 [webdav-012] DEBUG o.c.w.core.filters.LoggingFilter - REQUEST 111:
PROPFIND /n0WaKwv_R1CF/Name_of_my_CryptoFolder/MyFolder HTTP/1.1
Connection: keep-alive
User-Agent: Microsoft-WebDAV-MiniRedir/10.0.18362
Host: cryptomator-vault:42427
Content-Length: 0
Depth: 1
translate: f

13:31:20.464 [webdav-012] TRACE o.c.cryptofs.CryptoDirectoryStream - OPEN 27f7ea50-907c-4758-a020-23b61f1c60c4
13:31:20.674 [webdav-012] TRACE o.c.cryptofs.CryptoDirectoryStream - CLOSE 27f7ea50-907c-4758-a020-23b61f1c60c4
13:31:20.701 [webdav-012] DEBUG o.c.w.core.filters.LoggingFilter - RESPONSE 111:
207
Content-Length: 539666
Date: Wed, 28 Aug 2019 11:31:20 GMT
Content-Type: text/xml;charset=utf-8

13:31:20.729 [webdav-016] DEBUG o.c.w.core.filters.LoggingFilter - REQUEST 112:
PROPFIND /n0WaKwv_R1CF/Name_of_my_CryptoFolder/MyFolder/desktop.ini HTTP/1.1
Connection: keep-alive
User-Agent: Microsoft-WebDAV-MiniRedir/10.0.18362
Host: cryptomator-vault:42427
Content-Length: 0
Depth: 0
translate: f

13:31:20.730 [webdav-016] DEBUG o.c.w.core.filters.LoggingFilter - RESPONSE 112:
404
Date: Wed, 28 Aug 2019 11:31:20 GMT

13:31:22.033 [webdav-061] DEBUG o.c.w.core.filters.LoggingFilter - REQUEST 113:
PROPFIND /n0WaKwv_R1CF/Name_of_my_CryptoFolder/MyFolder HTTP/1.1
Connection: keep-alive
User-Agent: Microsoft-WebDAV-MiniRedir/10.0.18362
Host: cryptomator-vault:42427
Content-Length: 0
Depth: 1
translate: f

13:31:22.034 [webdav-061] TRACE o.c.cryptofs.CryptoDirectoryStream - OPEN 27f7ea50-907c-4758-a020-23b61f1c60c4
13:31:22.136 [webdav-061] TRACE o.c.cryptofs.CryptoDirectoryStream - CLOSE 27f7ea50-907c-4758-a020-23b61f1c60c4
13:31:22.159 [webdav-061] DEBUG o.c.w.core.filters.LoggingFilter - RESPONSE 113:
207
Content-Length: 539666
Date: Wed, 28 Aug 2019 11:31:22 GMT
Content-Type: text/xml;charset=utf-8

13:31:22.748 [webdav-012] DEBUG o.c.w.core.filters.LoggingFilter - REQUEST 114:
PROPFIND /n0WaKwv_R1CF/Name_of_my_CryptoFolder/MyFolder HTTP/1.1
Connection: keep-alive
User-Agent: Microsoft-WebDAV-MiniRedir/10.0.18362
Host: cryptomator-vault:42427
Content-Length: 0
Depth: 1
translate: f

13:31:22.750 [webdav-012] TRACE o.c.cryptofs.CryptoDirectoryStream - OPEN 27f7ea50-907c-4758-a020-23b61f1c60c4
13:31:22.850 [webdav-012] TRACE o.c.cryptofs.CryptoDirectoryStream - CLOSE 27f7ea50-907c-4758-a020-23b61f1c60c4
13:31:22.866 [webdav-012] DEBUG o.c.w.core.filters.LoggingFilter - RESPONSE 114:
207
Content-Length: 539666
Date: Wed, 28 Aug 2019 11:31:22 GMT
Content-Type: text/xml;charset=utf-8

You can try on your own risk to enable long path names for windows 10
Please notice: I did not test this myself, I have no experience with this registry change and you should do a complete system backup before you change registry keys

https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation

1 Like

Hello Michael,

thanks for the idea, that unfortunately did not work. Programs like Windows Explorer, Free commander, Total commander, 7zip file manager or even special tools&tricks like long path fixer,, Powershell with AlphaFS-Module,… could not delete the files.

I had to boot linux and use Cryptomator for Linux to delete the files.
Unfortunately even this did not completely help, as a few files could not be seen from linux (empty folder), so I’m still fighting with the issue how to get rid of them.
Must be a limitation of WebDAV and/or Dokany aka Cryptomator :frowning:

1 Like

I had the same problem, anoying :stuck_out_tongue_closed_eyes:

I fixed it with deleting the encrypted files, that means serching the encrypted folder by hand for files of a certain date and time and size (because all the files were generated at the same time) and deleted them. But of course you are never sure if you are deleting the right files, or different ones that you still might need. At least, it worked for me.

Not sure if I will be using freefilesync again or find another tool to sync.

According to a discussion in the FreeFileSync-forum, that’s a bug within Dokany.

Update to Dokany 1.3.0.1000 to get this issue resolved. Remember to uninstall the old version first before installation 1.3.0.100.

Which version of Dokany does Cryptomator 1.4.15 ship?