ElementsProject/lightning

SQL Plugin crash after update to 24.08

m-schmoock opened this issue · 10 comments

Issue and Steps to Reproduce

I upgraded from 23.08 to 24.08. after doing --database-upgrade=true the daemon crashed with FATAL SIGNAL 11 on the SQL plugin. Note: the version v24.08-modded in the version string comes from self compilation of the release on my raspberry. The source is unmodified.

From the logs (below) it seems the SQL update went fine, but the daemon crashed when starting the SQL plugin.

Commandline Output

./lightningd 
Refusing to irreversibly upgrade db from version 234 to 256 in non-final version v24.08-modded (use --database-upgrade=true to override)
(venv) pi@will-pi:~/btcnode.git/bin $ ./lightningd --database-upgrade=true
sql: FATAL SIGNAL 11 (version v24.08-modded)
0x555c28ff4f send_backtrace
	common/daemon.c:33
0x555c28ffef crashdump
	common/daemon.c:75
0x7fa33207d7 ???
	???:0
0x555c27846c init_tablemap
	plugins/sql.c:1495
0x555c278557 init
	plugins/sql.c:1544
0x555c27ca0b handle_init
	plugins/libplugin.c:1395
0x555c27cccf ld_command_handle
	plugins/libplugin.c:1816
0x555c27d2ff ld_read_json_one
	plugins/libplugin.c:1998
0x555c27d3ab ld_read_json
	plugins/libplugin.c:2018
0x555c30185f next_plan
	ccan/ccan/io/io.c:60
0x555c301ec7 do_plan
	ccan/ccan/io/io.c:422
0x555c301f1f io_ready
	ccan/ccan/io/io.c:439
0x555c303eff io_loop
	ccan/ccan/io/poll.c:455
0x555c27df83 plugin_main
	plugins/libplugin.c:2230
0x555c2786a3 main
	plugins/sql.c:1667
0x7fa2eddda3 __libc_start_main
	../csu/libc-start.c:308
0x555c274ed3 ???
	???:0
Reading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peerReading JSON input: Connection reset by peer

Logfile

2024-09-12T09:26:14.826Z INFO    lightningd: v24.08-modded
2024-09-12T09:26:17.453Z UNUSUAL plugin-bookkeeper: topic 'utxo_deposit' is not a known notification topic
2024-09-12T09:26:17.454Z UNUSUAL plugin-bookkeeper: topic 'utxo_spend' is not a known notification topic
2024-09-12T09:26:17.586Z INFO    lightningd: Updating database from version 234 to 256
2024-09-12T09:30:10.154Z INFO    connectd: Static Tor service onion address: "....onion:9735,[::]:9735" bound from extern port 9735 
2024-09-12T09:30:10.419Z INFO    plugin-bcli: bitcoin-cli initialized and connected to bitcoind.
2024-09-12T09:30:31.362Z INFO    plugin-sql: Killing plugin: exited before replying to init
2024-09-12T09:30:31.362Z **BROKEN** plugin-sql: Plugin marked as important, shutting down lightningd!
2024-09-12T09:30:31.368Z **BROKEN** plugin-funder: Reading JSON input: Connection reset by peer
2024-09-12T09:30:31.368Z INFO    plugin-funder: Killing plugin: exited before replying to init
2024-09-12T09:30:31.369Z **BROKEN** plugin-funder: Plugin marked as important, shutting down lightningd!
2024-09-12T09:30:31.370Z **BROKEN** plugin-keysend: Reading JSON input: Connection reset by peer
2024-09-12T09:30:31.370Z INFO    plugin-keysend: Killing plugin: exited before replying to init
2024-09-12T09:30:31.370Z **BROKEN** plugin-keysend: Plugin marked as important, shutting down lightningd!
2024-09-12T09:30:31.371Z **BROKEN** plugin-offers: Reading JSON input: Connection reset by peer
2024-09-12T09:30:31.371Z INFO    plugin-offers: Killing plugin: exited before replying to init
2024-09-12T09:30:31.371Z **BROKEN** plugin-offers: Plugin marked as important, shutting down lightningd!

Update: I re-tried with a clean single core rebuild. Same issue

There was also another nullpointer crash related to plugin initialization which I worked-around by removing all custom plugins for the time being.

I switched back to 23.08 ...

Can you send the contents of "sql-schema_gen.h" ? This means it's failing to parse, which seems like a build error...

I'm guessing that you don't have jq installed?

contents of plugins/sql-schema_gen.h

