lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.64k stars 2.08k forks source link

Can't get LND working after update from 0.4 to 0.5 #2130

Closed jayjarosz closed 5 years ago

jayjarosz commented 5 years ago

Background

I haven't touched my node in a few months. The last version of LND I had was 0.4.

Yesterday I started updating my system. Started with Ubuntu, then Bitcoin Core, and even go1.11 for the heck of it. Then I updated to LND v0.5 and tried to run it. The result has been fail.

My node is based on Stadicus' Thundroid guide here: https://github.com/Stadicus/guides/blob/master/thundroid/README.md

I checked that guide for new configurations and also looked at issues others were having. I made some changes, but I'm still can get LND started.

Bitcoin Core seems to be working fine though.

Your environment

Steps to reproduce

# bitcoind configuration for Thundroid
# /home/bitcoin/.bitcoin/bitcoin.conf

# Bitcoind options
server=1
daemon=1
txindex=1
disablewallet=1  # LND doesn't require the Bitcoin Core wallet.
#testnet=1       # Comment out to enable Bitcoin mainnet.

# Connection settings
rpcuser=bitcoin 
rpcpassword=xxxxxxxxxxxxxxxxxxxx
zmqpubrawblock=tcp://127.0.0.1:28332 
zmqpubrawtx=tcp://127.0.0.1:28333         # With LND, ZMQ ports cannot be the same!

# Optimizations for limited hardware
dbcache=100
maxorphantx=10
maxmempool=50
maxconnections=40
maxuploadtarget=5000
# systemd unit for bitcoind
# /etc/systemd/system/bitcoind.service

[Unit]
Description=Bitcoin daemon
After=network.target

[Service]
# ExecStart creates /run/bitcoind owned by bitcoin
ExecStart=/usr/local/bin/bitcoind -daemon -conf=/home/bitcoin/.bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid
PIDFile=/run/bitcoind/bitcoind.pid
RuntimeDirectory=bitcoind
User=bitcoin
Group=bitcoin
Type=forking
Restart=on-failure

#####################
# HARDENING MEASURES

# Provide a private /tmp and /var/tmp.
PrivateTmp=true

# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full

# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true

# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true

# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true

[Install]
WantedBy=multi-user.target
# Thundroid: lnd configuration
# /home/bitcoin/.lnd/lnd.conf

[Application Options]
debuglevel=debug
debughtlc=true
maxpendingchannels=5
alias=xxxxxxxxxx
color=#000000

[Bitcoin]
bitcoin.active=1
bitcoin.node=bitcoind

# enable either testnet or mainnet
#bitcoin.testnet=1
bitcoin.mainnet=1

[autopilot]

#autopilot.active=1
#autopilot.maxchannels=5
#autopilot.allocation=0.6
# Thundroid: systemd unit for lnd
# /etc/systemd/system/lnd.service

[Unit]
Description=LND Lightning Daemon
Wants=bitcoind.service
After=bitcoind.service

[Service]
ExecStart=/usr/local/bin/lnd
PIDFile=/home/bitcoin/.lnd/lnd.pid
User=bitcoin
Group=bitcoin
LimitNOFILE=128000
Type=simple
KillMode=process
TimeoutSec=180
Restart=always
RestartSec=60

[Install]
WantedBy=multi-user.target

Issue

After entering wallet password for lncli unlock, I get:

[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

sudo systemctl status lnd

● lnd.service - LND Lightning Daemon
   Loaded: loaded (/etc/systemd/system/lnd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2018-10-31 10:04:11 PDT; 2s ago
  Process: 8914 ExecStart=/usr/local/bin/lnd (code=exited, status=1/FAILURE)
 Main PID: 8914 (code=exited, status=1/FAILURE)

sudo journalctl -f -u lnd

-- Logs begin at Wed 2018-10-31 02:02:08 PDT. --
Oct 31 10:03:11 thundroid systemd[1]: Started LND Lightning Daemon.
Oct 31 10:03:11 thundroid systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Oct 31 10:03:11 thundroid systemd[1]: lnd.service: Unit entered failed state.
Oct 31 10:03:11 thundroid systemd[1]: lnd.service: Failed with result 'exit-code'.
Oct 31 10:04:11 thundroid systemd[1]: lnd.service: Service hold-off time over, scheduling restart.
Oct 31 10:04:11 thundroid systemd[1]: Stopped LND Lightning Daemon.
Oct 31 10:04:11 thundroid systemd[1]: Started LND Lightning Daemon.
Oct 31 10:04:11 thundroid systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Oct 31 10:04:11 thundroid systemd[1]: lnd.service: Unit entered failed state.
Oct 31 10:04:11 thundroid systemd[1]: lnd.service: Failed with result 'exit-code'.
Oct 31 10:05:11 thundroid systemd[1]: lnd.service: Service hold-off time over, scheduling restart.
Oct 31 10:05:11 thundroid systemd[1]: Stopped LND Lightning Daemon.
Oct 31 10:05:11 thundroid systemd[1]: Started LND Lightning Daemon.
Oct 31 10:05:11 thundroid systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Oct 31 10:05:11 thundroid systemd[1]: lnd.service: Unit entered failed state.
Oct 31 10:05:11 thundroid systemd[1]: lnd.service: Failed with result 'exit-code'.
Oct 31 10:06:11 thundroid systemd[1]: lnd.service: Service hold-off time over, scheduling restart.
Oct 31 10:06:11 thundroid systemd[1]: Stopped LND Lightning Daemon.
wpaulino commented 5 years ago

The systemctl logs above don't include the reason why lnd is exiting. Could you start lnd manually instead, rather than through systemd, and post the output here?

cfromknecht commented 5 years ago

@ManveerJarosz I’m sorry to hear you’re having trouble upgrading, a lottt has changed since 0.4 tho so not too surprised that this happened. In addition to logs, it would also be helpful if you could post your /home/bitcoin/.lnd/lnd.conf as there were some changes to configuration fields as well

jayjarosz commented 5 years ago

@cfromknecht I've updated my original post to include lnd.conf (meant to do so from the start, but double-posted lnd.service instead by accident).

jayjarosz commented 5 years ago

@wpaulino by starting LND manually, do you mean running sudo systemctl start lnd?

It produces the same output in journalctl.

Oct 31 12:05:45 thundroid systemd[1]: Started LND Lightning Daemon.
Oct 31 12:05:45 thundroid systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Oct 31 12:05:45 thundroid systemd[1]: lnd.service: Unit entered failed state.
Oct 31 12:05:45 thundroid systemd[1]: lnd.service: Failed with result 'exit-code'.
wpaulino commented 5 years ago

@wpaulino by starting LND manually, do you mean running sudo systemctl start lnd?

No, just run lnd at the shell prompt.

[Application Options] debuglevel=debug debughtlc=true maxpendingchannels=5 alias=xxxxxxxxxx color=#000000

The debughtlc option should be removed.

jayjarosz commented 5 years ago

@wpaulino removing debughtlc did the trick! Thank you so much! <3 :)