Fatal unable to create lock?


#1

Hi,
I was wondering if someone could shed some light ton the issue im having, currently have restic working great. every now and then im getting this issue

Dec 25 2018 22:59:49 -05: backup-script started open repository
 Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by  (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m30.827726356s ago) storage ID 63a97837
 Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by  (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m31.348829345s ago) storage ID 63a97837
 Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by  (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m31.86880871s ago) storage ID 63a97837 using temporary cache in /tmp/restic-check-cache-790221529 create exclusive lock for repository
 Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by  (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m32.404181536s ago) storage ID 63a97837

after i get that i run the unlock

 restic -r /media/myresticlocation/ unlock --cleanup-cache

and after that it runs it then a week or so same issue any ideas?

Thank you


#2

You already opened a topic about this issue. Please don’t open duplicate topics.


#3

Sorry completely forgot about it as you see the posts are different


#4

Same debug workflow as in your other post: find out what ran at the time the lock was last updated, that’s the operation that failed. Make sure it does not fail again, otherwise it’ll again leave a lock which prevents normal backups.

Besides: the script you’re using ignores errors returned by restic: it should have aborted after the first failure to lock the repo. Maybe use set -e in the script (if it’s sh or bash)?


#5

Thanks for the reply, the script pretty simple

 #!/bin/bash
  #This will run Restic backups and remove snapshots according to a policy
  export RESTIC_REPOSITORY=/media/backupnas2/backup1
  export RESTIC_PASSWORD=mypass
  # Run Backups
 /usr/local/bin/restic -v backup /media/smb2  | tee -a /media/backup.log

  # Remove snapshots according to policy
 /usr/local/bin/restic forget --keep-last 10  | tee -a /media/backup.log

  # Remove unneeded data from the repository
 /usr/local/bin/restic prune | tee -a /media/backup.log

  # Check the repository for errors
  /usr/local/bin/restic check | tee -a /media/backup.log