Can't init Backblaze B2 repo

For some reason I don’t seem to be able to init a new repo on b2.

export B2_ACCOUNT_ID=redacted     
export B2_ACCOUNT_KEY= redacted
export RESTIC_PASSWORD= redacted
export RESTIC_REPOSITORY=b2:akrabu_test1
restic init
b2_download_file_by_name: 404: : b2.b2err
b2_download_file_by_name: 404: : b2.b2err
created restic repository c83853d0e2 at b2:akrabu_test1

It creates the config file and key folder, the other directories are missing. Trying to backup does this (taken from my original v2 attempt):

ssh 1.2.3.4 'tar -cPf - ~ /usr/local/bin /etc/systemd/system/MTProxy.service /etc/systemd/timesyncd.conf' | restic backup --compression max -H akrabu-vps --stdin --stdin-filename akrabu-vps.tar
repository 73fce5b3 opened (repo version 2) successfully, password is correct
created new cache in /Users/akrabu/Library/Caches/restic

Files:           1 new,     0 changed,     0 unmodified
Dirs:            0 new,     0 changed,     0 unmodified
Added to the repo: 19.025 MiB

processed 1 files, 19.023 MiB in 0:23
snapshot 23188d78 saved

But then another backup immediately after will do this:

restic backup --host akrabu-macbook-air --compression max ~
repository 73fce5b3 opened (repo version 2) successfully, password is correct
Error loading snapshot 01874a32: ciphertext verification failed
github.com/restic/restic/internal/restic.FindLatestSnapshot.func1
/home/beta/restic.git/internal/restic/snapshot_find.go:40
github.com/restic/restic/internal/restic.ForAllSnapshots.func2
/home/beta/restic.git/internal/restic/snapshot.go:119
golang.org/x/sync/errgroup.(*Group).Go.func1
/home/beta/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1571

Listing snapshots gives me this:

restic snapshots -c
repository 73fce5b3 opened (repo version 2) successfully, password is correct
could not load snapshot 01874a32: ciphertext verification failed
could not load snapshot 040faa99: ciphertext verification failed
could not load snapshot 01b09560: ciphertext verification failed
could not load snapshot 027b239d: ciphertext verification failed
could not load snapshot 00466c03: ciphertext verification failed
could not load snapshot 04793ccc: ciphertext verification failed
could not load snapshot 08fb3282: ciphertext verification failed
could not load snapshot 066fd5f1: ciphertext verification failed
could not load snapshot 0baed0a6: ciphertext verification failed
ID        Time                 Host        Tags
-------------------------------------------------
23188d78  2022-05-16 09:48:24  akrabu-vps
-------------------------------------------------
1 snapshots

At first I was trying to make a v2 repo and thought that was an issue, but even using the latest stable binary throws this error on init (haven’t tried backing up with it). I’ve also tried several different buckets. I’m using a full account key, not an application key. Also thought maybe it was my university connection, so I made a hotspot… nope. Am I doing something dumb again? lol

And yes my Backblaze billing is all up to date haha. And my main repo lists snapshots just fine, but I’m hesitant to try to add anything to it at the moment for fear of corrupting what’s there.

Update: Running init locally, copying the chunker params from my v1 B2 repo, then using FileZilla to copy the local v2 repo up to the B2 folder I was trying to make earlier, seems to have worked just fine. It’s now backed up several times with no errors.

Can someone else try to init a repo on B2? Stable or the latest dev, it doesn’t matter.

The b2_download_file_by_name line is just a warning, see `b2_download_file_by_name: 404` on Backblaze B2 repository init · Issue #3750 · restic/restic · GitHub . It doesn’t negatively influence the repository creation as far as I can tell.

Does the repository use a single or multiple keys? It is extremely odd that you should be able decrypt the config file (the first step in opening a repository, before loading the snapshot) but be unable to decrypt the snapshots. Another strange pattern is that all snapshots reported by snapshots have an id starting with 0. Another problem with the ciphertext errors is that restic first verifies that the hash of the file content matches.

So the most likely explanation is that there’s something wrong with the host (hardware/software) that generated these snapshots. (The encryption and hash calculation part was not changed by the compression PR, so that can’t be the issue)

Ahh okay. I thought I remembered something like that, but the ensuing error messages led me to think it was related.

It uses a single key. I also found that very odd.

I mean that’s not out of the realm of possibilities. This little 2014 MacBook Air has seen some stuff. But… since running init locally, and then copying that to the very same b2 folder… it’s working just fine. Backed up my VPS, then my home folder, then my home folder once more for good measure. It worked fine. Tried to init a new one for the sake of it - and it failed again.

I tried three different buckets with v2, and two buckets with the latest stable v1. Both versions did it. So yeah, definitely not part of the compression PR.