Closed harvhat closed 2 months ago
I've open another set of three channels using multifundchannel
and again bkpr-inspect
works for only one of them, crashing lightningd on the other two. In this case and the previous two cases referred to above the channel that works is the last one listed in the accounts table in the sqlite3 db.
If anyone actually cares about this bug it is reproducable on regtest (using the account_id
not the peer_id
as that was a typo in the OP)
source contrib/startup_regtest.sh
start_ln 4
connect 1 2
connect 1 3
connect 1 4
fund_nodes
l1-cli listpeerchannels
l1-cli close 03c21776dbf44a0f2ef1a58742056d5fe09dbab60a054a18c5ac18dfc1d3300115
bitcoin-cli -datadir="$PATH_TO_BITCOIN" -regtest generatetoaddress 5 "$ADDRESS"
l1-cli listfunds
l1-cli listpeers
l1-cli multifundchannel '[{"id":"03c21776dbf44a0f2ef1a58742056d5fe09dbab60a054a18c5ac18dfc1d3300115","amount":"100000sat"},{"id":"02f081f38929a054740c1bc107dc026e306ecced49c57926c483ef5ee07a2d2de2","amount":"200000sat"},{"id":"03b01a79afd28b80a16350c07fb0880f57e859b718de794ce77684e88c4827213f","amount":"300000sat"}]'
bitcoin-cli -datadir="$PATH_TO_BITCOIN" -regtest generatetoaddress 100 "$ADDRESS"
l1-cli listfunds
l1-cli bkpr-listbalances
{
"accounts": [
{
"account": "wallet",
"balances": [
{
"balance_msat": 99399429000,
"coin_type": "bcrt"
}
]
},
{
"account": "582224f6b7678c7239142f1dc3428e60c36ad0a2cbac2e81134f6a7b40d55f09",
"peer_id": "03c21776dbf44a0f2ef1a58742056d5fe09dbab60a054a18c5ac18dfc1d3300115",
"we_opened": true,
"account_closed": true,
"account_resolved": true,
"resolved_at_block": 124,
"balances": [
{
"balance_msat": 0,
"coin_type": "bcrt"
}
]
},
{
"account": "cda9bf1ff902298a9d81beb4445ae74527cac776a204acc32cc603479e00eeac",
"peer_id": "03c21776dbf44a0f2ef1a58742056d5fe09dbab60a054a18c5ac18dfc1d3300115",
"we_opened": true,
"account_closed": false,
"account_resolved": false,
"balances": [
{
"balance_msat": 100000000,
"coin_type": "bcrt"
}
]
},
{
"account": "7f6a8c3fc87ae04eca9b4220a85493ae6937da6fd0469f237960a3a9a911d235",
"peer_id": "02f081f38929a054740c1bc107dc026e306ecced49c57926c483ef5ee07a2d2de2",
"we_opened": true,
"account_closed": false,
"account_resolved": false,
"balances": [
{
"balance_msat": 200000000,
"coin_type": "bcrt"
}
]
},
{
"account": "2a8e270c03c7d8d806eb7263b5198aa4c6f7b125365869252c5639062ee43f50",
"peer_id": "03b01a79afd28b80a16350c07fb0880f57e859b718de794ce77684e88c4827213f",
"we_opened": true,
"account_closed": false,
"account_resolved": false,
"balances": [
{
"balance_msat": 300000000,
"coin_type": "bcrt"
}
]
}
]
}
l1-cli bkpr-inspect 582224f6b7678c7239142f1dc3428e60c36ad0a2cbac2e81134f6a7b40d55f09
{ ...snip... normal listing showed up here ...}
l1-cli bkpr-inspect cda9bf1ff902298a9d81beb4445ae74527cac776a204acc32cc603479e00eeac
bookkeeper: plugins/bkpr/recorder.c:365: find_account_onchain_fees: Assertion `ok' failed.
bookkeeper: FATAL SIGNAL 6 (version v23.11-1-g84f2206)
0x564449abccbb send_backtrace
common/daemon.c:33
0x564449abcd43 crashdump
common/daemon.c:75
0x7f7389c0efcf ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7f7389c5dd3c __pthread_kill_implementation
./nptl/pthread_kill.c:44
0x7f7389c0ef31 __GI_raise
../sysdeps/posix/raise.c:26
0x7f7389bf9471 __GI_abort
./stdlib/abort.c:79
0x7f7389bf9394 __assert_fail_base
./assert/assert.c:92
0x7f7389c07e31 __GI___assert_fail
./assert/assert.c:101
0x564449aa7e0d find_account_onchain_fees
plugins/bkpr/recorder.c:365
0x564449aa2d40 json_inspect
plugins/bkpr/bookkeeper.c:259
0x564449aadc4d ld_command_handle
plugins/libplugin.c:1645
0x564449aade49 ld_read_json_one
plugins/libplugin.c:1721
0x564449aaded9 ld_read_json
plugins/libplugin.c:1741
0x564449bf073c next_plan
ccan/ccan/io/io.c:59
0x564449bf0bc3 do_plan
ccan/ccan/io/io.c:407
0x564449bf0c5c io_ready
ccan/ccan/io/io.c:417
0x564449bf24b9 io_loop
ccan/ccan/io/poll.c:453
0x564449aae537 plugin_main
plugins/libplugin.c:1948
0x564449aa3874 main
plugins/bkpr/bookkeeper.c:1849
0x7f7389bfa1c9 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f7389bfa284 __libc_start_main_impl
../csu/libc-start.c:360
0x564449a9da10 ???
???:0
0xffffffffffffffff ???
???:0
bookkeeper: FATAL SIGNAL 11 (version v23.11-1-g84f2206)
0x564449abccbb send_backtrace
common/daemon.c:33
0x564449abcd43 crashdump
common/daemon.c:75
0x7f7389c0efcf ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x0 ???
???:0
{
"code": -4,
"message": "Plugin terminated before replying to RPC call."
}
cc @niftynei 😄
@evansmj and I were able to reproduce and debug, patch incoming; tldr there's a SQL command that's grouping on the wrong thing and causing a crash.
Good news is all your data is/should be correct, just need a software update to be able to see it without crashing.
ready for review ^
@harvhat @harvhat33 A fix has been merged to v24.02, just wondering if this has resolved your issue?
Closing this as resolved until further notice.
Issue and Steps to Reproduce
Of my 12 channels 4 for them crash plugin-bookkeeper when attempting to run
lightning-cli bkpr-inspect <peer_id>
Perhaps of note (or not)
multifundchannel
was used to fund these channels in two transactions, each transaction only has 1 channel that isn't crashingbkpr-inspect
. Also all my channels funded singularly usingfundchannel
aren't causing issues.getinfo
output