[badger v1.6.2] panic: slice bounds out of range

go-ipfs uses an older badger (v1.6.2) and my local repo panics as described in the issue linked below.

Is this a known issue by any chance, or not worth investigating?

What version of Go are you using (go version)?

go1.15.8

What operating system are you using?

amd64/linux

What version of Badger are you using?

v1.6.2

Does this issue reproduce with the latest master?

don’t know, we use badger v1

Steps to Reproduce the issue

What Badger options were set?

  • https://github.com/ipfs/go-ds-badger/blob/22c5a1727f7fe834ed1bdc00af0ead224936b94b/datastore.go#L89-L116

Is it possible to upgrade to v2?

That will happen at some point, but not in the short term (go-ipfs needs to update first).

Anyway, in case someone finds themselves with the same panic, it looks like a flipped bit/corrupted repo – I regenerated the same dataset (same hashes) and the issue is no more.

So the fix is to either update to badger v2 or restore data from backup.

1 Like