Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[bug]: LND not listening on port 8080 #7125

Closed
xmready opened this issue Nov 7, 2022 · 4 comments
Closed

[bug]: LND not listening on port 8080 #7125

xmready opened this issue Nov 7, 2022 · 4 comments

Comments

@xmready
Copy link

xmready commented Nov 7, 2022

Background

I installed LND with my full node, but it's not listening on port 8080 with the rest API. I haven't created any channels yet, but I wanted to get RTL running first, which requires the rest API on that port. I created a wallet fine and can use lncli fine.

Your environment

  • lnd version 0.15.4-beta commit=v0.15.4-beta
  • Linux 5.15.64-1-pve #1 SMP PVE 5.15.64-1 (Thu, 13 Oct 2022 10:30:34 +0200) x86_64 x86_64 x86_64 GNU/Linux
  • Bitcoin Core version v23.0.0
[Application Options]
alias=MyNode1
debuglevel=info
maxpendingchannels=5
listen=localhost
norest=false
restlisten=localhost:8080

# Password
wallet-unlock-password-file=/data/lnd/password.txt
wallet-unlock-allow-create=true

# Channel settings
bitcoin.basefee=1000
bitcoin.feerate=1
minchansize=100000
accept-keysend=true
accept-amp=true
protocol.wumbo-channels=true
protocol.no-anchors=false
coop-close-target-confs=24

# Watchtower
wtclient.active=true

# Performance
gc-canceled-invoices-on-startup=true
gc-canceled-invoices-on-the-fly=true
ignore-historical-gossip-filters=1
stagger-initial-reconnect=true
routing.strictgraphpruning=true
[Unit]
Description=LND Lightning Network Daemon
Wants=bitcoind.service
After=bitcoind.service

[Service]

# Service execution
###################
ExecStart=/usr/local/bin/lnd
ExecStop=/usr/local/bin/lncli stop

# Process management
####################
Type=simple
Restart=always
RestartSec=30
TimeoutSec=240
LimitNOFILE=128000

# Directory creation and permissions
####################################
User=lnd

# /run/lightningd
RuntimeDirectory=lightningd
RuntimeDirectoryMode=0710

# 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
# lsof -i | grep lnd | grep -i listen
lnd  9974  lnd  8u   IPv4  39509023  0t0  TCP localhost:10009 (LISTEN)
lnd  9974  lnd  9u   IPv4  39509025  0t0  TCP  localhost:http-alt (LISTEN)
lnd  9974  lnd  46u  IPv4  39509092  0t0  TCP  localhost:9735 (LISTEN)
$ node rtl
[11/7/2022, 3:34:35 PM] INFO: RTL => Server is up and running, please open the UI at http://localhost:3000 or your proxy configured url.

[11/7/2022, 3:35:05 PM] ERROR: Common => Error in Channel Backup for xxxxx: connect ECONNREFUSED ::1:8080

[11/7/2022, 3:35:05 PM] ERROR: GetInfo => Get Info Error: {"name":"RequestError","message":"Error: connect ECONNREFUSED ::1:8080","cause":{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8080},"error":{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8080},"options":{"url":"https://localhost:8080/v1/getinfo","rejectUnauthorized":false,"json":true,"headers":{},"method":"GET","qs":{},"simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}}

Expected behaviour

I should see port 8080 and RTL should establish a connection with it.

@xmready xmready added bug Unintended code behaviour needs triage labels Nov 7, 2022
@xmready xmready changed the title [bug]: [bug]: LND not listening on port 8080 Nov 7, 2022
@saubyk
Copy link
Collaborator

saubyk commented Nov 7, 2022

Hi @xmready try changing your restlisten setting to 127.0.0.1:8080 and restart LND

@saubyk saubyk added troubleshooting and removed bug Unintended code behaviour labels Nov 7, 2022
@xmready
Copy link
Author

xmready commented Nov 7, 2022

Hi @xmready try changing your restlisten setting to 127.0.0.1:8080 and restart LND

I just tried your suggestion, restarted lnd.service, and got the exact same results as in the OP. No dice.

@xmready
Copy link
Author

xmready commented Nov 7, 2022

Wait a minute, I just realized that the below line is actually referring to port 8080

lnd     2026  lnd    9u  IPv4 47396314      0t0  TCP localhost:http-alt (LISTEN)

So it appears LND is listening on port 8080 after all. The plot thickens as to why I cannot get RTL to communicate and why it's throwing errors about port 8080

@xmready
Copy link
Author

xmready commented Nov 7, 2022

I figured it out. I had to change localhostto 127.0.0.1 in the RTL config file. Nothing is wrong with LND and in fact I don't need the following lines in my config at all. This is an issue with RTL

norest=false
restlisten=127.0.0.1:8080

@xmready xmready closed this as completed Nov 7, 2022
VajraOfIndra pushed a commit to raspibolt/raspibolt that referenced this issue Nov 16, 2022
Change `localhost` to `127.0.0.1` in the RTL config file to avoid the following errors:
```
$ node rtl
[11/7/2022, 3:34:35 PM] INFO: RTL => Server is up and running, please open the UI at http://localhost:3000 or your proxy configured url.

[11/7/2022, 3:35:05 PM] ERROR: Common => Error in Channel Backup for xxxxx: connect ECONNREFUSED ::1:8080

[11/7/2022, 3:35:05 PM] ERROR: GetInfo => Get Info Error: {"name":"RequestError","message":"Error: connect ECONNREFUSED ::1:8080","cause":{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8080},"error":{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8080},"options":{"url":"https://localhost:8080/v1/getinfo","rejectUnauthorized":false,"json":true,"headers":{},"method":"GET","qs":{},"simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}}
```
Here is a link to an issue on the RTL GitHub describing the same problem with this change posted as the solution
Ride-The-Lightning/RTL#1120

Here is a link to an issue I created in the LND GitHub trying to troubleshoot it before I figured it out.
lightningnetwork/lnd#7125
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants