lightninglabs / chantools

A loose collection of tools all somehow related to lnd and Lightning Network channels.
MIT License
222 stars 32 forks source link

trigger force close not working #160

Closed alex250472 closed 1 month ago

alex250472 commented 1 month ago

triggerforceclose not working

command: sudo chantools triggerforceclose --peer 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 --channel_point 0343cf3d12ed8208aade0c7c3e8b7f5f64256e7175905b2137c2adb077bd849:0

node has tried to close from their end but receives this message: 'They sent ERROR channel 067…: unable to resume channel, recovery required'

receive below response when using above command:

2024-09-17 18:44:49.145 [INF] CHAN: Attempting to connect to peer 03edfc1919ca6fe4de6a6645e544486bf5a651122fdb2172b6c96ce3fb68956d51, dial timeout is 1m0s 2024-09-17 18:44:49.156 [DBG] CHDB: Populating in-memory channel graph, this might take a while... 2024-09-17 18:44:49.157 [DBG] CHDB: Finished populating in-memory channel graph (took 50.034µs, num_node_features=0, num_nodes=0, num_channels=0) 2024-09-17 18:44:49.157 [INF] CHDB: Checking for schema update: latest_version=31, db_version=31 2024-09-17 18:44:49.157 [INF] CHDB: Checking for optional update: prune_revocation_log=false, db_version=empty 2024-09-17 18:44:49.157 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Sending Init to 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 18:44:49.294 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Received Init from 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 18:44:49.294 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Loaded 0 active channels from database 2024-09-17 18:44:49.294 [INF] CHAN: Connection established to peer 03edfc1919ca6fe4de6a6645e544486bf5a651122fdb2172b6c96ce3fb68956d51 2024-09-17 18:44:49.294 [INF] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Negotiated chan series queries 2024-09-17 18:44:49.294 [INF] CHAN: Sending channel error message to peer to trigger force close of channel 0343cf3d12ed8208aade0c7c3e8b7f5f64256e7175905b2137c2adb077bd849:0 2024-09-17 18:44:49.294 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Sending Error(type=17) to 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 18:44:49.294 [INF] CHAN: Message sent, waiting for force close transaction to appear in mempool Error: error getting channel address: error decoding data from API 'https://blockstream.info/api/tx/0343cf3d12ed8208aade0c7c3e8b7f5f64256e7175905b2137c2adb077bd849', server might be experiencing temporary issues, try again later; error details: invalid character 'I' looking for beginning of value Usage: chantools triggerforceclose [flags]

Examples: chantools triggerforceclose \ --peer 03abce...@xx.yy.zz.aa:9735 \ --channel_point abcdef01234...:x

Flags: --apiurl string API URL to use (must be esplora compatible) (default "https://blockstream.info/api") --bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag --channel_point string funding transaction outpoint of the channel to trigger the force close of (:) -h, --help help for triggerforceclose --peer string remote peer address (pubkey>@<host[:]) --rootkey string BIP32 HD root key of the wallet to use for deriving the identity key; leave empty to prompt for lnd 24 word aezeed

Global Flags: -r, --regtest Indicates if regtest parameters should be used -s, --signet Indicates if the public signet parameters should be used -t, --testnet Indicates if testnet parameters should be used

error getting channel address: error decoding data from API 'https://blockstream.info/api/tx/0343cf3d12ed8208aade0c7c3e8b7f5f64256e7175905b2137c2adb077bd849', server might be experiencing temporary issues, try again later; error details: invalid character 'I' looking for beginning of value

guggero commented 1 month ago

unable to resume channel, recovery required

If your peer cannot manually force close the channel, then trying to trigger the same over the p2p network won't work either. Did they restore from a backup as well?

server might be experiencing temporary issues, try again later; error details:

As the message mentions: the blockstream.info server isn't responding with the expected response. Did you try again later?

alex250472 commented 1 month ago

thankyou for prompt response. yes have been trying for past 2 days. I have 3million sats on my side of channel.

guggero commented 1 month ago

