lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.66k stars 2.07k forks source link

Problem with the first Initialization of my LN node, dial tcp my-external-ip:9735: connect: connection timed out #4537

Closed scottcarter2020 closed 4 years ago

scottcarter2020 commented 4 years ago

Background

I was following 402 Payment Required's LN video over here (https://www.youtube.com/watch?v=q0siLF9zmWo) and everything was good so far, until the moment of the first Initialization of my LN node, I got an (dial tcp my-external-ip:9735: connect: connection timed out) error.

Your environment

Steps to reproduce

I don't know how to reproduce the problem but here is a log with my issue

2020-08-14 20:33:16.008 [INF] BTCN: Server listening on [::]:9735 2020-08-14 20:33:16.009 [INF] SRVR: Initializing peer network bootstrappers! 2020-08-14 20:33:16.009 [INF] SRVR: Creating DNS peer bootstrapper with seeds: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:33:16.010 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:33:16.022 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:33:16.426 [INF] DISC: Obtained 1 addrs to bootstrap network with 2020-08-14 20:33:19.428 [DBG] SRVR: Waiting 2s before trying to locate bootstrap peers (attempt #1) 2020-08-14 20:33:21.428 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:33:21.463 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:33:21.464 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:33:21.464 [DBG] SRVR: Waiting 4s before trying to locate bootstrap peers (attempt #2) 2020-08-14 20:33:25.464 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:33:25.504 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:33:25.504 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:33:25.504 [DBG] SRVR: Waiting 8s before trying to locate bootstrap peers (attempt #3) 2020-08-14 20:33:33.504 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:33:33.539 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:33:33.539 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:33:33.539 [DBG] SRVR: Waiting 16s before trying to locate bootstrap peers (attempt #4) 2020-08-14 20:33:49.540 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:33:49.540 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:33:49.578 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:33:49.578 [DBG] SRVR: Waiting 32s before trying to locate bootstrap peers (attempt #5) 2020-08-14 20:34:21.579 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:34:21.580 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:34:21.735 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:34:21.735 [DBG] SRVR: Waiting 1m0s before trying to locate bootstrap peers (attempt #6) 2020-08-14 20:35:21.736 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:35:21.736 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:35:22.280 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:35:22.280 [DBG] SRVR: Waiting 1m0s before trying to locate bootstrap peers (attempt #7) 2020-08-14 20:35:27.316 [ERR] SRVR: Unable to connect to ##################################################################@my-external-ip:9735: dial tcp my-external-ip:9735: connect: connection timed out 2020-08-14 20:36:22.280 [INF] DISC: Attempting to bootstrap with: BOLT-0010 DNS Seed: [[nodes.lightning.directory soa.nodes.lightning.directory] [lseed.bitcoinstats.com ]] 2020-08-14 20:36:22.347 [INF] CRTR: Pruning channel graph using block 0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 (height=643720) 2020-08-14 20:36:22.349 [INF] CRTR: Block 0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 (height=643720) closed 0 channels 2020-08-14 20:36:22.461 [DBG] NTFN: Filtering 3178 txns for 0 spend requests at height 643720 2020-08-14 20:36:22.523 [INF] NTFN: New block: height=643720, sha=0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 2020-08-14 20:36:22.523 [DBG] SWPR: New block: height=643720, sha=0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 2020-08-14 20:36:22.523 [INF] UTXN: Attempting to graduate height=643720: num_kids=0, num_babies=0 2020-08-14 20:36:22.524 [DBG] DISC: New block: height=643720, hash=0000000000000000000f09423cef42338b27f29244a99deed77411cf2e6edb57 2020-08-14 20:36:22.757 [INF] DISC: Attempting to bootstrap with: Authenticated Channel Graph 2020-08-14 20:36:22.758 [ERR] SRVR: Unable to retrieve initial bootstrap peers: no addresses found 2020-08-14 20:36:22.758 [DBG] SRVR: Waiting 1m0s before trying to locate bootstrap peers (attempt #8)

Expected behaviour

I expected the Initialization would work normally without any issues.

Actual behaviour

The first Initialization of the LN node didn't happen, stuck in the loop of trying to locate bootstrap peers

Roasbeef commented 4 years ago

If the connection is timing out, then something might be up with your local network. I'd also check if you're able to hit the DNS seeds manually as well.

scottcarter2020 commented 4 years ago

If the connection is timing out, then something might be up with your local network. I'd also check if you're able to hit the DNS seeds manually as well.

I was starting the Initialization by the following way

lnd --externalip=X.X.X.X

And I've my lnd configuration file with the following attributes

alias= debuglevel=debug bitcoin.active=1 bitcoin.mainnet=1 bitcoin.node=bitcoind

I created the file (before) I started the Initialization.

Could you tell me please how I check if I'm able to hit the DNS seeds manually, unix beginner here.

wpaulino commented 4 years ago

dig nodes.lightning.directory should return some IP addresses if you're able to reach it.

scottcarter2020 commented 4 years ago

dig nodes.lightning.directory should return some IP addresses if you're able to reach it.

So I open a new terminal and write (dig nodes.lightning.directory) ?

wpaulino commented 4 years ago

Yes, feel free to paste the output here.

scottcarter2020 commented 4 years ago

Yes, feel free to paste the output here.

; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> nodes.lightning.directory ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48349 ;; flags: qr rd ra; QUERY: 1, ANSWER: 25, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;nodes.lightning.directory. IN A

;; ANSWER SECTION:

;; Query time: 154 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) ;; WHEN: Fri Aug 14 23:13:30 EET 2020 ;; MSG SIZE rcvd: 454
Roasbeef commented 4 years ago

Clipped the response slightly, but that looks to be fine. It may be the SRV records instead that aren't getting through? In either case, if you can connect to even a single existing node, you'll be able to boostrap the channel graph.

Roasbeef commented 4 years ago

Closing as the DNS seed is working properly, so this indicates an issue w/ the user's local network set up.