Nethserver Backup - Fatal: unable to create lock in backend

Nethserver 7.8.2003

Hello @support_team,

I’m running backup’s using Restic to my S3 provider and I’ve begun to see the following error messages on the backups failing:

Fatal: unable to create lock in backend: repository is already locked exclusively by PID 740.

  • What is the process to remove these locks? Simply kill the PID?
  • Any idea why these locks are occurring and stopping my backups for working?

I’ve done a bit of research and learned of a “restic unlock” command I can use. But I need to know the repository location: Here is the error when I issue this command:

Fatal: Please specify repository location (-r)

Thank you.

I didn’t test it, but it should be something like:

export AWS_ACCESS_KEY_ID="_your_id_"
export AWS_SECRET_ACCESS_KEY="_your_key_"

/usr/bin/restic  --cache-dir /var/lib/nethserver/backup/restic/_backup_name_ --password-file /var/lib/nethserver/secrets/_backup_name_ --repo s3:s3.amazonaws.com/_bucket_name_ unlock -v

If it’s not enough, you can switch to s3cmd:

s3cmd ls s3://_bucket_name/locks/*
s3cmd del s3://_bucket_name/locks/xxx
2 Likes

Hello @giacomo, very sorry for the long delay in responding to your helpful post.

Just wanted to mention that I found another way to remove the lock files. I loaded up my S3 into WinSCP and found the lock files on my S3 bucket. I simply deleted the lock and now my backups are working again.

Thanks again for you help!

1 Like