lnd: lnd hangs at “waiting for chain backend to finish sync, start_height=521042”
lnd with bitcoind backend never gets past “waiting for chain backend to finish sync”, even though bitcoind is fully synced.
- version of
lnd: 0.4.1-beta - which operating system: Windows Server 2012 Core (no GUI)
- version of
bitcoindbackend: 0.16.0
I’m using Lightning Networks’ lnd 0.4.1-beta node in Windows, with a Bitcoin Core bitcoind full node backend. The bitcoind full node has the --txindex option, and is fully synced according to bitnodes.earn.com
I’ve configured bitcoind to use ZMQ, and indeed netstat -a -b shows bitcoind is listening on 28332 for ZMQ connections. Bitcoin.conf is configured with:
txindex=1 zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28332 zmqpubhashblock=tcp://127.0.0.1:28332 zmqpubhashtx=tcp://127.0.0.1:28332 server=1
lnd.conf has the following
debuglevel=debug logdir=E:\lnd\data\logs lnddir=E:\lnd datadir=E:\lnd\data bitcoin.active=1 bitcoin.mainnet-1 bitcoin.node=bitcoind bitcoin.chaindir=E:\lnd\data\bitcoin-chain bitcoind.dir=E:\data bitcoind.rpchost=localhost bitcoind.rpcuser=<username> bitcoind.rpcpass=<password> bitcoind.zmqpath=tcp://127.0.0.1:28332 autopilot.active=1 externalip=<x.x.x.x>
(needless to say, the user/pass and externalip are not literally those values listed).
lnd.log shows:
2018-05-03 09:12:22.305 [INF] LTND: Version 0.4.1-beta commit= 2018-05-03 09:12:22.308 [INF] LTND: Active chain: Bitcoin (network=mainnet) 2018-05-03 09:12:22.311 [INF] CHDB: Checking for schema update: latest_version=0, db_version=0 2018-05-03 09:12:22.312 [INF] RPCS: Generating TLS certificates... 2018-05-03 09:12:22.376 [INF] RPCS: Done generating TLS certificates 2018-05-03 09:12:22.396 [INF] RPCS: password RPC server listening on 127.0.0.1:10009 2018-05-03 09:12:22.397 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080 2018-05-03 09:12:22.399 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create wallet, or `lncli unlock` to unlock already created wallet. 2018-05-03 09:13:34.681 [INF] LNWL: Opened wallet 2018-05-03 09:13:34.785 [INF] LTND: Primary chain is set to: bitcoin 2018-05-03 09:13:34.786 [INF] LTND: Initializing bitcoind backed fee estimator 2018-05-03 09:13:36.624 [INF] LNWL: Opened wallet 2018-05-03 09:13:37.651 [INF] LNWL: Started listening for blocks via ZMQ on tcp://127.0.0.1:28332 2018-05-03 09:13:39.340 [INF] LNWL: The wallet has been unlocked without a time limit 2018-05-03 09:13:39.343 [INF] LTND: LightningWallet opened 2018-05-03 09:13:43.946 [INF] LNWL: Started rescan from block 0000000099c744455f58e6c6e98b671e1bf7f37346bfd4cf5d0274ad8ee660cb (height 10000) for 0 addresses 2018-05-03 09:13:44.237 [INF] LNWL: Starting rescan from block 0000000099c744455f58e6c6e98b671e1bf7f37346bfd4cf5d0274ad8ee660cb 2018-05-03 09:13:47.219 [INF] HSWC: Restoring in-memory circuit state from disk 2018-05-03 09:13:47.221 [INF] HSWC: Payment circuits loaded: num_pending=0, num_open=0 2018-05-03 09:13:47.233 [INF] RPCS: RPC server listening on 127.0.0.1:10009 2018-05-03 09:13:47.235 [INF] RPCS: gRPC proxy started at 127.0.0.1:8080 2018-05-03 09:13:49.243 [INF] LTND: Waiting for chain backend to finish sync, start_height=521042
The lnd daemon has been sitting at Waiting for chain backend to finish sync, start_height=521042 for 20 minutes, no change. bitcoind now reports it has just received block 521051.
Expected behaviour
lnd should work correctly or report an error if it cannot reliably connect to ZMQ at bitcoind.
Actual behaviour
lnd simply hangs at this point. lncli stop hangs as well. The only way to get lnd to stop is CTRL-C in the daemon window or “end task” via Task Manager.
Question has also been asked at https://bitcoin.stackexchange.com/questions/74687/lightning-node-daemon-hangs-at-waiting-for-chain-backend-to-finish-sync-start
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (19 by maintainers)
I’ll see if I can update the docs and submit a PR for it, if you like?
Yes a bit, the initial catch up process is mostly just fetching headers from
bitcoind. However, there’s no API forbitcoindto batch fetch these headers, so unfortunately we need to fetch all 500k+ serially.