"{\"listchannels\":{\"properties\":},\"listforwards\":{\"properties\":},\"listhtlcs\":{\"properties\":},\"listinvoices\":{\"properties\":},\"listnodes\":{\"properties\":},\"listoffers\":{\"properties\":},\"listpeers\":{\"properties\":},\"listpeerchannels\":{\"properties\":},\"listclosedchannels\":{\"properties\":},\"listtransactions\":{\"properties\":},\"listsendpays\":{\"properties\":},\"bkpr-listaccountevents\":{\"properties\":},\"bkpr-listincome\":{\"properties\":}}"

Hey @rustyrussell, I always have jq installed. But it doesn't do anything, beacause of the back-slashes escape \ within the JSON.

I can see on my development machine, that this file is supposed to be a lot bigger.
I checked that the make process returned no error (code 0) for that release, how can that be?

Also, I don't understand why or how, but my old (currently running) release 23.08 is having an identical short looking sql-schema_gen.h and not running into this error.

Nope, that was an git artifact. Seems like I don't have the old sql-schema_gen.h anymore.

contents of plugins/sql-schema_gen.h

"{\"listchannels\":{\"properties\":},\"listforwards\":{\"properties\":},\"listhtlcs\":{\"properties\":},\"listinvoices\":{\"properties\":},\"listnodes\":{\"properties\":},\"listoffers\":{\"properties\":},\"listpeers\":{\"properties\":},\"listpeerchannels\":{\"properties\":},\"listclosedchannels\":{\"properties\":},\"listtransactions\":{\"properties\":},\"listsendpays\":{\"properties\":},\"bkpr-listaccountevents\":{\"properties\":},\"bkpr-listincome\":{\"properties\":}}"

Contents of the file above are missing properties details of all command schemas. For reference, my local plugins/sql-schema_gen.h looks like:

