Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

docker lnd not working #2829

Closed
awb99 opened this issue Mar 23, 2019 · 4 comments
Closed

docker lnd not working #2829

awb99 opened this issue Mar 23, 2019 · 4 comments

Comments

@awb99
Copy link

awb99 commented Mar 23, 2019

Background

I want to run lightening via docker images for mainnet:
Bitcoind is working:

export NETWORK="mainnet"
docker-compose up -d "btcd"

Lightening is NOT working:

export NETWORK="mainnet"
docker-compose run -d --name bob lnd_btc
docker exec -i -t bob bash

Your environment

  • version of lnd
    latest gihub commit
  • which operating system (uname -a on *Nix)
    manjaro / arch
  • version of btcd, bitcoind, or other backend
    latest gihub commit

Steps to reproduce

bash-4.4# cat lnd.log
2019-03-23 18:36:19.138 [WRN] LTND: open /root/.lnd/lnd.conf: no such file or directory
2019-03-23 18:36:19.139 [INF] LTND: Version: 0.5.2-99-beta commit=queue/v1.0.1-136-g6ad8be25e1aaf4700bd86303ae534cf36c6199bf, build=production, logging=default
2019-03-23 18:36:19.139 [INF] LTND: Active chain: Bitcoin (network=mainnet)
2019-03-23 18:36:19.198 [INF] CHDB: Checking for schema update: latest_version=8, db_version=8
2019-03-23 18:36:19.198 [INF] RPCS: Generating TLS certificates...
2019-03-23 18:36:19.205 [INF] RPCS: Done generating TLS certificates
2019-03-23 18:36:19.339 [INF] LTND: Primary chain is set to: bitcoin
2019-03-23 18:36:19.369 [INF] LTND: Initializing btcd backed fee estimator

I think something goes wrong with "Initializing btcd backed fee estimator"
Also it seems LTND daemon is not running:

bash-4.4# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 127.0.0.11:40215        0.0.0.0:*               LISTEN      
udp        0      0 127.0.0.11:41394        0.0.0.0:*                           
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
bash-4.4# 
@wpaulino
Copy link
Contributor

What does lnd's stdout/stderr show? It's possible that the node is exiting because it can't connect to btcd.

@awb99
Copy link
Author

awb99 commented Mar 26, 2019

@wpaulino I think it is the docker-compose setting that was somehow bad. I think there are several
"reasons". First, I think it is firing off multiple LND instances with docker-compose up. When I limited
it to one LND, then LND would move below the backend fee estimation issue. The other issue is that
RPC certificates are getting wrong over time, due to docker-compose issuing different ip adresses
over time. So I added some hacks to the start-lnd.sh script:

# Remove TLS certificates (docker-compose does not re-assign the same IP address; therefore certificates might be wrong)
rm /root/.lnd/tls.cert
rm /root/.lnd/tls.key

@awb99 awb99 closed this as completed Mar 26, 2019
@awb99
Copy link
Author

awb99 commented Mar 27, 2019

I found out the issue in the BTCD dockerfile. I think it is a bug of docker-compose or docker, and happens RANDOMLY, and not only on all machines.

The certificates that are generated do not include the hostname inside the docker-compose network.
Therefore the certificates are bad, and LND cannot connect.

  && "/bin/gencerts" --host="*" --host="btcd" --directory="/rpc" --force

By adding --host="btcd" it works. Possibly in your dockerfile this needs to be called rpcserver.

@awb99 awb99 reopened this Mar 27, 2019
@yancyribbens
Copy link
Contributor

@awb99 I created a PR to enable docker-compose up here. feedback welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants