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

Peer count stays 0 #20274

Closed
AntoineXBTO opened this issue Nov 12, 2019 · 11 comments
Closed

Peer count stays 0 #20274

AntoineXBTO opened this issue Nov 12, 2019 · 11 comments
Assignees

Comments

@AntoineXBTO
Copy link

AntoineXBTO commented Nov 12, 2019

System information

Geth version: 1.9.7-stable
OS & Version: Linux

  • Issue similar to No IP address in enode addresses #2765
  • I can't use UPnP so I need to add the external ip manually via --nat=extip:MYIP
  • admin.nodeInfo gives me an enode that looks correct
  • netstat shows geth listening on 30303 for ipv6 but not ipv4
  • I cannot make any connection, inbound or outbound from that node, it has been running for hours without catching any peers
@AntoineXBTO AntoineXBTO changed the title enode ip is localhost Peer count stays 0 Nov 12, 2019
@AntoineXBTO
Copy link
Author

AntoineXBTO commented Nov 13, 2019

I would like to add that admin.addPeer("...") to a valid node accessible on inbound doesn't log anything on either side.

@holiman
Copy link
Contributor

holiman commented Nov 13, 2019 via email

@AntoineXBTO
Copy link
Author

I could finally connect to a second node. Yes loglevel to 5 could help me see the log.
The node doesn't seem to try to connect to any other peer though and only relies on that manually entered one.

@holiman
Copy link
Contributor

holiman commented Nov 14, 2019

Could you elaborate on your network setup? Also, does your netstat look like this:

tcp6       0      0 :::30303                :::*                    LISTEN      4595/build/bin/geth 
udp6       0      0 :::30303                :::*                                4595/build/bin/geth 

If so, it means both ipv4 and ipv6.
Is your external IP ipv4?

@fjl
Copy link
Contributor

fjl commented Nov 14, 2019

Please run geth with --vmodule "p2p/*=5" and post some logs here or in a gist. Thank you.

@AntoineXBTO
Copy link
Author

AntoineXBTO commented Nov 14, 2019

@holiman it does look like this (notice the brackets)
tcp6 0 0 [::]:30303 [::]:* LISTEN

For security reasons I won't be able to describe the network setup too extensively but:

  • there is not public ip on that server
  • we're using a NAT with a public IP and I'm using that ip as parameter for geth --nat=extip:IP, yes it's ipv4
  • firewall is heavily restricted, ports 30303 on TCP and UDP are open though, for outgoing connections

@fjl same here, I won't be able to export my logs but:

  • it starts by successfully finding nodes in database
  • starts p2p networking
  • ping/v4 on those nodes, err=nil
  • findnode/v4, err=nil
  • findnode failed "RPC timeout" with failcount > 325

These nodes might be too old but what I want to understand is why it doesn't try to find new ones once connected to the node I manually connect to?
The connection to the manually entered node is "staticdial"

@fjl
Copy link
Contributor

fjl commented Dec 11, 2019

Connected peers do not influence peer discovery. How many other nodes does your node ping? Just one, or many?

@fjl fjl self-assigned this Dec 11, 2019
@AFDudley
Copy link

I am having this same issue. using netstat -ntlp4 does not return 30303.

Running lsof | grep LISTEN returns something like:

sshd       5084          root    3u     IPv4              54687        0t0        TCP *:ssh (LISTEN)
sshd       5084          root    4u     IPv6              54689        0t0        TCP *:ssh (LISTEN)
geth      26619 38003    geth  165u     IPv6         2655098132        0t0        TCP *:30303 (LISTEN)
geth      26619 38003    geth  174u     IPv4         2656677356        0t0        TCP 127.0.0.1:8546 (LISTEN)
geth      26619 38003    geth  179u     IPv4         2656677355        0t0        TCP 127.0.0.1:8545 (LISTEN)

Note that it states when explicitly binding to both addresses.

@holiman
Copy link
Contributor

holiman commented Aug 17, 2020

cc @fjl ^

@fjl
Copy link
Contributor

fjl commented Aug 17, 2020

Geth binds to 'any address', which covers both IPv4 and IPv6. Command line tools usually show that as IPv6 because it's a single listener. Your sshd example looks different because it uses two separate listeners for IPv4 and IPv6.

@dastageer-eth
Copy link

HI, @fjl i'm trying to run a execution client using geth, but it cannot find peers to start block download and initiate sync, what can I do?
I'm from India, if it has any relevance in finding peers
execution-sync-error

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

7 participants