Borked borg cache & vorta is missing files

I’m using borg together with vorta to backup my user data. I recently might have done something stupid when I followed the instructions in

to purge all files in the .cache folder that are 100 days and older with find ~/.cache/ -type f -atime +100 -delete.

I just realized now, when I’m running Vorta to create another snapshot, it just throws an error saying:

Vorta error log
  File "/usr/lib/python3.11/site-packages/borg/archiver.py", line 5343, in main
    exit_code = archiver.run(args)
                ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/archiver.py", line 5263, in run
    return set_ec(func(args))
                  ^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/archiver.py", line 189, in wrapper
    return method(self, args, repository=repository, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/archiver.py", line 653, in do_create
    with Cache(repository, key, manifest, progress=args.progress,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/cache.py", line 387, in __new__
    return local()
           ^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/cache.py", line 378, in local
    return LocalCache(repository=repository, key=key, manifest=manifest, path=path, sync=sync,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/cache.py", line 487, in __init__
    self.open()
  File "/usr/lib/python3.11/site-packages/borg/cache.py", line 542, in open
    self.rollback()
  File "/usr/lib/python3.11/site-packages/borg/cache.py", line 662, in rollback
    self._do_open()
  File "/usr/lib/python3.11/site-packages/borg/cache.py", line 525, in _do_open
    with IntegrityCheckedFile(path=os.path.join(self.path, 'chunks'), write=False,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borg/crypto/file_integrity.py", line 129, in __init__
    self.file_fd = override_fd or open(path, mode)
                                  ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.cache/borg/387664883ebbc91fe056f3d4cfa60fc9978gh138823bb289a848169fffdf1e97/chunks'

It says something about a missing file/directory. I’ve checked and can confirm that the ‘chunks’ file/directory referred to doesn’t exist. I’ve installed Vorta via AUR just to mention it but I think the error it shows really goes back to me borking the cache.

Is there something I can do to fix the problem or is my repository damaged beyond repair? The thing is, the .cache folder is exempt from my borg backups. That’s why I don’t have a copy of the old cache files to restore a prior state.

Is there some way to restore/rebuild the cache on my desktop PC or is the repository on my external USB harddrive now junk and I have to start over?

You would need to explain this to the developers of vorta and/or borg.
A system that relies on anything inside .cache is not good. A cache can vanish anytime.

1 Like

I’ve asked the BorgBackup people in LiberaChat. Just as I suspected, this wasn’t an AUR issue. Vorta was running fine. The problem was ‘borg’ (installed from the ‘extra’ repository) running in the background.

A simple

borg delete --cache-only /run/media/user/usb_hdd/repo_path

deleted the borked cache and upon the next backup, Borg started rebuilding the faulty cache and Vorta successfully completed a new backup archive. :+1:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.