Glitch in backup procedure restored a 10h old data, is recovery possible?
More a general question than a bug, and this is an exceptional circumstance.
Background
As per the title
Your environment
- version of
lnd
0.5.1-beta
- which operating system (
uname -aon *Nix)
Linux
An error in a backup script caused lnd to restart, but with the backup data from 10 hours earlier. No tx were done during this period. Most channels were closed and funds automatic recovered, apart from a couple of them that are in an indefinite state.
Example: channel 00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0
Logs right after the catastrophic restart:
2019-02-01 20:34:38.298 [ERR] LNWL: ChannelPoint(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0), sync failed with local data loss: remote believes our tail height is 418, while we have 417!
2019-02-01 21:39:34.855 [INF] CNCT: Attempting to force close ChannelPoint(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0)
2019-02-01 21:39:34.883 [INF] CNCT: ChannelArbitrator(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0): force closing chan
2019-02-01 21:39:34.909 [INF] CNCT: Broadcasting force close transaction, ChannelPoint(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0):
Then a golang struct of the tx is printed...
But the close tx cannot be sent:
2019-02-01 21:39:34.915 [ERR] CNCT: ChannelArbitrator(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0): unable to broadcast close tx: Transaction rejected: output already spent
2019-02-01 21:39:34.933 [INF] PEER: Waiting for confirmation of cooperative close of ChannelPoint(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0) with txid: ea2e4062b93fda32e3452f8d13eddb3ff3017d9d4d76b34483ea89248c392c6e
And the channel is in a zombie state, where cannot be started:
2019-02-01 23:50:08.006 [WRN] PEER: ChannelPoint(00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0) has status Unknown(00000110), won't start.
and shows as pending in lncli pending channels
{
"channel": {
"remote_node_pub": "0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c",
"channel_point": "00862a5518c7b3472506e66c9f2df2c1d37aa970376ac30c5ff93b87a695c66d:0",
"capacity": "2700000",
"local_balance": "666107",
"remote_balance": "0"
},
"limbo_balance": "666107"
}
That "limbo balance" is tied to the address: bc1qsn0mxr4m948v0rvlnkz6tnlwcfmpgcwylhq470
So I guess I lost those funds right? ;)
Did you manually trigger the force close? This is the same as breaching the channel, and looks like the remote node took the funds. The next version of LND will make sure this cannot be done for channels that have had their state lost.
It is generally not advised to attempt channel backups, as these things can happen.
For me a nearly same situation occurred. Fortunatelly also I did not do any transactions during the period. Unfortunately during the period OTHER nodes CLOSED six channels!
For me the version of lnd is: version 0.5.2-beta commit=v0.5.2-beta You mentioned: "The next version of LND will make sure this cannot be done for channels that have had their state lost.". Does that mean that i can recover my funds?
What did I do?
pending channels showed six waiting_close_channels.
My lnd.log showed: ChannelPoint(ca59f20c8a371678c4e2abaab4fbc0123e864cb2d39c0391c12afb120174b9b3:0) has status LocalDataLoss, won't start
I did manually trigger the force close on that channel The result was:
closechannel --force ca59f20c8a371678c4e2abaab4fbc0123e864cb2d39c0391c12afb120174b9b3
{
"closing_txid": "784e0713b7fc4a4e50d50fb449f9fe4b0d5bc93452e334ae65d350c776aae25d"
}
In my lnd.log I got the followed result:
2019-03-11 13:18:19.232 [INF] LNWL: Inserting unconfirmed transaction 784e0713b7fc4a4e50d50fb449f9fe4b0d5bc93452e334ae65d350c776aae25d
2019-03-11 13:18:19.343 [ERR] CNCT: ChannelArbitrator(ca59f20c8a371678c4e2abaab4fbc0123e864cb2d39c0391c12afb120174b9b3:0): unable to broadcast close tx: Transaction rejected: output already spent
2019-03-11 13:18:19.378 [INF] CNCT: ChannelArbitrator(ca59f20c8a371678c4e2abaab4fbc0123e864cb2d39c0391c12afb120174b9b3:0): noop trigger userTrigger
2019-03-11 13:18:19.378 [INF] PEER: Waiting for confirmation of cooperative close of ChannelPoint(ca59f20c8a371678c4e2abaab4fbc0123e864cb2d39c0391c12afb120174b9b3:0) with txid: 784e0713b7fc4a4e50d50fb449f9fe4b0d5bc93452e334ae65d350c776aae25d
2019-03-11 13:18:19.378 [INF] NTFN: New confirmation subscription: txid=784e0713b7fc4a4e50d50fb449f9fe4b0d5bc93452e334ae65d350c776aae25d, numconfs=1
2019-03-11 13:18:19.394 [ERR] CNCT: Unable to disable channel ca59f20c8a371678c4e2abaab4fbc0123e864cb2d39c0391c12afb120174b9b3:0 on close: edge not found
I think this is not looking good. After a couple confirmations the channel still appear in my pending channels in the waiting_close_channels section :-(
Does that mean those funds are lost forever? Is it still possible that this will resolve automatically by waiting more days???
Any comment is appreciated. Thanks in advance
I'm opening a new topic since this issue is closed.