Restic tag add duplicate snapshots

Hi,

• The output of restic version.
restic 0.18.0 compiled with go1.24.1 on linux/amd64

• The complete commands that you ran (leading up to the problem or to reproduce the problem).

State of snapshots before :

4cb09431  2025-07-15 04:36:35  my-host              /path-to-backup_sql                    102.682 MiB
c9adc14a  2025-07-15 04:36:39  my-host              /path-to-files                         31.323 GiB
0b9d4183  2025-07-16 04:36:35  my-host              /path-to-backup_sql                    102.708 MiB
805f4221  2025-07-16 04:36:41  my-host              /path-to-files                         31.326 GiB

Add tag to the last 2 :

restic tag --add do-not-delete 0b9d4183 805f4221

State of snapshot :

4cb09431  2025-07-15 04:36:35  my-host                 /path-to-backup_sql                    102.682 MiB
c9adc14a  2025-07-15 04:36:39  my-host                 /path-to-files                         31.323 GiB
29e7cde4  2025-07-16 04:36:35  my-host  do-not-delete  /path-to-backup_sql                    102.708 MiB
45d4b261  2025-07-16 04:36:35  my-host  do-not-delete  /path-to-backup_sql                    102.708 MiB
32e57f48  2025-07-16 04:36:41  my-host  do-not-delete  /path-to-files                         31.326 GiB
d44dbc9d  2025-07-16 04:36:41  my-host  do-not-delete  /path-to-files                         31.326 GiB

The 2 snapshots have been duplicate

• Any environment variables relevant to those commands (including their values, of course).
RESTIC_REPOSITORY, RESTIC_PASSWORD, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are defined in a secret file, sourced juste before the commands

Did I miss something ?
Thanks

@VoidAndAny from the tag documentation:

…i freely translate that modifying a tag is a change and therefor creates a new snapshot id.

I cannot reproduce your issue, but on this machine i have an older version of restic, 0.16.4.

On my test repo, each change with tag --add or tag --set changes the snapshot ID but the snapshots command only shows me one snapshot.

Humf, I just made more tests and I can’t reproduce either :confused:

Just wanted to mention, reminded me this one :sweat_smile:
My problem was lack of coffee back then, afair.

That sounds like restic was interrupted or failed to access the backend before cleaning up the original snapshots. Although in case of backend problems there should have been some error messages.