garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.71k stars 49 forks source link

unable to create lock in backend #543

Closed amarendra closed 2 weeks ago

amarendra commented 2 weeks ago

For the last 4 days I see that the backups have been failing due to lock issues which was created 4 days ago. These are scheduled backups. (Also the last successful operation was also a backup).

To Reproduce These are scheduled backups so I am not sure what could be the steps to reproduce.

Expected behavior As the logs suggest the tool should at least try to unlock to remove the stale locks.

Platform:

Additional context I am not sure whether this should be raised on restic Guthub repo or whether a latest restic version has fixed this but since I am on latest backrest I thought I shall start here.

Log:

[repo-manager] 06:47:00.087Z    debug   repo orchestrator starting backup   {"repo": "<repo-name>", "repo": "<repo-name>"}
[restic] 
[restic] command: /Users/amar/.local/share/backrest/restic-0.17.1 snapshots --json -o sftp.args=-oBatchMode=yes --tag plan:<plan name>,created-by:<local name>
[restic] unable to create lock in backend: repository is already locked exclusively by PID 69387 on mac by amar (UID 501, GID 20)
[restic] lock was created at 2024-11-06 05:25:02 (73h22m5.876188s ago)
[restic] storage ID 67a154bb
[restic] the `unlock` command can be used to remove stale locks
[tasklog] 06:47:08.005Z error   backup for plan "<plan name>"   task failed {"error": "failed to get snapshots for plan: get snapshots for plan \""<plan name>\": command \"/Users/amar/.local/share/backrest/restic-0.17.1 snapshots --json -o sftp.args=-oBatchMode=yes --tag ...\" failed: exit status 11\nOutput:\nunable to create lock in backend: repository is already locked exclusively by PID 69387 on mac by amar (UID 501, GID 20)\nlock was created at 2024-11-06 05:25:02 (73h22m5.876188s ago)\nstorage ID 67a154bb\nthe `unlock` command can be used to remove stale locks\n", "duration": 7.918827667}
garethgeorge commented 2 weeks ago

Hi— first thing coming to mind is that Auto Unlock is disabled by default and must be opted in. Did you turn it on in the settings for your repo?

amarendra commented 2 weeks ago

Did you turn it on in the settings for your repo?

My bad. I had not. Just did it. Thanks a lot!