I have bitcoind and lnd set up on my Raspberry Pi according to the guide here.

Everything works great for the most part, and my node is up and running. I've been able to open a channel with another node, and other nodes have opened channel with me.

However, very often when I try to run a command against lncli the operation fails with the error [lncli] rpc error: code = Unavailable desc = grpc: the connection is unavailable. The lnd logs (sudo journalctl -f -u lnd) show:

lnd.service: Main process exited, code=exited, status=1/FAILURE
lnd.service: Unit entered failed state.
lnd.service: Failed with result 'exit-code'.

At those times, it seems like bitcoin is resyncing blocks (tail -f ./bitcoin/debug.log):

init message: Rewinding blocks...
init message: Verifying blocks...
Verifying last 6 blocks at level 3

If I wait for the above to finish and fresh UpdateTips to start rolling in, I'm able to unlock and use lncli again.

What's actually going on here? Do I just have bad luck/timing? Does bitcoind frequently rewind blocks, causing the rpc calls to fail?

  • 1
    That looks like part of the initial startup sequence; Perhaps bitcoind is crashing? Might be running out of memory or some other resource. Have you checked the debug.log for more info? – Raghav Sood May 9 '18 at 12:40
  • The init message, etc. stuff is from bitcoin. Running out of memory actually sounds like a possibility, will check that out! – Donnie Thomas May 9 '18 at 12:46
  • Looks like it should have enough memory: free --mega total used free shared buff/cache available Mem: 994 198 35 1 759 740 Swap: 1023 24 999 – Donnie Thomas May 9 '18 at 12:51
  • @RaghavSood looked into it, and seems like the bitcoind process crashes because of db corruption: 2018-05-11 12:23:42 LevelDB read failure: Corruption: block checksum mismatch. Doesn't seem like the pi is running out of memory, though. Any ideas what might cause corruption? Shitty external USB HDD, maybe? – Donnie Thomas May 11 '18 at 12:27
  • 1
    It's hard to say, but there are others on this site with more experience with that kind of stuff. My best guess is that the Pi was unable to keep up at some point, and the process crashed, and corrupted some part of the db. – Raghav Sood May 12 '18 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.