Corrupt cache file prevents kopia from working

For whatever reason one of my cache files can’t be accessed anymore:

> ll /home/peter/.cache/kopia/e108c0ada267f55e/contents/f6/
ls: cannot access '/home/peter/.cache/kopia/e108c0ada267f55e/contents/f6/7656d42fcb3c3a3897b568d2e91bb8.1102.2.0.f': Input/output error
total 18M
-rwxrwxrwx 1 peter root 480 Okt 23 11:29 00352ba44335aef90b3b4aed1b1894.1102.2.0.f
-rwxrwxrwx 1 peter root 979 Okt 23 11:53 00801e4ca484b134d92d2bdafe0d79.1102.2.0.f
...
-rwxrwxrwx 1 peter root 251 Okt 17 14:06 734fbc7470cd4996ac7925cc9a5758.1102.2.0.f
-????????? ? ? ? ? ? 7656d42fcb3c3a3897b568d2e91bb8.1102.2.0.f
-rwxrwxrwx 1 peter root 5,4K Okt 17 14:14 7df18bc7b0ee2fd6388d7d5395774f.1102.2.0.f

When I try to run any kopia command, it fails:

> kopia repository status
ERROR failed to open repository: unable to create shared content manager: error setting up read manager caches: unable to initialize content cache: unable to create base cache: error durin
g initial scan of contents: error listing contents: error processing directory shards: error reading directory: lstat /home/peter/.cache/kopia/e108c0ada267f55e/contents/f6/7656d42fcb3c3
a3897b568d2e91bb8.1102.2.0.f: input/output error
ERROR open repository: unable to open repository: unable to create shared content manager: error setting up read manager caches: unable to initialize content cache: unable to create base c
ache: error during initial scan of contents: error listing contents: error processing directory shards: error reading directory: lstat /home/peter/.cache/kopia/e108c0ada267f55e/contents
/f6/7656d42fcb3c3a3897b568d2e91bb8.1102.2.0.f: input/output error

Maybe, if cache is corrupt, kopia should warn instead and continue. I’d guess a missing cache file is not crucial to proceed?

AFAIK, cache can be changed or removed though then the next run will be longer to create it. If you don’t want to delete everything in /home/peter/.cache/kopia/e108c0ada267f55e/contents/ then instead you can change the cache directory to a new empty directory and see if that fixes it. This would retain your old cache directory.

But I must say, input.output error sounds like a corrupted disk. That may be a serious issue, not a kopia issue.

Yes, agree. There is a real disk fault there which fsck may or may not find but even if you remove the .cache-file, the next piece of data ending up on those sectors will also be broken, most likely.

It is one of those “run (not walk) to computer store to purchase replacement disk” signals.

2 Likes

Thanks for your help! Got it working again by removing the corrupt cache files.

I hope the disk is alright - the problem happened shortly after I switched the driver for this partition from ntfs-3g to ntfs3. Now I’m back to ntfs-3g, fingers crossed …

Nevertheless, I think kopia could be a little more tolerant here.

Usually, when you logout of a repo, the cache gets removed.

Using writeable NTFS filesystem on Linux is never good idea. Neither NTFS drivers’ implementation is perfect. They are good for ad-hoc access but not for production use.

The reason is that NTFS is propriety filesystem and nobody (but Microsoft) knows all its details hence on Linux you can be sure that both ntfs-3g and ntfs3 (as not provided by Microsoft) lack some functionality.