Backup to backblaze locked and no config

Hi there,

I’ve been using restic to make daily sever backups to backblaze, however it’s failed to run because unable to create lock in backend: repository is already locked by PID 24038. On looking into it, I found a suggestion to run a check restic -r /my-backup-dir check, however that returns no such file or directory Is there a repository at the following location?. I don’t believe there has ever been a config directory in my backup location, yet it’s successfully backed up until now. I also use this on another server, running the check command returns the same error, but also backs up fine.

Any suggestions?


Did you try the unlock command?

Basically run the same command as when you backup but replace the backup part and anything after it with unlock, e.g. restic -r ... unlock.

Thanks I missed that command, that’s seemed to have done the job. Do I need to be concerned about the whole repository thing?


What I can tell you is that restic never modifies files in the repository, so it tries its hardest to not screw up the repository when things like this fail. I personally wouldn’t be worried. At worst you have some unreferenced blobs or similar, so no biggie.

For good measure you can run the check command and even prune, but to be honest @fd0 knows better if this is relevant. I guess it depends on when that error message appeared. If it was before restic started uploading anything there’s no need, but if it happened a bit into the backup process then you might just have some unreferenced data in the repo and to clean it you can run these commands.

Either way I don’t think there’s any problem with your repo.

Hey, welcome to the forum!

I think there’s just a small error in how you call restic:

This instructs restic to check a repository located in the directory /my-backup-dir, but you wrote that you’re using B2 for storing the repo. I suspect that /my-backup-dir in your example is the directory that you’d like to create the backup of, not the directory to store the encrypted backed-up data in. Since there isn’t a valid restic repository in the directory, restic complains. That’s what you’re seeing :slight_smile:

So, you need to run restic check with the same repository specification like when you’re doing a backup (e.g. -r b2:bucket:/path), then restic can check the data stored in the repository.

Please try running restic check this way and report back.

1 Like

That makes sense! It’s comeback all good, so the unlock command fixed it and Ive been able to make a backup since.

Thanks for your help guys!