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

[bug]: Channel stuck in inactive state. #9468

Open
racarr202 opened this issue Feb 1, 2025 · 8 comments · May be fixed by btcsuite/btcwallet#974
Open

[bug]: Channel stuck in inactive state. #9468

racarr202 opened this issue Feb 1, 2025 · 8 comments · May be fixed by btcsuite/btcwallet#974
Assignees
Labels
bug Unintended code behaviour neutrino Lightweight neutrino backend-type rpc Related to the RPC interface
Milestone

Comments

@racarr202
Copy link

Background

Opened a channel to node Kraken (02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69@52.13.118.208:9735) using lightning terminal.
Channel point https://mempool.space/tx/ed081cd6744ebdcca9a498a22925dcc7bf6ad7cae9f367c59e79fa2b85c94848#vout=0 has received sufficient confirmations that channel should be opened and active.
Channel info is as follows.
{
"active": false,
"remote_pubkey": "02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69",
"channel_point": "ed081cd6744ebdcca9a498a22925dcc7bf6ad7cae9f367c59e79fa2b85c94848:0",
"chan_id": "969449297852235776",
"capacity": "5000000",
"local_balance": "4997943",
"remote_balance": "0",
"commit_fee": "1727",
"commit_weight": "772",
"fee_per_kw": "1243",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0",
"pending_htlcs": [],
"csv_delay": 600,
"private": false,
"initiator": true,
"chan_status_flags": "ChanStatusDefault",
"local_chan_reserve_sat": "50000",
"remote_chan_reserve_sat": "50000",
"static_remote_key": false,
"commitment_type": "ANCHORS",
"lifetime": "21136",
"uptime": "21136",
"close_address": "",
"push_amount_sat": "0",
"thaw_height": 0,
"local_constraints": {
"csv_delay": 600,
"chan_reserve_sat": "50000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "4950000000",
"min_htlc_msat": "1000",
"max_accepted_htlcs": 50
},
"remote_constraints": {
"csv_delay": 600,
"chan_reserve_sat": "50000",
"dust_limit_sat": "354",
"max_pending_amt_msat": "4950000000",
"min_htlc_msat": "1",
"max_accepted_htlcs": 483
},
"alias_scids": [],
"zero_conf": false,
"zero_conf_confirmed_scid": "0",
"peer_alias": "Kraken 🐙⚡",
"peer_scid_alias": "0",
"memo": "",
"custom_channel_data": ""
}

Your environment

lncli version 0.18.4-beta commit=lightning-terminal-v0.14.0-alpha
Linux lnl-node 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Neutrino backend

Steps to reproduce

Unsure how to reproduce issue.

Expected behaviour

Channel should be active.

Actual behaviour

Channel active state remains false after sufficient confirmations.

@racarr202 racarr202 added bug Unintended code behaviour needs triage labels Feb 1, 2025
@ziggie1984
Copy link
Collaborator

Please share the logs of your node, set the HSWC system and the PEER subsystem to debug, and reconnect the Kraken-Node manually via lncli disconnect => then lncli connect.

In anyways we need logs to tell whats going on.

@racarr202
Copy link
Author

racarr202 commented Feb 1, 2025

[WRN] RPCS: UnsafeDisconnect mode, disconnecting from peer(02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69) while there are 1 active channels

[ERR] RPCS: [/lnrpc.Lightning/DisconnectPeer]: unable to disconnect peer: peer 02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69 is not connected

[INF] SRVR: Established connection to: 02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69@52.13.118.208:9735

[INF] SRVR: Finalizing connection to 02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69@52.13.118.208:9735, inbound=false

[INF] PEER: Peer(02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69): Loading ChannelPoint(ed081cd6744ebdcca9a498a22925dcc7bf6ad7cae9f367c59e79fa2b85c94848:0), isPending=false

[INF] HSWC: ChannelLink(ed081cd6744ebdcca9a498a22925dcc7bf6ad7cae9f367c59e79fa2b85c94848:0): starting

[ERR] HSWC: AddLink failed to start link with chanID=4848c9852bfa799ec567f3e9cad76abfc7dc2529a298a4a9ccbd4e74d61c08ed: Rescan is already done and cannot be updated. It returned error: did not get response before timeout

[INF] HSWC: Removing channel link with ChannelID(4848c9852bfa799ec567f3e9cad76abfc7dc2529a298a4a9ccbd4e74d61c08ed)

[WRN] SRVR: Starting peer=02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69 got error: unable to load channels: unable to add link ed081cd6744ebdcca9a498a22925dcc7bf6ad7cae9f367c59e79fa2b85c94848:0 to switch: Rescan is already done and cannot be updated. It returned error: did not get response before timeout

[INF] PEER: Peer(02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69): disconnecting 02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69@52.13.118.208:9735, reason: unable to start peer: unable to load channels: unable to add link ed081cd6744ebdcca9a498a22925dcc7bf6ad7cae9f367c59e79fa2b85c94848:0 to switch: Rescan is already done and cannot be updated. It returned error: did not get response before timeout

Let me know if you need trace debug level for anything.

@ziggie1984
Copy link
Collaborator

ziggie1984 commented Feb 2, 2025

I identified the problem in the btcwallet/neutrino package, seems like we are forgetting to mark a finsihed rescan as done here:

https://github.com/btcsuite/btcwallet/blob/93c858b2ad6390f574f73dc05d3c610cb78a8efc/chain/neutrino.go#L802

This needs a fix in the btcwallet/neutriono package, in the meantime you can try to either use a pruned bitcoind node as a backend or switch off the watchtower client for a bit until the fix is released.

@ziggie1984 ziggie1984 added neutrino Lightweight neutrino backend-type rpc Related to the RPC interface and removed needs triage labels Feb 2, 2025
@racarr202
Copy link
Author

racarr202 commented Feb 3, 2025

I don't really understand the problem you are describing but if I follow your suggestion and switch the watchtower client off could I switch it back on again or will the issue return when the watchtower client turns on again?

@ziggie1984
Copy link
Collaborator

So yes for now it seems that you have to switch off the client for now until the fix is out (not restarting the client but keeping it off). Or you switch the backend to maybe bitcoind pruned until the fix is released.

Can you provide logs for of the LNWL and BTCN subsystems in debug mode ? It seems like your neutrino connection is unstable and aborts the rescan.

@ziggie1984
Copy link
Collaborator

Would you be able to run a patched version of your LND node ?

@saubyk saubyk added this to the v0.19.0 milestone Feb 4, 2025
@saubyk saubyk added this to lnd v0.19 Feb 4, 2025
@saubyk saubyk moved this to In Progress in lnd v0.19 Feb 4, 2025
@racarr202
Copy link
Author

Hi Ziggie1984, sorry for the slow reply.
Yes I'd be happy to run a patched version of LND but I'm afraid I am an electrical engineer not a software developer so you might need to hold my hand a bit through the process.
As for the immediate problem, I've temporarily switched off the watchtower client and the channel has become active.

@ziggie1984
Copy link
Collaborator

ziggie1984 commented Feb 5, 2025

So what would be very helpful in the first place is, that you change the debug level of your LND and provide us with the full logs, you can read more about how to do that in https://docs.lightning.engineering/lightning-network-tools/lnd/debugging_lnd

If you have questions feels free to reach out.

We need to understand why the rescanning process which is a long-lasting process interrupted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour neutrino Lightweight neutrino backend-type rpc Related to the RPC interface
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants