Command - mount - curious behaviour

Hello,

Kopia is a great backup program. Thank you for your hard work.

I found a curious bug in the mount command. Mounting respiratory works fine, when called within Kopia UI. There’s example of “offending” directory, report its content (note, there are 6 files):
[don’t mind the revere of “/”, that because of 2 “link” limit for the new posters]

Directory of z:/Profiles/xxx.xxx/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail/cur
(…)
6 File(s) 172 519 bytes
2 Dir(s) 45 983 277 056 bytes free

But when using mount command, files are not displayed:

Directory of “z:\xxx@xxx\C_Users_xxxxx_AppData_Roaming_Thunderbird\20220414-141421\Profiles\xxxx.xxx\ImapMail\imap.gmail.com[Gmail].sbd\All Mail\cur”

2022.04.13 16:17 .
File Not Found

Curiously, while accessing that directory, debug command (mount --trace-fs), says:

DEBUG kopia/cli
(Readdir) z:\xxx@txxx\C_Users_xxxx_AppData_Roaming_Thunderbird\20220414-141421\Profiles\xxxx.xxxx\ImapMail\imap.gmail.com[Gmail].sbd\All Mail\cur took 0s and returned 6 items

So, they are “there” but they are not. This is only affected by using “mount” command in the cmd environment (win10). And, yes, I checked already “FileAttributesLimitInBytes” entry in the webclinet registry section, same result. I spotted error/bug by pure chance in the only one respiratory (thunderbird backup) so far, but that bug occurs in the other directories (they are empty) of that respiratory. Btw, shortening backup path doesn’t work either (e.g: backup only “ImapMail” directory instead of whole “profile”, same result.
This text will be blurred

Hi,

When you run kopia backup, does thunderbird/outlook or any other email client is working/opened?
It looks to me as file simply locked by either email client or operation system(that locks files when antivirus scanning them constantly)

Hi,

Quote
When you run kopia backup, does thunderbird/outlook or any other email client is working/opened?

Nope, thunderbird is offline. Point is, respiratory mounted via KopiaUI, does show files fine. Only mounted via cmd, doesn’t .

Try mounting and walk through via --webdav

Hello,

Quote
Try mounting and walk through via --webdav

Well, there’s no difference.

Via cmd mount --webdav --trace-fs

Directory of [z:\xxx@xx\C_Users_xxxx_AppData_Roaming_Thunderbird\20220415-135505\Profiles\xxxx.MyMail\ImapMail\imap.gmail.com[Gmail].sbd\All]
2022.04.15 11:01 .
File Not Found

Debug log:

2022-04-15T15:01:52.872782Z DEBUG kopia/cli Readdir(./xxx@xxx/C_Users_xxxs_AppData_Roaming_Thunderbird/20220415-135505/Profiles/xxxx.MyMail/ImapMail/imap.gmail.com/[Gmail].sbd/All Mail/cur) took 0s and returned 8 items

Note - 8 files.

Mount via KopiaUI:

Directory of [z:\Profiles\xxx.MyMail\ImapMail\imap.gmail.com[Gmail].sbd\All]
2022.04.15 11:01 .
2022.04.15 11:01 …
(…)
8 File(s) 234 273 bytes
2 Dir(s) 45 324 500 992 bytes free

No problem there.

kopiaUI is a simply electron wrapper for kopia that runs with option --ui and replying to kopiaUI requests.

Run kopia snap list and grab 4th field for snapshot in question
then dive up to affected directory with kopia ls -l ObjectID

Can you see those missed files ?

Hm. Yes, they are there (kopia list -l -r to scan subdirectories of that object id). No problem here.

They’re not available in the cmd (file not found) or windows file explorer (just empty directory). Debug massage shows - (DEBUG kopia/cli Readdir(…) took 0s and returned x items) - as normal.

I found a cause of “problem”, file name bellow “makes” directory “invisible”.

“xserial.s56eurDt3DpCxbC+phZB8vR2GcKq9qNkIsMGD6ejpPrNejnEEqSao+Mx%2f96GhQ33+vy+N26WnEJnF6xGdzgFkSMRgeVWzhlSjhyVcqJv2jibQM4=@e.eml”

Long filename together with long path exceeds 220 characters limit of webdav (webclient) server. According to Internet, 220 is a limit. Mount via KopiaUI just shortens path (hops user name, archive name and date of snapshot), so problem in this particular case, do not occur. As I understand, nothing can be done at the Kopia side (maybe some sort of warring?) One must by careful when planning backup archive.

Yes, it operation system restriction, so no, nothing can be done at kopia’s level if it doesn’t use privileged WinAPI (and it shouldn’t), but what you can do, is to fire up kopia’s “action” and call some script where you run 7zip that in turn archive those directories in question since 7zip can go beyond of 220 limit, then just ignore those super long dirs

Maybe you could try mounting under \\?\C:\path\.... See also an explanation here.

Hello Kris,

UNC path as mount point? Ok, I checked your idea in the Powershell (cmd doesn’t use USN paths), and…

Microsoft.PowerShell.Core\FileSystem::\?\z:\xxx@xxx\C_Users_xxxxx_AppData_Roaming_Thunderbird\20220416-143516\Profiles\xxx.MyMail\ImapMail\imap.gmail.com[Gmail].sbd\All Mail\cur> dir
dir : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

But other way to bypass this, is to use a different Webdav client - for example - webdav plugin for Total Commander doesn’t have any problem displaying long paths (also with accessing files bigger than 2GiB).