attic icon indicating copy to clipboard operation
attic copied to clipboard

Cache is newer than repository, refusing to continue

Open TnTBass opened this issue 10 years ago • 4 comments

I am running into an error with my repository when I attempt to run a prune command.

attic prune attic-backup@myserver:mybackup-42977.attic -H 0 -d 7 -w 4 -m 12 -y 0 -v

"attic: Error: Cache is newer than repository, refusing to continue"

However, I am stuck. How do I clear up the cache, or more generically, how do I resolve this error?

Running: Attic 0.13 - Deduplicated Backups

TnTBass avatar Oct 22 '14 19:10 TnTBass

In an attempt to fix this, I removed the .cache folder located in my home directory. I am hoping this was a safe move.

TnTBass avatar Oct 23 '14 05:10 TnTBass

This check is in place to detect when a repository has been replaced with an older copy of itself. This happens naturally is situations like when the repository itself is restored from backups. But it could also mean that an adversary is trying something. Did you do something special with the repository before this prune command?

Anyway, removing the cache folder is always safe but might be a bit time consuming to rebuild.

jborg avatar Oct 26 '14 20:10 jborg

Things that might improve the user experience:

  • Report the repository UUID in the error message
  • Report the local time in the cache / vs remote time of the repository

Maybe add an "attic cache" command with various options to do things like refresh / overwrite / force-update a specific UUID. To fix the option in my case I had to:

  1. Find out which UUID related to the repository on the remote system
  2. Remove the contents of that cache directory on the local system (source of the files to be backed up) rm ~/.cache/attic/65d3adcd5d7e3e2c9ba7c6333e3f9d154a141f2620c2966cf74ffd64b952e9ee/*
  3. Remove the now empty directory rmdir ~/.cache/attic/65d3adcd5d7e3e2c9ba7c6333e3f9d154a141f2620c2966cf74ffd64b952e9ee/

So maybe being able to type the following would be easier:

# attic cache --reset 65d3adcd5d7e3e2c9ba7c6333e3f9d154a141f2620c2966cf74ffd64b952e9ee

Note sure if "--reset" is best wording choice. Alternate options might be "--wipe" or "--delete".

tgharold avatar Dec 09 '14 16:12 tgharold

I am doing some tests with "borg recreate" and, as it is an experimental feature, before doing so I copied the repository with another name before that. Now I want to use the original repository renaming it to its original name and I get the message: "Cache, or information obtained from the security directory is newer than repository - this is either an attack or unsafe (multiple repos with same ID)".

Yes, they are newer than the repository, for sure. Is there any way I could use the old repository? Removing the cache of that repository did not help.

Fibroblasto avatar Nov 22 '19 01:11 Fibroblasto