Snapshots not showing with snapshot command

Hello All,

I’ve recently noticed that when I use the command to list the snapshots in my repository, that the snapshots that have tags assigned to them are missing. I thought that perhaps I somehow messed up with the script that I’m using for running restic and that they were removed when running the forget command.

I no longer think that is the case because when I now create a new snapshot, the snapshot is created successfully, but it’s not showing up when I use the command to list my snapshots.

When I look in the snapshots folder on my USB drive, I can see the newly created snapshot ID, even though it doesn’t show with the command to list the snapshots.

Any reason why this would be so?

I’m running restic version 0.16.0 on Fedora and saving the repo to a USB drive.

Thanks for any and all help!

1 Like

Please be more specific, for example include the obvious thing which is the actual commands you run to reproduce this problem (and preferably the output of them, showing the issue) :+1:

1 Like

Sorry for the lack of information.
The command that I’m using in my script to create the new snapshot is as follows:

restic --password-file <( gpg --decrypt “$FILE”) backup -r “$usb_path” -v --exclude-file “$exclude” ~/

And what I’m using to list the snapshots is:

restic --password-file <( gpg --decrypt “$FILE”) snapshots -c -r “$usb_path”

The $usb_path is defined earlier on in the script and must be correct, because I’m able to mount the repository using the mount command and it uses the same path.

Do you apply the tags manually afterwards? Can you show the command for that too? I don’t see anything in your backup command above that adds tags to the snapshot.

FWIW, I see snapshots that have tags on them just fine when I run the snapshots command, and I’m suspecting it’s something local to your setup/case, otherwise others would have reported it as well by now :slight_smile:

What I use for the tags is below:

restic --password-file <( gpg --decrypt “$FILE”) tag --add “$input1” “$input2” -r “$usb_path”

What’s strange is that I’ve been seeing different things happening. When I would create a snapshot it would give me the parent snapshot that it’s using and then tell me that the new snapshot was created and give me the ID for that. But, then when I either check the snapshot folder or run the command to list the snapshots, that newly created ID is not present, even though it just said it was created.

I tried it again, it says it creates a new snapshot (as above) and now it’s there in both the snapshot folder and when using the snapshot list command.

So it seems to be an intermittent issue.

Can you verify that $input2 contains a snapshot ID?

Please note that when you run the tag command to add a tag to a snapshot like this, the snapshot is rewritten and thereby gets a new ID. This might explain the snapshot IDs you feel are missing.

That said, I cannot reproduce the problem. When I list snapshots, they all show just fine, including those having tags. If you can’t figure out what’s causing the observations you’re making, please include a log of the complete commands (with non-sensitive variables substituted) and all of their output so we can see the actual data and symptoms.

What I’m seeing now is that it’s not specific to snapshots with tags. I first noticed the issue when some of my snapshots that I assigned tags to were not showing when using the snapshot list command. At that time it was also showing me that the number of snapshots was way less than I know it should have been.

The snapshots with tags are showing correctly now and the total number of snapshots is also showing correctly.

What I’m seeing (at times) is that restic tells me it has created the snapshot, but it really hasn’t. Or if it did create it, I’m not sure where it’s at. :smile:
I do know that the repository number is always showing correctly, so it’s not like it’s saving it to another repo.

I’m starting to wonder if I’m having hardware issues with the USB drive.

I’m inclined to agree :confused: The symptoms you describe isn’t something that would have gone unnoticed if it was a bug in restic causing it, so that’s very very unlikely. It does however sound like your system isn’t telling restic about all the files that should in that snapshots/ folder, i particular if you also cannot find the corresponding snapshot file (with a snapshot ID) in the snapshots/ folder of your repository.

Can you try reproducing the problem with a small test repository on the USB first, and then the same on the local disk? Also, is it possible that it just takes some time before the snapshot (files) are shown?

It just “broke” again.

The output of running the backup:


And the output of the snapshot list


In addition to my previous post’s questions:

  • Is the 052f88a9 (parent) snapshot visible for you if you look for it in the snapshots/ folder in your repository?
  • And what about the new snapshot e14805f7?
  • Also, what’s the snapshots command you used above?
  • Is it possible that you have multiple repositories and for unintended reasons the commands you run work on different ones (I’m thinking such a silly thing could result in you not seeing snapshots you expect to see).

I am able to see the parent (04a16dfe) in the snapshot folder but the newly created snapshot (e14805f7) does not show.

The snapshot command that I’m using was in an earlier post. I hope that’s what you’re asking about.

I also have another repo at BackBlaze and I checked that to see if they were being saved there and they’re not.

I’m also not seeing this issue with that repo.

Just to clarify; After the backup was done resulting in new snapshot e14805f7, did you/your script then add tags to that snapshot? If so, it won’t have e14805f7 as the ID anymore.

Otherwise, please try to reproduce this on something else than that USB drive, this seems like a good debugging step IMO. I’d also keep an eye out for the new snapshot in case it turns up after some delay.

No, there were no tags added.

I understand that the ID number changes when tags are written to the snapshot.

I don’t think it’s an issue with restic and I’m pretty confident that it’s not the script, even though I’m no expert with writing them. It’s been working correctly for quite a while and nothing has changed with it for a long time.

Thanks for the help! I’ll continue to do some more troubleshooting on my end.

Gotcha. Yeah seems like you don’t have the most basic script syntax there so you seem to have some clue about script writing :slight_smile:

I hope you find something and that you let us know how it goes!

Thanks again and I’ll be sure to let you know if I find anything.

1 Like

I’m now wondering if after restic is done creating the new snapshot, does it check to see if it’s then available at the destination?

I would think if it did make such a check, that I should be getting some sort of error message.

Try moving the repo temporary to the internal SSD and see if the issue persist.

USB is and stay a b*** especially on Linux - I have seen them all. That’s why I’m no longer using it besides one way rsyncing / cp and pray that everything is ok (=last measurement backup)

Restic explicitly asks the operating system to confirm that each file in the repository has been written to disk. But there’s no follow-up check to verify that the file still exists. After all, if the previously given guarantee by the OS cannot be trusted, then there is no chance to create a correct backup.

Did you run fsck to verify that the filesystem is intact? Why filesystem are you using for the USB disk? Are there warnings regarding the USB disk in dmesg?

Good idea, but unfortunately my SSD doesn’t have the space. :frowning:

I’ll try running fsck later this evening.

The drive is using NTFS and I haven’t yet checked for warnings in dmesg.

Thanks for the suggestion.

1 Like