How to resolve the Borg cache error in remote backups.

If you see the following error related to the Borg cache when listing, restoring, or taking manual backups for your Borg remote backups.
Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5089, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 174, in wrapper
    assert_secure(repository, kwargs['manifest'], self.lock_wait)
  File "/usr/lib/python3/dist-packages/borg/cache.py", line 209, in assert_secure
    sm.assert_secure(manifest, manifest.key, lock_wait=lock_wait)
  File "/usr/lib/python3/dist-packages/borg/cache.py", line 174, in assert_secure
    with cache_config:
  File "/usr/lib/python3/dist-packages/borg/cache.py", line 334, in _check_upgrade
    raise Exception('%s does not look like a Borg cache.' % config_path) from None
Exception: /root/.cache/borg/f80e55dff9886465adf97645/config does not look like a Borg cache.
You may simply solve it by following the instructions below:
borg delete --cache-only BorgRepoName

By using the command, you can determine your BorgRepoName

cd /opt/borg;
cat backupInfo.sh;
#It will return output like these:
BORG_PASSPHRASE=xxxxxxxxxxxxxxxxx borg info ssh://xxxxxxxxxxxx.repo.borgbase.com/./repo;

The ssh://xxxxxxxxxxxx.repo.borgbase.com/./repo; is your Borg repo name. You can use that in the command above.

Example:  borg delete --cache-only ssh://xxxxxxxxxxxx.repo.borgbase.com/./repo;


Revision #4
Created 25 August 2023 09:32:47 by Amit Shukla
Updated 25 August 2023 09:41:13 by Amit Shukla