lightningnetwork/lnd

panic: freepages: failed to get all reachable pages (page 18562: multiple references)

aflesher opened this issue · 5 comments

Background

Not exactly sure if I got myself into a bad state but I tried to recover LND version 0.7.1-beta on 0.9.0-beta after my RaspiBlitz hdd died. Trying to start he LND service produces the stack trace below.

Your environment

  • 0.9.0-beta
  • Linux DarkTerritory 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux
  • bitcoin-core version 19.0.1-beta
  • running on raspiblitz 1.4

Steps to reproduce

Trying to start the service produces the following error

Mar 19 04:25:56 DarkTerritory lnd[21850]: panic: freepages: failed to get all reachable pages (page 18562: multiple references)
Mar 19 04:25:56 DarkTerritory lnd[21850]: goroutine 15 [running]:
Mar 19 04:25:56 DarkTerritory lnd[21850]: github.com/coreos/bbolt.(*DB).freepages.func2(0x245e880)
Mar 19 04:25:56 DarkTerritory lnd[21850]: github.com/coreos/bbolt@v1.3.3/db.go:1003 +0xcc
Mar 19 04:25:56 DarkTerritory lnd[21850]: created by github.com/coreos/bbolt.(*DB).freepages
Mar 19 04:25:56 DarkTerritory lnd[21850]: github.com/coreos/bbolt@v1.3.3/db.go:1001 +0x108

Not exactly sure if I got myself into a bad state but I tried to recover LND version 0.7.1-beta on 0.9.0-beta after my RaspiBlitz hdd died.

Are you able to start with v0.7.1? When running 0.9.0, do you have free list syncing on?

@Roasbeef I abandoned trying to recover on 0.9.0-beta but got a different error when trying to recover on 0.7.1-beta:
Unable to create server: no active channels exist
I'm in the process of trying a different recovery method on 0.7.1-beta at the moment.

It sounds like the freepages space of your database got corrupted. You could try to create a copy in safe mode that ignores the freepages. I added the compactdb command to my channel tools that does exactly that: https://github.com/guggero/chantools

Anyway, it probably is better to try running v0.9.0 instead of the older one.

I think your assumption was probably correct. I was able to recover using a channel.backup file that the zap iOS wallet had and the 24-word cipher seed. I'm still missing some funds in the wallet but it looks like their is some ways to try and recover this. We can probably close this issue.

Ok, closing the issue.
It could be that some peers you had channels to aren't online currently and the restore procedure can't be executed for those channels. If the balance doesn't return in a day or two, feel free to contact me directly. There are ways to get those funds back. Just don't delete your corrupted database file yet, it might still contain useful data for that case of the offline channel peers.