Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic if starting lnd while bitcoind is syncing #4818

Closed
halseth opened this issue Dec 2, 2020 · 4 comments
Closed

panic if starting lnd while bitcoind is syncing #4818

halseth opened this issue Dec 2, 2020 · 4 comments
Labels
bitcoind Bitcoin Core backend bug Unintended code behaviour wallet The wallet (lnwallet) which LND uses

Comments

@halseth
Copy link
Contributor

halseth commented Dec 2, 2020

Background

Started bitcoind + lnd, and since bitcoind had been offline for a while it took some time to catch up on blocks. When it was done syncing lnd crashed.

Your environment

  • version of lnd: recent master: 0.11.99-beta commit=v0.11.0-beta-534-g7e298f143425337448f95019234b22849d64aca3, build=production, logging=default, debuglevel=debug
  • which operating system (uname -a on *Nix): Mac OS Catalina
  • version of btcd, bitcoind, or other backend: bitcoind v0.20.1.0-g7ff64311bee570874c4f0dfa18f518552188df08
  • any other relevant environment details

Steps to reproduce

Start bitcoind that is behind tip, start lnd.

Expected behaviour

lnd should start up normally after bitcoind finishes sync.

Actual behaviour

lnd/btcwallet crashes:

156986 2020-11-28 11:03:51.462 [INF] LTND: Version: 0.11.99-beta commit=v0.11.0-beta-534-g7e298f143425337448f95019234b22849d64aca3, build=production, logging=default, debuglevel=debug
156987 2020-11-28 11:03:51.462 [INF] LTND: Active chain: Bitcoin (network=mainnet)
156988 2020-11-28 11:03:51.463 [INF] LTND: Opening the main database, this might take a few minutes...
156989 2020-11-28 11:03:51.463 [INF] LTND: Opening bbolt database, sync_freelist=false, auto_compact=true
...
156995 2020-11-28 11:03:55.149 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
156996 2020-11-28 11:04:05.438 [INF] LNWL: Opened wallet
156997 2020-11-28 11:04:05.543 [INF] CHRE: Primary chain is set to: bitcoin
156998 2020-11-28 11:04:09.167 [INF] CHRE: Initializing bitcoind backed fee estimator in CONSERVATIVE mode
156999 2020-11-28 11:04:09.167 [INF] LNWL: Started listening for bitcoind block notifications via ZMQ on 127.0.0.1:28332
157000 2020-11-28 11:04:09.167 [INF] LNWL: Started listening for bitcoind transaction notifications via ZMQ on 127.0.0.1:28333
157001 2020-11-28 11:04:09.173 [DBG] LNWL: Using minimum fee rate of 253 sat/kw
157002 2020-11-28 11:04:10.584 [INF] LNWL: The wallet has been unlocked without a time limit
157003 2020-11-28 11:04:17.492 [INF] CHRE: LightningWallet opened
157004 2020-11-28 11:04:17.493 [DBG] LNWL: Birthday block has already been verified: height=513668, hash=00000000000000000016892502c7d450de3415d53204707ae99c4fcafdf66c77
157005 2020-11-28 11:04:17.493 [DBG] LNWL: Waiting for chain backend to sync to tip
…
2020-11-28 11:04:22.694 [INF] LTND: Waiting for chain backend to finish sync, start_height=658913
2020-11-28 11:06:13.259 [DBG] LNWL: Chain backend synced to tip!
panic: Unable to synchronize wallet to chain: -8: Block height out of range

goroutine 122 [running]:
github.com/btcsuite/btcwallet/wallet.(*Wallet).handleChainNotifications(0xc000120140)
        /Users/johan/go/pkg/mod/github.com/btcsuite/btcwallet@v0.11.1-0.20201104022105-a6f3888450e4/wallet/chainntfns.go:117 +0x1253
created by github.com/btcsuite/btcwallet/wallet.(*Wallet).SynchronizeRPC
        /Users/johan/go/pkg/mod/github.com/btcsuite/btcwallet@v0.11.1-0.20201104022105-a6f3888450e4/wallet/wallet.go:201 +0x1f4
@halseth halseth added bug Unintended code behaviour wallet The wallet (lnwallet) which LND uses bitcoind Bitcoin Core backend crash labels Dec 2, 2020
@halseth
Copy link
Contributor Author

halseth commented Dec 3, 2020

panicking because we cannot sync chain: https://github.com/btcsuite/btcwallet/blob/master/wallet/chainntfns.go#L117

@Roasbeef Roasbeef added this to the v0.15.0 milestone Aug 31, 2021
@sangaman
Copy link
Contributor

sangaman commented Oct 14, 2021

I believe this would be fixed by btcsuite/btcwallet#677. Never mind, this looks like a separate issue.

@Roasbeef Roasbeef added this to To do in v0.15.0-beta via automation Feb 2, 2022
@Roasbeef Roasbeef modified the milestones: v0.15.0, v0.16.0 Mar 16, 2022
@Roasbeef Roasbeef removed this from To do in v0.15.0-beta Mar 16, 2022
@Roasbeef Roasbeef modified the milestones: v0.16.0, Future Aug 23, 2022
@Roasbeef
Copy link
Member

Closing this for now as seems this hasn't popped up in a while and may already be addressed.

@saubyk saubyk removed this from the Future milestone Feb 14, 2023
@ellemouton
Copy link
Collaborator

Looks like this popped up again now: #7449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitcoind Bitcoin Core backend bug Unintended code behaviour wallet The wallet (lnwallet) which LND uses
Projects
None yet
Development

No branches or pull requests

5 participants