-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[bug]: LND falls out of sync when Bitcoin Core's IP address changes #9353
Comments
Are you running with the health check system on? It's meant to catch failures like this, then cause a restart of Here're the health check params I'm referring to:
|
@Roasbeef yes, it's on, and in production we've set
And we see the following from healthcheck after restart:
Then it succeeds to connect to the RPC port (in spite of IP address change). So at least RPC can handle an IP address change. My guess is that it's the ZMQ connection that stops working, and the health check doesn't verify that connection. So health check doesn't help here. |
I'm running into something similar but it seems LND is not able to recover and connect to the new container IP of bitcoind. This occurred after updating Bitcoin Core from 28.0 -> 28.1 resulting in a new container IP for Bitcoin Core. LND logs show the failed Health Check, but it never seems to recover.
Bitcoin Core's RPC is accessible at bitcoind.embassy:8332, but LND is not able to connect to the host until LND is restarted. It would be desirable for LND to be resilient to changes in Bitcoin Core's container IP instead of requiring the user to restart LND themselves. Env: |
@Dominion5254 how does Start9 configure the |
It is the former, bitcoind has a static hostname which LND uses. |
Hmm, okay. Then I guess we need to make sure we re-resolve the IP address when reconnecting. |
Background
We run two LND nodes in kubernetes, and after restarting the backing Bitcoin Core node, we notice that LND falls out of sync with the blockchain.
This happens because, in our kubernetes environment, the IP address of Bitcoin Core changes when it is restarted.
synced_to_chain
will becomefalse
and no new blocks will be received.Your environment
lnd
: v0.18.2-betauname -a
on *Nix):Linux lnd-routing-0 6.8.0-1018-aws #19~22.04.1-Ubuntu SMP Wed Oct 9 17:10:38 UTC 2024 aarch64 Linux
and
Linux 9db991b293cb 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 Linux
btcd
,bitcoind
, or other backend: Bitcon Core 27.0Steps to reproduce
I'll show how I reproduce it in regtest, but we get the same issue in production (running in kubernetes) too.
When running this,
bitcoin
resolves to172.18.0.2
.lncli -network=regtest getinfo
and check thatsynced_to_chain
istrue
.bitcoin
resolves to e.g.172.18.0.6
.lncli -network=regtest getinfo
.synced_to_chain
will befalse
, butblock_height
andblock_hash
will be the most recent one.After this, LND will not receive any new blocks, but it has apparently reconnected (presumably through RPC) to get the latest block hash. My guess is that ZMQ stops working due to the IP address change.
Expected behaviour
After reconnecting to the node it should eventually show
"synced_to_chain": true
. Alternatively (it it's a ZMQ connection issue) I'd expect LND to scream pretty loudly in the log.Actual behaviour
"synced_to_chain": false
indefinitely and we see no new logs of typeThe text was updated successfully, but these errors were encountered: