Skip to content

Set tag in a locked repo tries to unlock and fails without error message  #5050

@tsmanuelanton

Description

@tsmanuelanton

Output of restic version

0.17.1

What backend/service did you use to store the repository?

File system

Problem description / Steps to reproduce

While working with a repository that contains snapshots and is currently locked by another process, I attempt to set a tag for a snapshot. When I execute the command, it displays "repo already locked, waiting up to 0s for the lock." Although the command appears to run successfully, the new tag does not appear when I list the snapshots.

~/ restic version  
restic 0.17.1 compiled with go1.23.1 on linux/amd64
~/ restic snapshots
repository 34f2d3ec opened (version 2, compression level auto)
ID        Time                 Host              Tags          Paths                                   Size
------------------------------------------------------------------------------------------------------------------
8b3779ec  2024-09-13 08:46:11  manuelaac  v0.0.0        /home/manuelanton/backup/2345  1.506 GiB
------------------------------------------------------------------------------------------------------------------
3 snapshots
~/ restic tag 8b3779ec --set my-tag
create exclusive lock for repository
repository 34f2d3ec opened (version 2, compression level auto)
repo already locked, waiting up to 0s for the lock
~/ restic snapshots                
repository 34f2d3ec opened (version 2, compression level auto)
ID        Time                 Host              Tags          Paths                                   Size
------------------------------------------------------------------------------------------------------------------
8b3779ec  2024-09-13 08:46:11  manuelaac  v0.0.0        /home/manuelanton/backup/2345  1.506 GiB
------------------------------------------------------------------------------------------------------------------
3 snapshots
~/ 

Expected behavior

It should display an error message if the attempt to unlock failed or if it was successfull, the list command (restic snapshots) should show the backup with the new tag my-tag

Actual behavior

Not throwing any error message but the tag was not set.

Do you have any idea what may have caused this?

No. I tried with version 0.17.0 and same error but with 0.16.4 it gives the message that the unlocking failed.

~/ ./restic_0.16.4_linux_amd64 tag 8b3779ec --set my-tag
repository 34f2d3ec opened (version 2, compression level auto)
create exclusive lock for repository
repo already locked, waiting up to 0s for the lock
unable to create lock in backend: repository is already locked by PID 358027 on manuelaac by manuelanton (UID 1000, GID 1000)
lock was created at 2024-09-12 18:15:21 (15h9m6.888540537s ago)
storage ID ab21b1ee
the `unlock` command can be used to remove stale locks

Did restic help you today? Did it make you happy in any way?

It is a tool I use everyday. I love it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions