Restic unlock --remove all hangs


First post, done some due diligence and can’t seem to find an easy solution.

I’m an idiot and I left a repository (Backblaze B2 backend) fuse-mounted on a machine for a very long time. restic check tells me that the repo is mounted on a machine:

# restic check
using temporary cache in /tmp/restic-check-cache-629967059
repository e4de1ac5 opened successfully, password is correct
created new cache in /tmp/restic-check-cache-629967059
create exclusive lock for repository
Fatal: unable to create lock in backend: repository is already locked by PID 4168 on DBLIVE01 by root (UID 0, GID 0)
lock was created at 2019-09-26 22:18:42 (3689h46m57.965138513s ago)
storage ID 4f769b1c

Hey! Only five months or so :slight_smile: The PID that it mentions is long gone, perhps due to some troubleshooting I’ve been doing. I noticed this on another box and duly ran restic unlock --remove-all, which worked (and saved my bacon), however on this one it just hangs with no further info, even if verbose flags are set:

# restic -vvv unlock --remove-all
repository e4de1ac5 opened successfully, password is correct

Is there any way out of this? Any way to get more info about what may be happening?

Thanks in advance…

If no one has any ideas about this, is it OK to post a github issue?

@ticktockhouse I’m sorry you didn’t get a reply sooner.

I might be misunderstanding your actual question, but to get rid of the lock you should be able to just delete all the files under the locks/ directory in your repository (obviously when nothing else is accessing the repository).

I never use Backblaze B2 so I don’t know what means there are to access the files, but if nothing else, I guess rclone can do it for you.

That said, I’m puzzled why the command isn’t responding. I’d check I/O, CPU, etc.

Let’s start with this before creating a GitHub issue, but thanks a lot for asking! And for your patience.

1 Like

Just for info - Backblaze has a web UI where you can delete files - I deleted the contents of locks/ for the repo in question, and was then able to back up to the repo :+1:

I’ve also added a cron job which will try to unmount the restic mount once a day, in case I accidentally leave something mounted in the future…