ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.82k stars 896 forks source link

bitcoin-cli exited with status 1 #4174

Closed dpblnt closed 3 years ago

dpblnt commented 3 years ago

Issue and Steps to Reproduce

I'm looking at these lines in the log, and I don't understand why, since lightning-cli getinfo |grep blockheight gives up to date info. Does the exit status 1 mean Operation not permitted ? 2020-11-02T17:50:11.585Z UNUSUAL plugin-bcli: /usr/local/bin/bitcoin-cli -datadir=/mnt/system/bitcoin -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -rpcpassword=... getblock 0000000000000000001024ddf26af504ed13fb5b0bca48c76a56d800675089ab 0 exited with status 1 2020-11-02T17:50:12.589Z UNUSUAL plugin-bcli: /usr/local/bin/bitcoin-cli -datadir=/mnt/system/bitcoin -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -rpcpassword=... getblock 0000000000000000001024ddf26af504ed13fb5b0bca48c76a56d800675089ab 0 exited with status 1

getinfo output

{
   "id": "0335f373bbb8c24d72734e3febb74a2548a44d35109f1b31b3299c8cdaf4435647",
   "alias": "BDO",
   "color": "ffff00",
   "num_peers": 1,
   "num_pending_channels": 0,
   "num_active_channels": 1,
   "num_inactive_channels": 0,
   "address": [
      {
         "type": "torv2",
         "address": "66hqtid2jcbfocgi.onion",
         "port": 9735
      },
      {
         "type": "torv3",
         "address": "rne2yu4cyunpsoolyfvz222fcpskmvr3bppl3wvuoomekpslu6q3oxqd.onion",
         "port": 9735
      }
   ],
   "binding": [
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9735
      }
   ],
   "version": "v0.9.1-265-gd151d55",
   "blockheight": 655133,
   "network": "bitcoin",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
}
darosior commented 3 years ago

Does the exit status 1 mean Operation not permitted ?

No, it means failure. But we handle failure, did you experience a crash ? What's the issue ?

cdecker commented 3 years ago

I presume you're running bitcoind with pruning enabled? The block it is trying to retrieve is block 598345 which at the time of writing has ~57k confirmations, and is likely in the pruned part of the blockchain, i.e., your bitcoind discarded the block to save disk space.

The error happens because your lightningd is trying to verify a channel_announcement that refers to a channel confirmed in that block. However, lightningd fails to retrieve the block (bitcoind discarded it), so it prints a small warning and may retry if another announcement for the same block comes in, or it may retry the same some seconds later.

It is not a fatal error, the daemon can continue just fine. It'll discard that one channel, but the rest of the network should be resilient enough to provide sufficiently many alternative paths to whatever destination.

It is therefore safe to ignore this warning.

dpblnt commented 3 years ago

True, I run bitcoind pruned. Thank you for your complete answer.