Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0b5 repositories inaccessible with 2.0.0b8 - KeyError: 'type' in repoobj.py #8247

Closed
linuxtextadventurer opened this issue Jun 4, 2024 · 11 comments

Comments

@linuxtextadventurer
Copy link

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

Bug (I guess?)

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

borg2 2.0.0b8

Operating system (distribution) and version.

Debian Trixie (Linux storage 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (2024-05-02T11:55Z) x86_64 GNU/Linux)

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg2 rinfo

Describe the problem you're observing.

Since upgrading from Debian Bookworm to Trixie, I can no longer do anything with my 2.0.0b5 repositories using 2.0.0b8. Even a humble rinfo fails:

storage# borg2 rinfo
Local Exception

Error:

KeyError: 'type'

If reporting bugs, please include the following:

Traceback (most recent call last):
  File "/usr/lib/borgbackup2/borg/archiver/__init__.py", line 656, in main
    exit_code = archiver.run(args)
                ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/borgbackup2/borg/archiver/__init__.py", line 549, in run
    rc = func(args)
         ^^^^^^^^^^
  File "/usr/lib/borgbackup2/borg/archiver/_common.py", line 141, in wrapper
    manifest_ = Manifest.load(repository, compatibility)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/borgbackup2/borg/manifest.py", line 258, in load
    _, data = manifest.repo_objs.parse(cls.MANIFEST_ID, cdata, ro_type=ROBJ_MANIFEST)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/borgbackup2/borg/repoobj.py", line 111, in parse
    if ro_type != ROBJ_DONTCARE and meta_compressed["type"] != ro_type:
                                    ~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'type'

Platform: Linux storage 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (2024-05-02T11:55Z) x86_64
Linux: Unknown Linux
Borg: 2.0.0b8  Python: CPython 3.11.9 msgpack: 1.0.3 fuse: pyfuse3 3.2.1 [pyfuse3,llfuse]
PID: 684  CWD: /root
sys.argv: ['/usr/bin/borg2', 'rinfo']
SSH_ORIGINAL_COMMAND: None

I expected this could be resolved creating a new repository and transferring archives as is described here, but 2.0.0b8's rcreate with other-repo set to the path of a 2.0.0b5 repository will fail with the same error.

Is there anything I can do to repair the repositories, or, at least, salvage the archives?

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

Create a repository with 2.0.0b5 (with --encryption=none) and try to access it using 2.0.0b8.

Include any warning/errors/backtraces from the system logs

@infectormp
Copy link
Contributor

dupe of #8235

@linuxtextadventurer
Copy link
Author

dupe of #8235

I saw that issue, but the error seemed different to me. Also #8235 specifically mentions encrypted repos. 🤷

@infectormp
Copy link
Contributor

Reason the same

Until a release is made, there can be incompatible changes. So, unless you can reproduce with a repo made with b8, this is not a bug.

@linuxtextadventurer
Copy link
Author

linuxtextadventurer commented Jun 4, 2024

So regarding

Is there anything I can do to repair the repositories, or, at least, salvage the archives?

I'm just out of luck then? 🤔

@infectormp
Copy link
Contributor

I suppose you could try borg export\import-tar https://borgbackup.readthedocs.io/en/latest/usage/tar.html

@infectormp
Copy link
Contributor

or use b5 fat binary https://github.com/borgbackup/borg/releases/tag/2.0.0b5

@linuxtextadventurer
Copy link
Author

I've just tried to use 2.0.0b8 to rcreate a new repository and 2.0.0b5 to transfer archives. Using 2.0.0b8 to rinfo on the new repository yields the same error still. 😞 Will try 2.0.0b5 to export-tar and 2.0.0b8 to import-tar now.

@ThomasWaldmann
Copy link
Member

betas are not for production.

if you want to keep the archives for a while, just use that repo with b5 and create a new repo for b8.

@linuxtextadventurer
Copy link
Author

betas are not for production

Why is borgbackup2 even a Debian stable package. To me this "if it breaks, it breaks" mentality is somewhat incompatible with Debian's nature / goal to be reliable.

if you want to keep the archives for a while

To be frank, I expected my backup repositories to be accessible even in 5-10 years time. I do realize now choosing borg2 was a regrettable mistake. I believe I chose it over borg1 for some feature, but I don't recall which one. In any case, will borg1 be maintained alongside borg2, or maybe even borg3 by then? Are there efforts to keep 1.4 compatible to 1.28? Or is it generally advised to keep local copies of deprecated binaries around?

@infectormp
Copy link
Contributor

infectormp commented Jun 4, 2024

Why is borgbackup2 even a Debian stable package. To me this "if it breaks, it breaks" mentality is somewhat incompatible with Debian's nature / goal to be reliable.

You should ask the debian maintainer why this is so.

Here you can check current status of package in the repositories https://borgbackup.readthedocs.io/en/stable/installation.html#distribution-package

@ThomasWaldmann
Copy link
Member

@linuxtextadventurer Back then, the idea was to package borg2 early because it is not trivial, especially if it needs to co-exist with borg1 - so that issues with that can be found and fixed early and it will be quickly available when borg2 will get released.

The package description clearly says:

Warning: This still is a beta that may break compatibility with the final 2.0 release.

(in fact: ... with the final 2.0 release or any other beta/rc release on the way to that)

If you need something stable, use the non-beta borgbackup package, which is also in Debian stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants