ElementsProject / lightning

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

After system reboot >> Could not connect to 'lightning-rpc': Connection refused #3859

Closed jodobear closed 4 years ago

jodobear commented 4 years ago

Issue

I have read everything there is to read about this error but, the only answer i've found is that lightningd isn't running. Well, that isn't the case with here.

System

OS: Debian/buster64 ENV: Vagrant bitcoind dir: ~/.bitcnoind lightningd dir: ~/.lightnind

Steps to reproduce:

  1. Fresh install bitcoind
  2. Install lightningd
  3. Run rpc commands - all good.
  4. Reboot system
  5. Get the error

Following is the output of lightnind after reboot:

2020-07-20T02:59:44.639Z UNUSUAL plugin-bcli: Could not connect to 'lightning-rpc': Connection refused
2020-07-20T02:59:44.652Z INFO plugin-bcli: bitcoin-cli initialized and connected to bitcoind.
2020-07-20T02:59:44.730Z UNUSUAL lightningd: Waiting for initial block download (this can take a while!)
2020-07-20T02:59:44.732Z UNUSUAL lightningd: Unable to estimate opening fees
...
2020-07-20T02:59:44.732Z UNUSUAL lightningd: Unable to estimate max_acceptable fees
2020-07-20T02:59:44.925Z UNUSUAL plugin-bcli: bitcoin-cli getblock 00000000000000ad6082acfe902b2ee294f4d1219f12b67bf59f88bb9d4af729 0 exited with status 1

Is this a case of file permissions? Directory paths? ..? I have no clue what i'm doing wrong. I've followed the install process to the T.

Any help highly appreciated.

getinfo output

Could not connect to 'lightning-rpc': Connection refused

ZmnSCPxj commented 4 years ago

Do you use some kind of lightning.conf? What command line do you use to start lightningd?

jodobear commented 4 years ago

nope, no conf file. I just use lightningd --daemon immediately after install and also after reboot.

EDIT: In fact, before in my initial attempts i was using a config file which resulted in the same error, so i did a step by step install and found a way to reproduce it without doing anything over and above basic installation. So, no config, no systemd service setup, no tor config or anything else

ZmnSCPxj commented 4 years ago

With lightningd running, can you show output of tree -apug $LIGHTNINGDIR?

vincenzopalazzo commented 4 years ago

@ZmnSCPxj is possible if the user run the lightningd without --daemon and maybe with the --log-level=debug is possible to see the stack trace if there is some error?

ZmnSCPxj commented 4 years ago

Yes, good suggestion.

darosior commented 4 years ago

This is a bitcoind "issue", you just need to wait for IBD.

cdecker commented 4 years ago

I added a commit to the fixup queue in #3857 that removes the, often misinterpreted, warning about being unable to connect to the JSON-RPC. So we should now scare users a bit less :-)