lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.73k stars 2.09k forks source link

unable to create server: unable to read channel ... Main process exited, code=exited, status=1/FAILURE #1728

Closed hakonamatata closed 6 years ago

hakonamatata commented 6 years ago

Background

My lightning node / service keep crashing. I get this output:

admin@RaspiBolt:~ $ lncli unlock
Input wallet password:

lnd successfully unlocked!
admin@RaspiBolt:~ $ sudo journalctl -f -u lnd
-- Logs begin at Thu 2016-11-03 18:16:43 CET. --
Aug 15 11:03:56 RaspiBolt lnd[1812]: Automatically obtained bitcoind's RPC credentials
Aug 15 11:03:56 RaspiBolt lnd[1812]: 2018-08-15 11:03:56.233 [INF] LTND: Version 0.4.2-beta commit=7cf5ebe2650b6798182e10be198c7ffc1f1d6e19
Aug 15 11:03:56 RaspiBolt lnd[1812]: 2018-08-15 11:03:56.233 [INF] LTND: Active chain: Bitcoin (network=testnet)
Aug 15 11:03:56 RaspiBolt lnd[1812]: 2018-08-15 11:03:56.234 [INF] CHDB: Checking for schema update: latest_version=0, db_version=0
Aug 15 11:03:56 RaspiBolt lnd[1812]: 2018-08-15 11:03:56.301 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
Aug 15 11:03:56 RaspiBolt lnd[1812]: 2018-08-15 11:03:56.302 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
Aug 15 11:03:56 RaspiBolt lnd[1812]: 2018-08-15 11:03:56.302 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create wallet, or `lncli unlock` to unlock already created wallet.
Aug 15 11:04:32 RaspiBolt lnd[1812]: 2018-08-15 11:04:32.371 [INF] LNWL: Opened wallet
Aug 15 11:04:32 RaspiBolt lnd[1812]: 2018-08-15 11:04:32.858 [INF] LTND: Primary chain is set to: bitcoin
Aug 15 11:04:32 RaspiBolt lnd[1812]: 2018-08-15 11:04:32.858 [INF] LTND: Initializing bitcoind backed fee estimator
Aug 15 11:04:39 RaspiBolt lnd[1812]: 2018-08-15 11:04:39.124 [INF] LNWL: Opened wallet
Aug 15 11:04:39 RaspiBolt lnd[1812]: 2018-08-15 11:04:39.557 [INF] LNWL: Started listening for blocks via ZMQ on tcp://127.0.0.1:29000
Aug 15 11:04:45 RaspiBolt lnd[1812]: 2018-08-15 11:04:45.367 [INF] LNWL: The wallet has been unlocked without a time limit
Aug 15 11:04:45 RaspiBolt lnd[1812]: 2018-08-15 11:04:45.368 [INF] LTND: LightningWallet opened
Aug 15 11:04:45 RaspiBolt lnd[1812]: 2018-08-15 11:04:45.484 [INF] HSWC: Restoring in-memory circuit state from disk
Aug 15 11:04:45 RaspiBolt lnd[1812]: 2018-08-15 11:04:45.488 [INF] HSWC: Payment circuits loaded: num_pending=7, num_open=6
Aug 15 11:04:45 RaspiBolt lnd[1812]: 2018-08-15 11:04:45.546 [ERR] SRVR: unable to create server: unable to read channel for chain_hash=43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000, node_key=03ad367178e939a68a7c88711788e431c39496f14b6bdd8356dcf60be0c97b8a16: unable to read channel data for chan_point=bf9739258e5af13733214562eaa0147ac1173f7d5164a8d1a1fe1ee5a6ecc311:0: unable to fetch chan info: no chan info found
Aug 15 11:04:45 RaspiBolt systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Aug 15 11:04:45 RaspiBolt systemd[1]: lnd.service: Unit entered failed state.
Aug 15 11:04:45 RaspiBolt systemd[1]: lnd.service: Failed with result 'exit-code'.

Your environment

lnd-linux-arm-v0.4.2-beta

Linux RaspiBolt 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linux

bitcoin-0.16.2-arm-linux

Steps to reproduce

Everything worked fine.

Tried to manually create a channel with lightning gem's node https://testnet.lightninggem.com/

03ad367178e939a68a7c88711788e431c39496f14b6bdd8356dcf60be0c97b8a16@35.185.13.214:9736.

This seem to work, but I think I got a channel id = 0

After this it keep crashing.

Can I reset and restart everything somehow?

Roasbeef commented 6 years ago

This issue has been fixed in master, you're running a pretty old release, and we'll cutting 0.5 pretty soon here. Check out this issue for the current work around for older nodes: https://github.com/lightningnetwork/lnd/issues/1476#issuecomment-402299584

hakonamatata commented 6 years ago

Thanks @Roasbeef, see that there has been a lot of commits since my version. Installed the latest version from the master branch.

admin@RaspiBolt:/home/bitcoin/.lnd $ lncli -v lncli version 0.4.2 commit=90cdc9da8f60dd94d99d61fd9e86a7ffd39b3b1b

admin@RaspiBolt:/home/bitcoin/.lnd $ sudo journalctl -f -u lnd

-- Logs begin at Thu 2016-11-03 18:16:43 CET. --
Aug 16 15:02:29 RaspiBolt systemd[1]: Started LND Lightning Daemon.
Aug 16 15:02:30 RaspiBolt systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 15:02:30 RaspiBolt systemd[1]: lnd.service: Unit entered failed state.
Aug 16 15:02:30 RaspiBolt systemd[1]: lnd.service: Failed with result 'exit-code'.
Aug 16 15:03:30 RaspiBolt systemd[1]: lnd.service: Service hold-off time over, scheduling restart.
Aug 16 15:03:30 RaspiBolt systemd[1]: Stopped LND Lightning Daemon.
Aug 16 15:03:30 RaspiBolt systemd[1]: Started LND Lightning Daemon.
Aug 16 15:03:30 RaspiBolt systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 15:03:30 RaspiBolt systemd[1]: lnd.service: Unit entered failed state.
Aug 16 15:03:30 RaspiBolt systemd[1]: lnd.service: Failed with result 'exit-code'.

But this resulted in a new error message :/

Roasbeef commented 6 years ago

Your latest comment doesn't show this new error message. Did you apply the patch from the PR I linked to?

hakonamatata commented 6 years ago

I pulled the latest version from master.

I was able to make it work finally. I removed everything except lnd and lncli in the .lnd folder Also changed the config to contain rpcuser and rpcpass then i generated a new cert manually..

rm tls.*
openssl ecparam -genkey -name prime256v1 -out tls.key
openssl req -new -sha256 -key tls.key -out csr.csr -subj '/CN=localhost/O=lnd'
openssl req -x509 -sha256 -days 36500 -key tls.key -in csr.csr -out tls.cert