"{\"listchannels\":{\"properties\":{\"channels\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"source\":{\"type\":\"pubkey\"},\"destination\":{\"type\":\"pubkey\"},\"short_channel_id\":{\"type\":\"short_channel_id\"},\"direction\":{\"type\":\"u32\"},\"public\":{\"type\":\"boolean\"},\"amount_msat\":{\"type\":\"msat\"},\"message_flags\":{\"type\":\"u8\"},\"channel_flags\":{\"type\":\"u8\"},\"active\":{\"type\":\"boolean\"},\"last_update\":{\"type\":\"u32\"},\"base_fee_millisatoshi\":{\"type\":\"u32\"},\"fee_per_millionth\":{\"type\":\"u32\"},\"delay\":{\"type\":\"u32\"},\"htlc_minimum_msat\":{\"type\":\"msat\"},\"htlc_maximum_msat\":{\"type\":\"msat\"},\"features\":{\"type\":\"hex\"}}}}}},\"listforwards\":{\"properties\":{\"forwards\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"created_index\":{\"type\":\"u64\"},\"in_channel\":{\"type\":\"short_channel_id\"},\"in_htlc_id\":{\"type\":\"u64\"},\"in_msat\":{\"type\":\"msat\"},\"status\":{\"type\":\"string\"},\"received_time\":{\"type\":\"number\"},\"out_channel\":{\"type\":\"short_channel_id\"},\"out_htlc_id\":{\"type\":\"u64\"},\"updated_index\":{\"type\":\"u64\"},\"style\":{\"type\":\"string\"}},\"allOf\":[{\"then\":{\"properties\":{\"fee_msat\":{\"type\":\"msat\"},\"out_msat\":{\"type\":\"msat\"}}}},{\"if\":{\"properties\":{\"status\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"resolved_time\":{\"type\":\"number\"}}}},{\"if\":{\"properties\":{\"status\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"failcode\":{\"type\":\"u32\"},\"failreason\":{\"type\":\"string\"}}}}]}}}},\"listhtlcs\":{\"properties\":{\"htlcs\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"short_channel_id\":{\"type\":\"short_channel_id\"},\"id\":{\"type\":\"u64\"},\"expiry\":{\"type\":\"u32\"},\"amount_msat\":{\"type\":\"msat\"},\"direction\":{\"type\":\"string\"},\"payment_hash\":{\"type\":\"hash\"},\"state\":{\"type\":\"string\"}}}}}},\"listinvoices\":{\"properties\":{\"invoices\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"label\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"payment_hash\":{\"type\":\"hash\"},\"status\":{\"type\":\"string\"},\"expires_at\":{\"type\":\"u64\"},\"amount_msat\":{\"type\":\"msat\"},\"bolt11\":{\"type\":\"string\"},\"bolt12\":{\"type\":\"string\"},\"local_offer_id\":{\"type\":\"hash\"},\"invreq_payer_note\":{\"type\":\"string\"},\"created_index\":{\"type\":\"u64\"},\"updated_index\":{\"type\":\"u64\"}},\"allOf\":[{\"if\":{\"properties\":{\"status\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"pay_index\":{\"type\":\"u64\"},\"amount_received_msat\":{\"type\":\"msat\"},\"paid_at\":{\"type\":\"u64\"},\"paid_outpoint\":{\"type\":\"object\",\"properties\":{\"txid\":{\"type\":\"txid\"},\"outnum\":{\"type\":\"u32\"}}},\"payment_preimage\":{\"type\":\"secret\"}}}}]}}}},\"listnodes\":{\"properties\":{\"nodes\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"nodeid\":{\"type\":\"pubkey\"},\"last_timestamp\":{\"type\":\"u32\"}},\"allOf\":[{\"then\":{\"properties\":{\"alias\":{\"type\":\"string\"},\"color\":{\"type\":\"hex\"},\"features\":{\"type\":\"hex\"},\"addresses\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\"},\"port\":{\"type\":\"u16\"}},\"if\":{\"properties\":{\"type\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"address\":{\"type\":\"string\"}}}}}}}},{\"then\":{\"properties\":{\"option_will_fund\":{\"type\":\"object\",\"properties\":{\"lease_fee_base_msat\":{\"type\":\"msat\"},\"lease_fee_basis\":{\"type\":\"u32\"},\"funding_weight\":{\"type\":\"u32\"},\"channel_fee_max_base_msat\":{\"type\":\"msat\"},\"channel_fee_max_proportional_thousandths\":{\"type\":\"u32\"},\"compact_lease\":{\"type\":\"hex\"}}}}}}]}}}},\"listoffers\":{\"properties\":{\"offers\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"offer_id\":{\"type\":\"hash\"},\"active\":{\"type\":\"boolean\"},\"single_use\":{\"type\":\"boolean\"},\"bolt12\":{\"type\":\"string\"},\"used\":{\"type\":\"boolean\"},\"label\":{\"type\":\"string\"}}}}}},\"listpeers\":{\"properties\":{\"peers\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"pubkey\"},\"connected\":{\"type\":\"boolean\"},\"num_channels\":{\"type\":\"u32\"},\"log\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\"}},\"allOf\":[{\"then\":{\"type\":\"object\",\"properties\":{\"num_skipped\":{\"type\":\"u32\"}}}},{\"then\":{\"type\":\"object\",\"properties\":{\"time\":{\"type\":\"string\"},\"source\":{\"type\":\"string\"},\"log\":{\"type\":\"string\"},\"node_id\":{\"type\":\"pubkey\"}}}},{\"then\":{\"type\":\"object\",\"properties\":{\"time\":{\"type\":\"string\"},\"source\":{\"type\":\"string\"},\"log\":{\"type\":\"string\"},\"node_id\":{\"type\":\"pubkey\"},\"data\":{\"type\":\"hex\"}}}}]}}},\"allOf\":[{\"then\":{\"properties\":{\"netaddr\":{\"type\":\"array\",\"minItems\":1,\"maxItems\":1,\"items\":{\"type\":\"string\"}},\"remote_addr\":{\"type\":\"string\"},\"features\":{\"type\":\"hex\"}}}}]}}}},\"listpeerchannels\":{\"properties\":{\"channels\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"peer_id\":{\"type\":\"pubkey\"},\"peer_connected\":{\"type\":\"boolean\"},\"reestablished\":{\"type\":\"boolean\"},\"state\":{\"type\":\"string\"},\"scratch_txid\":{\"type\":\"txid\"},\"channel_type\":{\"type\":\"object\",\"properties\":{\"bits\":{\"type\":\"array\",\"items\":{\"type\":\"u32\"}},\"names\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"updates\":{\"type\":\"object\",\"properties\":{\"local\":{\"type\":\"object\",\"properties\":{\"htlc_minimum_msat\":{\"type\":\"msat\"},\"htlc_maximum_msat\":{\"type\":\"msat\"},\"cltv_expiry_delta\":{\"type\":\"u32\"},\"fee_base_msat\":{\"type\":\"msat\"},\"fee_proportional_millionths\":{\"type\":\"u32\"}}},\"remote\":{\"type\":\"object\",\"properties\":{\"htlc_minimum_msat\":{\"type\":\"msat\"},\"htlc_maximum_msat\":{\"type\":\"msat\"},\"cltv_expiry_delta\":{\"type\":\"u32\"},\"fee_base_msat\":{\"type\":\"msat\"},\"fee_proportional_millionths\":{\"type\":\"u32\"}}}}},\"ignore_fee_limits\":{\"type\":\"boolean\"},\"lost_state\":{\"type\":\"boolean\"},\"feerate\":{\"type\":\"object\",\"properties\":{\"perkw\":{\"type\":\"u32\"},\"perkb\":{\"type\":\"u32\"}}},\"owner\":{\"type\":\"string\"},\"short_channel_id\":{\"type\":\"short_channel_id\"},\"channel_id\":{\"type\":\"hash\"},\"funding_txid\":{\"type\":\"txid\"},\"funding_outnum\":{\"type\":\"u32\"},\"initial_feerate\":{\"type\":\"string\"},\"last_feerate\":{\"type\":\"string\"},\"next_feerate\":{\"type\":\"string\"},\"next_fee_step\":{\"type\":\"u32\"},\"inflight\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"funding_txid\":{\"type\":\"txid\"},\"funding_outnum\":{\"type\":\"u32\"},\"feerate\":{\"type\":\"string\"},\"total_funding_msat\":{\"type\":\"msat\"},\"splice_amount\":{\"type\":\"integer\"},\"our_funding_msat\":{\"type\":\"msat\"},\"scratch_txid\":{\"type\":\"txid\"}}}},\"close_to\":{\"type\":\"hex\"},\"private\":{\"type\":\"boolean\"},\"opener\":{\"type\":\"string\"},\"closer\":{\"type\":\"string\"},\"features\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"funding\":{\"type\":\"object\",\"properties\":{\"pushed_msat\":{\"type\":\"msat\"},\"local_funds_msat\":{\"type\":\"msat\"},\"remote_funds_msat\":{\"type\":\"msat\"},\"fee_paid_msat\":{\"type\":\"msat\"},\"fee_rcvd_msat\":{\"type\":\"msat\"}}},\"to_us_msat\":{\"type\":\"msat\"},\"min_to_us_msat\":{\"type\":\"msat\"},\"max_to_us_msat\":{\"type\":\"msat\"},\"total_msat\":{\"type\":\"msat\"},\"fee_base_msat\":{\"type\":\"msat\"},\"fee_proportional_millionths\":{\"type\":\"u32\"},\"dust_limit_msat\":{\"type\":\"msat\"},\"max_total_htlc_in_msat\":{\"type\":\"msat\"},\"their_reserve_msat\":{\"type\":\"msat\"},\"our_reserve_msat\":{\"type\":\"msat\"},\"spendable_msat\":{\"type\":\"msat\"},\"receivable_msat\":{\"type\":\"msat\"},\"minimum_htlc_in_msat\":{\"type\":\"msat\"},\"minimum_htlc_out_msat\":{\"type\":\"msat\"},\"maximum_htlc_out_msat\":{\"type\":\"msat\"},\"their_to_self_delay\":{\"type\":\"u32\"},\"our_to_self_delay\":{\"type\":\"u32\"},\"max_accepted_htlcs\":{\"type\":\"u32\"},\"alias\":{\"type\":\"object\",\"properties\":{\"local\":{\"type\":\"short_channel_id\"},\"remote\":{\"type\":\"short_channel_id\"}}},\"state_changes\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"timestamp\":{\"type\":\"string\"},\"old_state\":{\"type\":\"string\"},\"new_state\":{\"type\":\"string\"},\"cause\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"}}}},\"status\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"in_payments_offered\":{\"type\":\"u64\"},\"in_offered_msat\":{\"type\":\"msat\"},\"in_payments_fulfilled\":{\"type\":\"u64\"},\"in_fulfilled_msat\":{\"type\":\"msat\"},\"out_payments_offered\":{\"type\":\"u64\"},\"out_offered_msat\":{\"type\":\"msat\"},\"out_payments_fulfilled\":{\"type\":\"u64\"},\"out_fulfilled_msat\":{\"type\":\"msat\"},\"last_stable_connection\":{\"type\":\"u64\"},\"htlcs\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"direction\":{\"type\":\"string\"},\"id\":{\"type\":\"u64\"},\"amount_msat\":{\"type\":\"msat\"},\"expiry\":{\"type\":\"u32\"},\"payment_hash\":{\"type\":\"hash\"},\"local_trimmed\":{\"type\":\"boolean\"},\"status\":{\"type\":\"string\"}},\"allOf\":[{\"then\":{\"properties\":{\"state\":{\"type\":\"string\"}}}},{\"then\":{\"properties\":{\"state\":{\"type\":\"string\"}}}}]}}},\"allOf\":[{\"if\":{\"properties\":{\"peer_connected\":{\"type\":\"boolean\"}}},\"then\":{\"properties\":{\"reestablished\":{\"type\":\"boolean\"}}}},{\"then\":{\"properties\":{\"close_to_addr\":{\"type\":\"string\"}}}},{\"then\":{\"properties\":{\"last_tx_fee_msat\":{\"type\":\"msat\"}}}},{\"then\":{\"properties\":{\"direction\":{\"type\":\"u32\"}}}},{\"then\":{\"properties\":{\"initial_feerate\":{\"type\":\"string\"},\"last_feerate\":{\"type\":\"string\"},\"next_feerate\":{\"type\":\"string\"}}}}]}}}},\"listclosedchannels\":{\"properties\":{\"closedchannels\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"peer_id\":{\"type\":\"pubkey\"},\"channel_id\":{\"type\":\"hash\"},\"short_channel_id\":{\"type\":\"short_channel_id\"},\"alias\":{\"type\":\"object\",\"properties\":{\"local\":{\"type\":\"short_channel_id\"},\"remote\":{\"type\":\"short_channel_id\"}}},\"opener\":{\"type\":\"string\"},\"closer\":{\"type\":\"string\"},\"private\":{\"type\":\"boolean\"},\"channel_type\":{\"type\":\"object\",\"properties\":{\"bits\":{\"type\":\"array\",\"items\":{\"type\":\"u32\"}},\"names\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"total_local_commitments\":{\"type\":\"u64\"},\"total_remote_commitments\":{\"type\":\"u64\"},\"total_htlcs_sent\":{\"type\":\"u64\"},\"funding_txid\":{\"type\":\"txid\"},\"funding_outnum\":{\"type\":\"u32\"},\"leased\":{\"type\":\"boolean\"},\"funding_fee_paid_msat\":{\"type\":\"msat\"},\"funding_fee_rcvd_msat\":{\"type\":\"msat\"},\"funding_pushed_msat\":{\"type\":\"msat\"},\"total_msat\":{\"type\":\"msat\"},\"final_to_us_msat\":{\"type\":\"msat\"},\"min_to_us_msat\":{\"type\":\"msat\"},\"max_to_us_msat\":{\"type\":\"msat\"},\"last_commitment_txid\":{\"type\":\"hash\"},\"last_commitment_fee_msat\":{\"type\":\"msat\"},\"close_cause\":{\"type\":\"string\"},\"last_stable_connection\":{\"type\":\"u64\"}}}}}},\"listtransactions\":{\"properties\":{\"transactions\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hash\":{\"type\":\"txid\"},\"rawtx\":{\"type\":\"hex\"},\"blockheight\":{\"type\":\"u32\"},\"txindex\":{\"type\":\"u32\"},\"locktime\":{\"type\":\"u32\"},\"version\":{\"type\":\"u32\"},\"inputs\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"txid\":{\"type\":\"txid\"},\"index\":{\"type\":\"u32\"},\"sequence\":{\"type\":\"u32\"}}}},\"outputs\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"index\":{\"type\":\"u32\"},\"amount_msat\":{\"type\":\"msat\"},\"scriptPubKey\":{\"type\":\"hex\"}}}}}}}}},\"listsendpays\":{\"properties\":{\"payments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"created_index\":{\"type\":\"u64\"},\"id\":{\"type\":\"u64\"},\"groupid\":{\"type\":\"u64\"},\"partid\":{\"type\":\"u64\"},\"payment_hash\":{\"type\":\"hash\"},\"updated_index\":{\"type\":\"u64\"},\"status\":{\"type\":\"string\"},\"amount_msat\":{\"type\":\"msat\"},\"destination\":{\"type\":\"pubkey\"},\"created_at\":{\"type\":\"u64\"},\"amount_sent_msat\":{\"type\":\"msat\"},\"label\":{\"type\":\"string\"},\"bolt11\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"},\"bolt12\":{\"type\":\"string\"}},\"allOf\":[{\"if\":{\"properties\":{\"status\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"completed_at\":{\"type\":\"u64\"},\"payment_preimage\":{\"type\":\"secret\"}}}},{\"if\":{\"properties\":{\"status\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"erroronion\":{\"type\":\"hex\"}}}},{\"if\":{\"properties\":{\"status\":{\"type\":\"string\"}}}}]}}}},\"bkpr-listaccountevents\":{\"properties\":{\"events\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"account\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"},\"credit_msat\":{\"type\":\"msat\"},\"debit_msat\":{\"type\":\"msat\"},\"currency\":{\"type\":\"string\"},\"timestamp\":{\"type\":\"u32\"}},\"allOf\":[{\"if\":{\"properties\":{\"type\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"outpoint\":{\"type\":\"string\"},\"blockheight\":{\"type\":\"u32\"},\"origin\":{\"type\":\"string\"},\"payment_id\":{\"type\":\"hex\"},\"txid\":{\"type\":\"txid\"},\"description\":{\"type\":\"string\"}}}},{\"if\":{\"properties\":{\"type\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"txid\":{\"type\":\"txid\"}}}},{\"if\":{\"properties\":{\"type\":{\"type\":\"string\"}}},\"then\":{\"properties\":{\"fees_msat\":{\"type\":\"msat\"},\"is_rebalance\":{\"type\":\"boolean\"},\"payment_id\":{\"type\":\"hex\"},\"part_id\":{\"type\":\"u32\"}}}}]}}}},\"bkpr-listincome\":{\"properties\":{\"income_events\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"account\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"},\"credit_msat\":{\"type\":\"msat\"},\"debit_msat\":{\"type\":\"msat\"},\"currency\":{\"type\":\"string\"},\"timestamp\":{\"type\":\"u32\"},\"description\":{\"type\":\"string\"},\"outpoint\":{\"type\":\"string\"},\"txid\":{\"type\":\"txid\"},\"payment_id\":{\"type\":\"hex\"}}}}}}}"

