Ciphertext verification failed

I wanted to copy some snapshots from one repository to another one. For most snapshots it worked, but for some I got the following error:

repository d25693d6 opened (version 2, compression level auto)
repository c82d1b4a opened (version 2, compression level auto)

snapshot b31e8380 of [D:\Pictures] at 2023-01-06 00:11:33.705937 +0100 CET)
  copy started, this may take a while...
[0:28] 26.20%  93 / 355 packs copied
ciphertext verification failed
github.com/restic/restic/internal/crypto.init
        /restic/internal/crypto/crypto.go:30
runtime.doInit
        /usr/local/go/src/runtime/proc.go:6329
runtime.doInit
        /usr/local/go/src/runtime/proc.go:6306
runtime.doInit
        /usr/local/go/src/runtime/proc.go:6306
runtime.doInit
        /usr/local/go/src/runtime/proc.go:6306
runtime.main
        /usr/local/go/src/runtime/proc.go:233
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1594
StreamPack
github.com/restic/restic/internal/repository.streamPackPart
        /restic/internal/repository/repository.go:985
github.com/restic/restic/internal/repository.StreamPack
        /restic/internal/repository/repository.go:877
github.com/restic/restic/internal/repository.repack.func2
        /restic/internal/repository/repack.go:80
golang.org/x/sync/errgroup.(*Group).Go.func1
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1594

Can someone please help me what to do.

Hi @RYTD29 and welcome to the restic community! :slight_smile:

One of the restic maintainers has put together a list: Study of repository damage types

You can check it out and see if you find information that will help you troubleshoot or solve your problem.
Otherwise I would also suggest to use the Forums search as this is something which has been asked about before.

Hi @moritzdietz. Thank’s for your hint and ouf course I should have used the search function before posting.

No worries :slight_smile: We are here in case you need help though… not letting you stranded with your problem.

That sounds like the source repository was somehow damaged. Could you please run restic check --read-data (as a warning: this will have to download the whole repository, depending on the storage that could be expensive) and provide the output? Repairing the snapshot will afterwards probably follow the steps from Recover from broken pack file · Issue #828 · restic/restic · GitHub , but we first have to get rid of the damaged data.

That study only looks at the ways in which a repository can get damaged, but doesn’t tell you how to fix it :wink:

Ah darn, I only saw this briefly when I looked for it, but haven’t given it a proper read. My bad :confused:

Thanks again.

I’ve copied all “working” snapshots and then deleted the old repository, therefore, I’m not able anymore to to a check --read-data.

But - as I said - thanks. The support in this forum really seems to be great.