You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this repository that's been unmonitored for a few months. I've noticed that forget is apparently not running, so I've tried to run it manually, adding -n to first have a look at what it would be doing:
$ sudo resticprofile local.forget -n2024/09/16 16:34:29 using configuration file: /etc/restic/profiles.yaml2024/09/16 16:34:29 profile 'local': initializing repository (if not existing)2024/09/16 16:34:29 profile 'local': starting 'forget'repository 2962f6e8 opened (version 2, compression level auto)found 1 old cache directories in /root/.cache/restic, run `restic cache --cleanup` to remove themrepo already locked, waiting up to 0s for the lockunable to create lock in backend: repository is already locked by PID 967 on spec by root (UID 0, GID 0)lock was created at 2024-06-02 15:31:06 (2545h3m23.272568633s ago)storage ID 9b796ee8the `unlock` command can be used to remove stale locks2024/09/16 16:34:29 restic: possible stale lock detected (lock age 2545h3m23.272s >= 1h0m0s). Set `force-inactive-lock` to `true` to enable automatic unlocking of stale locks.2024/09/16 16:34:29 forget on profile 'local': exit status 11
Oh, okay, so the issue seems to be that there's a stale lock that's three months old.
I didn't have force-inactive-lock in my config beforehand, but I've added it now. Trying again:
$ sudo resticprofile local.forget -n2024/09/16 16:50:42 using configuration file: /etc/restic/profiles.yaml2024/09/16 16:50:42 profile 'local': initializing repository (if not existing)2024/09/16 16:50:42 profile 'local': starting 'forget'repository 2962f6e8 opened (version 2, compression level auto)found 1 old cache directories in /root/.cache/restic, run `restic cache --cleanup` to remove themrepo already locked, waiting up to 0s for the lockunable to create lock in backend: repository is already locked by PID 967 on spec by root (UID 0, GID 0)lock was created at 2024-06-02 15:31:06 (2545h19m36.35688122s ago)storage ID 9b796ee8the `unlock` command can be used to remove stale locks2024/09/16 16:50:43 restic: possible stale lock detected (lock age 2545h19m36.356s >= 2h0m0s). Trying to unlock.2024/09/16 16:50:43 profile 'local': unlock stale locksunknown shorthand flag: 'n' in -n2024/09/16 16:50:43 failed removing stale lock. Cause: unlock on profile 'local': exit status 12024/09/16 16:50:43 forget on profile 'local': exit status 11
It detected the stale lock and tried to remove it. The error message unknown shorthand flag: 'n' in -n looks as if resticprofile is passing the -n I've specified on the command line to the restic unlock command, which of course doesn't know what to do with it.
In my opinion, when restic unlock is being called from resticprofile as a result of force-inactive-lock, resticprofile should not pass any user-specified command line arguments. When calling it manually though (e.g. resticprofile local.unlock), command line arguments should be forwarded as usual.
The text was updated successfully, but these errors were encountered:
I have this repository that's been unmonitored for a few months. I've noticed that
forget
is apparently not running, so I've tried to run it manually, adding-n
to first have a look at what it would be doing:Oh, okay, so the issue seems to be that there's a stale lock that's three months old.
I didn't have
force-inactive-lock
in my config beforehand, but I've added it now. Trying again:It detected the stale lock and tried to remove it. The error message
unknown shorthand flag: 'n' in -n
looks as if resticprofile is passing the-n
I've specified on the command line to therestic unlock
command, which of course doesn't know what to do with it.In my opinion, when
restic unlock
is being called from resticprofile as a result offorce-inactive-lock
, resticprofile should not pass any user-specified command line arguments. When calling it manually though (e.g.resticprofile local.unlock
), command line arguments should be forwarded as usual.The text was updated successfully, but these errors were encountered: