Solved: no matching ID found for prefix after update to 0.13.0

The first backup after updating to 0.13 gave me this output from my cron script:

Ignoring "7276c03d43178fca": no matching ID found for prefix "7276c03d43178fca"
Ignoring "7276c03d43178fca": no matching ID found for prefix "7276c03d43178fca"

7276c03d is yesterdays snapshot id, 43178fca is todays.
I imagine the first line is from the backup, the second line from the forget operation.

I also noticed that lots of data was removed / re-uploaded.

These are the changes between last 2 snapshots
Files:         177 new,     0 removed,    20 changed
Dirs:           12 new,     0 removed
Others:          0 new,     0 removed
Data Blobs:   2179 new,  2035 removed
Tree Blobs:     21 new,    11 removed
  Added:   1.217 GiB
  Removed: 1.186 GiB


Edit: While checking things I found that the last snapshot does not have a parent. Possibly the reason for the long backup / huge upload.

Huh, that’s odd and unexpected!

  • Do you (in your script) manually set the parent?
  • What was the last version of restic that worked? 0.12.1?

The only thing that I can see that we changed from 0.12.1 to 0.13.0 in the ID matching function is

Hm. It also works for me.

Depending on what you’re doing exactly in your script this may be a bug…

Do you (in your script) manually set the parent?

Nope, I set some variables and then do
$RESTIC backup --quiet --cache-dir $CACHE $BACKUP_PATH | tee -a $LOG

What was the last version of restic that worked? 0.12.1?

Upon further inspection, I think there may be 2 (unrelated?) issues going on here.

Issue 1 - (kind of solved): Ignoring "7276c03d43178fca": no matching ID [...]
After the backup, I gather some stats about the last backup and write it to a sqlite DB (to display them on an internal website). The command I use(d) to get the id of the last snapshot was:
restic snapshots --latest 1 --json |jq -r '.[] .short_id'
With 0.12.1, that output a single id. With 0.13, this gives me 2 snapshot ids. Thing is: To verify, I re-downloaded restic 12.1 and it also gives me 2 snapshot ids. Go figure. Anyway, later in the script I re-use that $id and this fails, producing the 2 lines
Ignoring "7276c03d43178fca": no matching ID found for prefix "7276c03d43178fca".

Solution: I now use restic snapshots latest --json, which gives me a single id.

What puzzles me: In the database where I log backups I can clearly see that yesterday, I only got 1 id back from the json. And I sure was not on 0.12, because that one doesn’t know the flag --latest.
Anyway, that’s demystified (enough for me to call it solved).

Issue 2 - (solved): snapshot made with 0.13 is missing the parent
I had added a new folder to the backup, may that be the reason? (Just saw #2246 on github: Parent-snapshot detection fails with changing --files-from (not through the whole ticket thread yet).

Update: Made some tests (man, the dry-run feature comes in handy*) and it’s indeed just my crappy scripting (issue 1) and the addition of the folder to the backup (issue 2).

* I can’t thank you enough for the dry-run feature. Well, that, and for restic as a whole. :smiley:

ATM, only snapshots with identical path(s) are taken into account as parent snapshots.

would solve this.

That PR looks like a good idea. You also kept it rebased… and even included documentation!
Any idea what’s needed to get that merged (fd0 hasn’t commented on that PR)?