Repository navigation
Closed
Description
I connected to a node and opened a channel:
$ lightning-cli listpeers | grep 0333b58f86a0c31da7ee61a4bc2232faccf8c4fe4167fe0dd9ce019fe03e82faac
<empty, not connected to this node yet>
$ lightning-cli connect 0333b58f86a0c31da7ee61a4bc2232faccf8c4fe4167fe0dd9ce019fe03e82faac 52.215.249.189 9735
{ "id" : "0333b58f86a0c31da7ee61a4bc2232faccf8c4fe4167fe0dd9ce019fe03e82faac" }
$ lightning-cli fundchannel 0333b58f86a0c31da7ee61a4bc2232faccf8c4fe4167fe0dd9ce019fe03e82faac 50000
lightning-cli: reading response: Success
Lightningd crashed:
2018-02-18T23:43:21.033Z lightningd(17531): 0333b58f86a0c31da7ee61a4bc2232faccf8c4fe4167fe0dd9ce019fe03e82faac chan #0: State changed from UNINITIALIZED to OPENINGD
wallet_channel_save: UNIQUE constraint failed: peers.node_id
2018-02-18T23:43:21.040Z lightningd(17531): wallet_channel_save: UNIQUE constraint failed: peers.node_id
Log dumped in crash.log
2018-02-18T23:43:21.849Z lightningd(17531): FATAL SIGNAL 6 RECEIVED
2018-02-18T23:43:21.861Z lightningd(17531): backtrace: lightningd/log.c:498 (log_crash) 0x411f92
2018-02-18T23:43:21.861Z lightningd(17531): backtrace: (null):0 ((null)) 0x7f351c4694af
2018-02-18T23:43:21.861Z lightningd(17531): backtrace: (null):0 ((null)) 0x7f351c469428
2018-02-18T23:43:21.861Z lightningd(17531): backtrace: (null):0 ((null)) 0x7f351c46b029
2018-02-18T23:43:21.861Z lightningd(17531): backtrace: lightningd/log.c:587 (fatal) 0x4123cc
2018-02-18T23:43:21.862Z lightningd(17531): backtrace: wallet/db.c:217 (db_exec_prepared_) 0x44e5dc
2018-02-18T23:43:21.862Z lightningd(17531): backtrace: wallet/wallet.c:800 (wallet_channel_save) 0x4535d3
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: lightningd/peer_control.c:2415 (peer_offer_channel) 0x420902
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: lightningd/peer_control.c:2492 (gossip_peer_released) 0x420d73
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: lightningd/subd.c:306 (sd_msg_reply) 0x4269e0
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: lightningd/subd.c:454 (sd_msg_read) 0x426fc5
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: lightningd/subd.c:327 (read_fds) 0x426add
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x45e440
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: ccan/ccan/io/io.c:387 (do_plan) 0x45ef17
2018-02-18T23:43:21.863Z lightningd(17531): backtrace: ccan/ccan/io/io.c:397 (io_ready) 0x45ef55
2018-02-18T23:43:21.864Z lightningd(17531): backtrace: ccan/ccan/io/poll.c:310 (io_loop) 0x460824
2018-02-18T23:43:21.864Z lightningd(17531): backtrace: lightningd/lightningd.c:378 (main) 0x4106e6
2018-02-18T23:43:21.864Z lightningd(17531): backtrace: (null):0 ((null)) 0x7f351c45482f
2018-02-18T23:43:21.864Z lightningd(17531): backtrace: (null):0 ((null)) 0x4032d8
2018-02-18T23:43:21.864Z lightningd(17531): backtrace: (null):0 ((null)) 0xffffffffffffffff
Fatal signal 6. 0x412078 log_crash
lightningd/log.c:524
0x7f351c4694af ???
???:0
0x7f351c469428 ???
???:0
0x7f351c46b029 ???
???:0
0x4123cc fatal
lightningd/log.c:587
0x44e5dc db_exec_prepared_
wallet/db.c:217
0x4535d3 wallet_channel_save
wallet/wallet.c:800
0x420902 peer_offer_channel
lightningd/peer_control.c:2415
0x420d73 gossip_peer_released
lightningd/peer_control.c:2492
0x4269e0 sd_msg_reply
lightningd/subd.c:306
0x426fc5 sd_msg_read
lightningd/subd.c:454
0x426add read_fds
lightningd/subd.c:327
0x45e440 next_plan
ccan/ccan/io/io.c:59
0x45ef17 do_plan
ccan/ccan/io/io.c:387
0x45ef55 io_ready
ccan/ccan/io/io.c:397
0x460824 io_loop
ccan/ccan/io/poll.c:310
0x4106e6 main
lightningd/lightningd.c:378
0x7f351c45482f ???
???:0
0x4032d8 ???
By the time of the crash, my node was fully caught up. After the restart, it's now catching up again:
$ lightning-cli getinfo
{ "id" : "036487e0bd981617c674c2856fc0050472a0182838e0a4a1a67545c6cdee9f49a0", "port" : 9735, "address" :
[
{ "type" : "ipv4", "address" : "81.6.40.158", "port" : 9735 } ], "version" : "v0.5.2-2016-11-21-1990-gb2819f9", "blockheight" : 507142, "network" : "bitcoin" }
I might have been connected to this node in the past. I happen to have a copy of the sqllite DB from before the crash.
$ sqlite3 /tmp/lightningd.sqlite3
SQLite version 3.11.0 2016-02-15 17:29:24
Enter ".help" for usage hints.
sqlite> select id, hex(node_id), address from peers where hex(node_id) like "0333%";
102|0333B58F86A0C31DA7EE61A4BC2232FACCF8C4FE4167FE0DD9CE019FE03E82FAAC|52.215.249.189:9735
So despite listpeers not listing the node, it's still in the peers table. There is no channel referencing it though:
sqlite> select id, state from channels where hex(peer_id) like "0333%";
I can reproduce this, so let me know if you need more info.
Metadata
Metadata
Assignees
Labels
No labels
Activity
cdecker commentedon Feb 19, 2018
Thanks @sadilek for the detailed issue report. I think this is similar to (if not a duplicate of) #1000
sadilek commentedon Feb 19, 2018
Indeed, sorry for missing that one. The issue seems to have been resolved for @Sjors after a dev-rescan-outputs. I can still reproduce it though. My node was caught up by now, and I ran this:
Node crashed with same error.
rustyrussell commentedon Feb 20, 2018
Hmm, what state does the db say it's in?
cdecker commentedon Feb 20, 2018
@rustyrussell
peersdoesn't have a state, it's channels that have :-)sadilek commentedon Feb 20, 2018
@rustyrussell, still the same: There is an entry for the peer but no channel for it:
windsok commentedon Feb 21, 2018
I also have this error, running commit e48a97f
This occurred while the node was unattended, so was not due to any direct action by me
windsok commentedon Feb 21, 2018
laanwj commentedon Feb 21, 2018
Same issue here, it happens reproducibly between two of my own nodes, which used to have a channel in the past. This channel was auto-closed due to unknown (to me) reasons. When I try to fundchannel a new channel from the one to the other node, on the connected-to node I get the error:
Same result as those above when trying with
sqlite3: the peer is in the database, no channels.wallet: remove obsolete peers.
wallet: remove obsolete peers.
rustyrussell commentedon Feb 22, 2018
wallet: remove obsolete peers.
sadilek commentedon Feb 22, 2018
Thanks, I can confirm that this issue is fixed for me!
yoss1x commentedon Dec 23, 2018
I'm having the same issue with v0.6.2 - peers table has a record which no channel on channels table is referencing. When said peer is trying to
fundchannelthe remote node crashes:Here are the logs from the channel closing event few weeks ago:
While #1066 removes such channel-less peers during upgrade, until it does, a peer in that state will crash a node whenever it tries opening a channel.
Wasn't sure if to comment here or open new, let me know if a new issue is better.
ZmnSCPxj commentedon Dec 24, 2018
@yoss1x maybe better to make a new issue, referencing this one.