When manually calling the make target (after removing plugins/sql-schema_gen.h) I get the following output, that leads to the plugins/sql-schema_gen.h being left incomplete.

Also interesting, that the returned error code of the make operation is 0, this is why I didn't see it earlier and was under the false assumption, that the build was complete, when infact it wasn't.

(venv) pi@will-pi:~/cln $ poetry run make plugins/sql-schema_gen.h
Makefile:394: warning: overriding recipe for target '&'
Makefile:297: warning: ignoring old recipe for target '&'
GEN plugins/sql-schema_gen.h
jq: error: walk/1 is not defined at <top-level>, line 1:
walk(if type == "object" then if has("description") and (.description | type) == "array" then del(.description) else . end else . end ) | walk(if type == "object" then del(.additionalProperties, .required, .enum, .maxLength, .minLength, .pre_return_value_notes, .post_return_value_notes, .anyOf, .oneOf, .hidden, .untyped, .default, .comment, .added, .maximum, .minimum, .pattern, .format) else . end) | walk(if type == "object" then with_entries(select(.value != {})) else . end) | .response.properties
jq: error: walk/1 is not defined at <top-level>, line 1:
walk(if type == "object" then if has("description") and (.description | type) == "array" then del(.description) else . end else . end ) | walk(if type == "object" then del(.additionalProperties, .required, .enum, .maxLength, .minLength, .pre_return_value_notes, .post_return_value_notes, .anyOf, .oneOf, .hidden, .untyped, .default, .comment, .added, .maximum, .minimum, .pattern, .format) else . end) | walk(if type == "object" then with_entries(select(.value != {})) else . end) | .response.properties                                                                                                                                          
jq: error: walk/1 is not defined at <top-level>, line 1:
walk(if type == "object" then if has("description") and (.description | type) == "array" then del(.description) else . end else . end ) | walk(if type == "object" then del(.additionalProperties, .required, .enum, .maxLength, .minLength, .pre_return_value_notes, .post_return_value_notes, .anyOf, .oneOf, .hidden, .untyped, .default, .comment, .added, .maximum, .minimum, .pattern, .format) else . end) | walk(if type == "object" then with_entries(select(.value != {})) else . end) | .response.properties                                                                                                                                                                                                                                                                                                                                                                                                                    
jq: 3 compile errors
... <skipped several pages of the same errors>
(venv) pi@will-pi:~/cln $ echo $?
0

Seems like my raspberry has pretty an outdated jq-1.5-1 version that was not an issue before, as we didn't use the special walk functions.

But its not nice, that the make script think its okay with error code 0