Restic suddenly complaining of repo version?

Greetings!
I have daily Restic scheduled backups running and every few days I list the snapshots to make sure everything looks as expected. Strange thing is, just today when trying to list snapshots I receive the following error:

bob@pop-os:~$ restic -r b2:parking:alfresco45 snapshots
enter password for repository:
Fatal: config cannot be loaded: unsupported repository version. Try again

I’m not sure why it suddenly complains about repo version because I haven’t touched my Restic client nor my repo since doing the repo v2 upgrade sometime last year. All I do with Restic is run backups on a schedule, check snapshots every few days, and do intermittent restores to verify backups.

When I run “restic version”, I get this:
restic 0.12.1 compiled with go1.18.1 on linux/amd64

I tried finding a way to list the repo version, but didn’t find a command that does that unless I’m overlooking it?

1 Like

0.14 was the first release that offered compression, so you must have used that to to the v2 upgrade. You should upgrade to 0.15.1.

1 Like

Thanks. I had the exact same question.

I don’t understand how my Restic might have reverted to an old release if that’s the situation. I just tried “re-upgrading” but it’s telling me I’m on the latest.

bob@pop-os:~$ sudo apt-get install --only-upgrade restic
[sudo] password for bob:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
restic is already the newest version (0.12.1-2ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Realize that what version of restic that your package managers for the apt package management system publishes is a completely different thing from what restic versions there are available and published by the restic project. The apt packages are generally behind.

You can find the official releases here, and you can upgrade either by downloading that or running restic self-update (although there has been cases where the package managers have removed this specific feature): Releases · restic/restic · GitHub

The latest and current restic release is version 0.15.1, I highly recommend you get and run that :slight_smile: Version 0.12.1 is from August 2021.

That did the trick. Mucho appreciado.
I’m glad to hear @Steve-Z may have experienced the same thing. I sincerely haven’t touched my Restic client since last year so how it might have reverted or broke somehow is mystifying after running perfectly for months.

I actually had the same issue. My nightly backup still worked on 17 February, but stopped working on 18 February. Today I found out that restic was somehow reverted to 0.12.1 as well, and restic self-update also fixed it for me.

However, my question is: How can I prevent this from happening again? I’m not sure how this happened and I didn’t issue any manual commands on my Ubuntu installation. Would it be better to not use apt and manually install restic? I’m using Ubuntu 22.04.1 LTS.

Would it be safe to run restic self-update before every backup? I assume there might be breaking changes, so I assume this could break things as well…

To both of you - it is not restic that reverts itself to an older version. It is something else. Presumably your package manager or something.

A simple explanation would be that at some point you ran a newer restic version, upgraded your repos to compression (v2), and then for some reason at some point started using your old restic version installed by the package manager again.

Yes, but it would frankly be rather silly. Fix the original problem instead :wink:

While it is nice to keep things in one and the same ecosystem, I would every day prefer to run an up to date restic versin controlled by myself instead of an old restic version controlled by the package manager.

Restic is just one single binary, so you can just download and use that. It’s no hassle, e.g. no need to install and maintain a bunch of dependencies etc.

If you installed restic at some point using apt or apt-get, which seems to be the case, you should be able to uninstall it using
sudo apt remove restic

Your current restic package, newer in version, should remain installed and you can self update in the future.

The other route would be to leave things as are and use
sudo apt mark-hold restic
to prevent further automatic updates in the future. To revert this change use
sudo apt mark-unhold restic
Then you can self update in the future.

Thanks you two! I was mostly wondering how this happened, especially since the official install guide is recommending to use apt to install restic. I’m pretty sure I haven’t changed anything from the default; I built the system so that it’s very easy to recreate from scratch.

I think I’ll just remove it from apt and manually self-update. Thanks for the commands. :+1:

This doesn’t seem right. Can you point me to where the official guide recommends installing restic via apt?

It is, at least, the first method of installation in the guide: Installation — restic 0.15.1 documentation

Although I admit that it doesn’t say anything about updating the package via restic self-update; it only says it for using the official binary. That was my/our mistake I guess: Using apt to install restic, but using restic self-update to update it. Maybe package installed versions should prevent using restic self-update or show a warning that it could be reverted by the package manager.

Yeah, after explicitly stating that if your package manager gives you old versions of restic you should use the official binaries ;D

If you have any suggestions for how to improve that part to make it more clear, we’re happy to hear them! :heart:

I have to apologize. After reading the guide again, I think it is very clear. I guess there’s nothing much that can help people like me who don’t properly read the guide. :see_no_evil:

The only thing that might make sense would be to prevent restic self-update when package-installed as it can lead to unwanted behavior. However, adding code that detects whether restic was installed via a package manager or official sources does not really add anything to the tool itself, so I can understand if it’s left as it is.

Thanks for the patience and for clearing things up! And of course thanks for helping build such a great tool! :heart:

This is sometimes done by package managers, here’s a recent case where it was discovered in Arch: unknown command "self-update" for "restic" · Issue #4206 · restic/restic · GitHub

1 Like