Issue with prune error

Hi,
I was wondering if someone could lend me hand on the current issue im getting. Currently trying to prune im getting this error

will delete 56 packs and rewrite 3017 packs, this frees 10.044 GiB
hash does not match id: want 4d4d10dc1050218bfedf355c5e755f706de75539cd06be9a6df29646c5df6622, got f7679a95db3a4716252c2940231ed8585973a2e6dcedf77967b24c34149894eb
github.com/restic/restic/internal/repository.Repack
/restic/internal/repository/repack.go:34
main.pruneRepository
/restic/cmd/restic/cmd_prune.go:278
main.runPrune
/restic/cmd/restic/cmd_prune.go:85
main.glob…func18
/restic/cmd/restic/cmd_prune.go:25
github.com/spf13/cobra.(*Command).execute
/restic/vendor/github.com/spf13/cobra/command.go:762
github.com/spf13/cobra.(*Command).ExecuteC
/restic/vendor/github.com/spf13/cobra/command.go:852
github.com/spf13/cobra.(*Command).Execute
/restic/vendor/github.com/spf13/cobra/command.go:800
main.main
/restic/cmd/restic/main.go:86
runtime.main
/usr/local/go/src/runtime/proc.go:200
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1337

  WARNING!
[prune] failed; exit code 1

I was reading a few other users have had this issue, i ran rebuild index then re ran prune same issue i read something about run sha256sum directly on the file but went to the repo/data/f7 but not sure if i need a special package to run sha256sum

I was also reading a few were able to solve others not sure. Currently running restic 0.9.6

Thank you

Please see #1999 to find some information on how to debug this.

Depends on what OS you are on and if there’s a program for printing the SHA256 value of a file in it by default. What OS are you on?

Another option is to use https://github.com/fd0/psha which you run on/in the repository (e.g. psha path/to/repo).

It will walk all the relevant files and report any mismatches between filename and has of file contents.

It’s not the same thing as what’s discussed above (checking the hash for a specific file), but useful for when you are looking for corruption in the entire repo.

@rawtaz thanks for the reply, running debian 9
i downloaded the repo but there is no instructions only 3 files as for running psha command not found

@764287 thanks for the reply, as it was the first item i did look at i did rebuild index, and re ran prune
then reran rebuild index then a restic check -verbose

using temporary cache in /tmp/restic-check-cache-526029076
created new cache in /tmp/restic-check-cache-526029076
create exclusive lock for repository
load indexes
check all packs
check snapshots, trees and blobs
no errors were found

You need to have go installed and then you simply do go run main.go <path to restic repo> from from within the cloned psha repo.

Thanks for the reply, i tried these options

    root@prometheus:~/psha# go run main.go /media/usb/backupdaily/usuarios/
    -bash: go: command not found
    root@prometheus:~/psha# run main.go /media/usb/backupdaily/usuarios/
    -bash: run: command not found
    root@prometheus:~/psha# main.go /media/usb/backupdaily/usuarios/
    -bash: main.go: command not found
root@prometheus:~/psha# ./main.go /media/usb/backupdaily/usuarios/
./main.go: line 1: package: command not found
./main.go: line 3: syntax error near unexpected token `newline'
./main.go: line 3: `import ('

@killmasta93 The files I pointed you to are source code files. You normally compile them to run them. If you don’t know how to do that (although it’s very simple with Go), let’s ignore that for now.

Your Debian should have sha256sum available out of the box, just run it with the file you want to check as the argument, e.g. sha256sum 4d4d10dc1050218bfedf355c5e755f706de75539cd06be9a6df29646c5df6622 in the directory where that file resides. If you get the same hash reported in the output as the hash in the filename, it’s good. Otherwise, if they differ, it’s bad.

Thanks for the quick reply, sorry as i dont have much knowledge with Go but this was the outcome
as the hash is different, in this case how does one resolve this? Im guessing removing manually damages the repo

root@prometheus:/media/usb/backupdaily/usuarios/data/4d# sha256sum 4d4d10dc1050218bfedf355c5e755f706de75539cd06be9a6df29646c5df6622
f7679a95db3a4716252c2940231ed8585973a2e6dcedf77967b24c34149894eb  4d4d10dc1050218bfedf355c5e755f706de75539cd06be9a6df29646c5df6622

Thank you

As I said, you need to have go installed. And your OS tells you that you don’t have go installed. So you won’t be able to run the code. More information on the command I mentioned is here: https://golang.org/cmd/go/#hdr-Compile_and_run_Go_program

But as I can see you have found the file in question already :slight_smile:

Thanks for the reply, correct the above command seemed to work to show the issue now the question is how does one fix this issue?