Restore process frozen with message 'Fatal: failed to refresh lock in time'

Hi,

I’m using restic 0.15.1 compiled with go1.19.5 on windows/amd64 under Windows 10 Pro for 64 bits.

I’ve got a repo with a snapshot containing 44 big files (42 of them are 10GiB, and the other 2 are arround 2GiB). I can list the files it contains, get the snapshot stats, and restore other snapshots from the same repo (which don’t contain those files), but I cannot restore that specific snapshot.

When I try to restore this problematic snapshot, the restic process will initially (in the first 60 seconds or so) read a few hundred MiB, write some MiB too, and then it stalls for some minutes until it finally says Fatal: failed to refresh lock in time. Curiously enough, the operating system creates 4 of the 10GiB files, but they are mostly empty (filled with zeroes) since restic has written only a few MiB.

This is the command I run to restore that snapshot to my G: drive, and the output I get:

> restic -r . restore a0989119 -t G:\
repository 5331eaed opened (version 1)
restoring <Snapshot a0989119 of [###PATH###] at 2023-02-24 21:51:09.8597578 +0000 UTC by ###USERNAME###> to G:\
Fatal: failed to refresh lock in time

I’ve been waiting for restic to do something else for more than 24 hours, but it seems that it is frozen. I’ve rebooted my PC and tried to run the command several times, but the process always get stuck. The most verbose mode shows exactly the same output as above.

Can someone please help me to debug this issue and restore the snapshot?

Hi again,

A quick update. I’ve been able to restore the problematic snapshot to a different drive, so I guess there’s something wrong with that particular hard disk. However, once restored I’ve been able to copy the files (more than 400GiB) to the tricky drive without any problems (at normal speed, no read or write errors, etc.).

Any ideas about why restic just complained with about a problem with the lock on the repo (Fatal: failed to refresh lock in time), and why it couldn’t directly restore the snapshot to the drive?

Thanks.

If restic is stuck for more than 30 minutes, then its lock file becomes stale, at which point the current command is canceled. (See Restic can fail with `Fatal: failed to refresh lock in time` on slow connections · Issue #4199 · restic/restic · GitHub ). Being stuck for such a duration either means that reading from the repository or writing the restored files was hanging. But I can’t say anything more specific than that.