You can check the status manually by looking up the channel funding transaction (0343cf3d12ed8208aade0c7c3e8b7f5f64256e7175905b2137c2adb077bd849) on a block explorer. But it doesn't seem to exist, so the channel never made it to the chain. And since it never confirmed, it also cannot be force closed. Without more information available, I'd say the funds have already been spent by your node in another transaction.

alex250472 commented 1 month ago

this is the transaction when channel was opened

https://mempool.space/tx/1752571bafee62e7494686cc2774a372c128fcb2f613e43c72077de83a5c7606

guggero commented 1 month ago

Then you are using the wrong --channel_point argument in your call.

alex250472 commented 1 month ago

ok, using correct channel point, now getting this:

sudo chantools triggerforceclose --peer 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 --channel_point 1752571bafee62e7494686cc2774a372c128fcb2f613e43c72077de83a5c7606:0

024-09-17 19:14:07.041 [INF] CHAN: Attempting to connect to peer 03edfc1919ca6fe4de6a6645e544486bf5a651122fdb2172b6c96ce3fb68956d51, dial timeout is 1m0s 2024-09-17 19:14:07.058 [DBG] CHDB: Populating in-memory channel graph, this might take a while... 2024-09-17 19:14:07.058 [DBG] CHDB: Finished populating in-memory channel graph (took 51.542µs, num_node_features=0, num_nodes=0, num_channels=0) 2024-09-17 19:14:07.058 [INF] CHDB: Checking for schema update: latest_version=31, db_version=31 2024-09-17 19:14:07.058 [INF] CHDB: Checking for optional update: prune_revocation_log=false, db_version=empty 2024-09-17 19:14:07.058 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Sending Init to 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 19:14:07.209 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Received Init from 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 19:14:07.209 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Loaded 0 active channels from database 2024-09-17 19:14:07.210 [INF] CHAN: Connection established to peer 03edfc1919ca6fe4de6a6645e544486bf5a651122fdb2172b6c96ce3fb68956d51 2024-09-17 19:14:07.210 [INF] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Negotiated chan series queries 2024-09-17 19:14:07.210 [INF] CHAN: Sending channel error message to peer to trigger force close of channel 1752571bafee62e7494686cc2774a372c128fcb2f613e43c72077de83a5c7606:0 2024-09-17 19:14:07.210 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Sending Error(type=17) to 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 19:14:07.210 [INF] CHAN: Message sent, waiting for force close transaction to appear in mempool 2024-09-17 19:14:14.359 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:14:19.505 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:14:29.973 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:14:35.113 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:14:41.341 [INF] CHAN: No spends found yet, waiting 5 seconds...

2024-09-17 19:16:36.964 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:16:44.926 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:16:50.203 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:16:56.641 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:17:06.014 [INF] CHAN: No spends found yet, waiting 5 seconds... 2024-09-17 19:17:07.210 [DBG] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): Sending Ping(ping_bytes=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) to 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880 2024-09-17 19:17:07.210 [INF] PEER: Peer(03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976): disconnecting 03627ebe50fc6eb80b0caab0c3714958c701eda735e3c29588e83150d6d4a93976@184.75.221.211:39880, reason: unable to write message: write tcp 192.168.1.196:55376->184.75.221.211:39880: write: broken pipe 2024-09-17 19:17:15.549 [INF] CHAN: No spends found yet, waiting 5 seconds...

guggero commented 1 month ago

The command seems to work and does what it intends to do. But it's not a guarantee to arrive at the desired result. You're still dependent on the other node to do the right thing (and them actually still having the channel state). Try it a couple of more times. And if nothing happens, try to contact the peer.

alex250472 commented 1 month ago

have asked the peer yesterday (after i was sending the correct channel point).

as discussed previously, they are getting this message when they try to close from their side. "They sent ERROR channel 067...: unable to resume channel, recovery required" and it won't let me do anything with the channel.

guggero commented 1 month ago

Sounds like they also lost some data. You might have to look into a zombie recovery, guide is here: https://github.com/lightninglabs/chantools/blob/master/doc/zombierecovery.md