prysmaticlabs / prysm

Go implementation of Ethereum proof of stake
https://www.offchainlabs.com
GNU General Public License v3.0
3.47k stars 1k forks source link

My computer is not listening to the right ports #6256

Closed SomervilleM closed 4 years ago

SomervilleM commented 4 years ago

💎 Issue

Background

I ran the topaz testnet with no issue with onyx I can't get my beacon chain to connect with peers. I trouble shot on discord with a few people on discord for an hour or so but exhausted all of their ideas

need help getting my computer to listen to 13000 and 12000 ###
Phistr90 commented 4 years ago

I have the same problem with default ports.

SomervilleM commented 4 years ago

i should clarify I am on windows

prestonvanloon commented 4 years ago

Can you provide a bit more details?

What version of Prysm are you using? What error are you seeing? What flags are you using? Are you using docker or prysm.sh?

SomervilleM commented 4 years ago

Sure.

Latest Prysm version is v1.0.0-alpha.11.
Beacon chain is up to date.
Verifying binary integrity.
beacon-chain-v1.0.0-alpha.11-windows-amd64.exe: OK
gpg: Signature made Fri, Jun 12, 2020  3:44:16 PM EDT
gpg:                using RSA key 0AE0051D647BA3C1A917AF4072E33E4DF1A5036E
gpg: Good signature from "Preston Van Loon <preston@prysmaticlabs.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 0AE0 051D 647B A3C1 A917  AF40 72E3 3E4D F1A5 036E
Verified /d/prysm/dist/beacon-chain-v1.0.0-alpha.11-windows-amd64.exe has been signed by Prysmatic Labs.
Starting Prysm beacon-chain --p2p-host-ip=198.48.231.237
2020/06/14 16:38:14 maxprocs: Leaving GOMAXPROCS=12: CPU quota undefined
time="2020-06-14 16:38:14" level=info msg="Checking DB" database-path="C:\Users\Somer\AppData\Roaming\Eth2/beaconchaindata" prefix=node
time="2020-06-14 16:38:14" level=warning msg="Using default ETH1 connection provided by Prysmatic Labs. Please consider running your own ETH1 node for better uptime, security, and decentralization of ETH2. Visit https://docs.prylabs.network/docs/prysm-usage/setup-eth1 for more information." prefix=node
time="2020-06-14 16:38:14" level=info msg="Starting beacon node" prefix=node version="Prysm/Git commit: 1f20cbb3f0d28d8fea81dc6a968a08d151cb9ece. Built at: 2020-06-10 04:04:33+00:00"
time="2020-06-14 16:38:14" level=info msg="Starting JSON-HTTP API" address="127.0.0.1:3000" prefix=gateway
time="2020-06-14 16:38:14" level=info msg="RPC-API listening on port" address="127.0.0.1:4000" prefix=rpc
time="2020-06-14 16:38:14" level=warning msg="You are using an insecure gRPC connection! Provide a certificate and key to connect securely" prefix=rpc
time="2020-06-14 16:38:14" level=info msg="Blockchain data already exists in DB, initializing..." prefix=blockchain
time="2020-06-14 16:38:14" level=info msg="Starting initial chain sync..." prefix=initial-sync
time="2020-06-14 16:38:14" level=info msg="Waiting for enough suitable peers before syncing" prefix=initial-sync required=3 suitable=0
time="2020-06-14 16:38:14" level=info msg="Started discovery v5" ENR="enr:-LK4QF8k7ZDH8JzTTSxLuOAaJm1_mRMYK775bGmvP47bii5-cy3MtFStYqaCVbHlcvYrYZc2oEyUYQLh9uRKLZ4AGkIBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCmW0iXAAAAAP__________gmlkgnY0gmlwhMYw5-2Jc2VjcDI1NmsxoQPyJaQpxGmzLoZcFVrpsRCDJEYElAWg1tNJ0Y6jNUSAy4N0Y3CCMsiDdWRwgi7g" prefix=p2p
time="2020-06-14 16:38:14" level=info msg="Node started p2p server" multiAddr="/ip4/192.168.56.1/tcp/13000/p2p/16Uiu2HAmUxEJZbWawAzHWcLeQrG3bW7uviwzV7E2gBf4r9igS35c" prefix=p2p
time="2020-06-14 16:38:14" level=info msg="Node started external p2p server" multiAddr="/ip4/198.48.231.237/tcp/13000/p2p/16Uiu2HAmUxEJZbWawAzHWcLeQrG3bW7uviwzV7E2gBf4r9igS35c" prefix=p2p
time="2020-06-14 16:38:14" level=info msg="Connected to eth1 proof-of-work chain" endpoint="https://goerli.prylabs.net" prefix=powchain
time="2020-06-14 16:38:19" level=info msg="Waiting for enough suitable peers before syncing" prefix=initial-sync required=3 suitable=0

I have gone into my router and portforward the 13000 and 12000 i went into my firewall and allowed the beacon and validator clients people on discord had me see if my computer was listening to those ports and with netstat -a it doesnt show either of them i believe i have the most up to date version and prysm.sh not docker

prestonvanloon commented 4 years ago

Have you set up the correct port forwarding in your router?

https://docs.prylabs.network/docs/prysm-usage/p2p-host-ip/#port-forwarding

SomervilleM commented 4 years ago

To the best of my knowledge yes

prestonvanloon commented 4 years ago

I'm not able to reproduce this on linux. Prysm is binding the the ports 12000 and 13000. I tried to dial your node and could not reach it.

https://mxtoolbox.com/SuperTool.aspx?action=tcp%3a198.48.231.237%3a13000&run=toolpage

Looking into the code to see what has changed recently...

prestonvanloon commented 4 years ago

I don't see any changes around p2p address binding since before Topaz.

@Phistr90 do you have any additional information that might help us reproduce this issue?

SomervilleM commented 4 years ago

when in topaz I never had gone into the router and did the port forwarding nor did I use a flag with my ip when starting up the beacon chain I would simply bash prysm.sh beacon-chain and then in a few seconds I would find peers and sync.

Should I delete everything related and start from the beginning?

prestonvanloon commented 4 years ago

The key difference between Topaz and Onyx is that we are now only using discovery v5 protocol which communicates mostly over UDP.

If you are unable to find any peers, you might have UDP traffic blocked on your network or system. The original issue was that Prysm isn't binding to the ports 13000 or 12000. I should have been able to direct dial your node if the port forwarding was set up correctly. Additionally the MX toolbox report I linked earlier should have also indicated that 13000 was open for communication. You might have more than one issue. We haven't heard windows users report this issue (yet) so I am wondering if its system/setup related rather than a Prysm bug.

SomervilleM commented 4 years ago

I can almost guarantee the issue is on my end. I have been well under water navigating all eth related adventures. Certainly out of my element, my ignorance knows no bounds. I don't want to waste your time let me know if i should close this issue. I will continue to tinker and stumble and trouble shoot with the community maybe on discord.

prestonvanloon commented 4 years ago

@SomervilleM This is not a waste of time at all. Lets keep this issue open for now and when we learn what the root cause of the issue is then we can see how we could have improved our documentation or code to make the problem less likely to occur in the future. Feel free to ping me on discord @prestonvanloon if you need some help troubleshooting or have any questions I can help with while you work through the problem.

SomervilleM commented 4 years ago

Amazing thanks man, I really appreciate it and everything you and your team does to move towards eth 2.0 manifesting super cool.

just to point me in the right direction. forgive my naivety but high level my node can't speak to other nodes in the network because the path is closed. but could you clarify something regarding public and private ip. its like your computers identity right (does a computer have both a private and public one). on my router i opened those ports but when setting them up the only selection for internal server ip is my private ip address related to the computer im running the node on. but when I do myiplookup on google i get that public address. am I missing something do i have to open those ports on that public ip?

prestonvanloon commented 4 years ago

The private IP is the IP is directly assigned to your machine on your local network. The public IP is the IP which is provided to your modem by your ISP. The public IP is what other nodes can use to connect to your modem which your computer is connected. The reason we need port forwarding is that the router wouldn't know where to route the request, especially when you have multiple devices in the same network. Having port 13000 and 12000 open and forwarded to your machine makes it so that external peers can connect to you on those ports. You would see this in Prysm as an "inbound" connection.

Without opening those ports and routing them to your machine, you should still be able to make outbound dials to peers. You could try to add a specific peer like --peer=ip4/107.137.107.212/tcp/13000/p2p/16Uiu2HAmDBVBgnnUBDJUGmFTJodQj5bgwWySS2Loi6nhErF9ESmG. I have a feeling there is something to do with your firewall where you aren't able to make UDP connections which is what discovery v5 protocol uses to find peers.

Phistr90 commented 4 years ago

@prestonvanloon Not 100% it is the same issue as Somerville has but I am not making any peer connections. Inital sync is stuck at initial-sync: Waiting for enough suitable peers before syncing required=3 suitable=0 Nishant already tried to find the problem, even gave me another bootstrap node and I also configured the port forwaring on tcp 13000 and udp 12000 but it seems I am unable to discover other peers. logWithPortForward.txt

I am running on Ubuntu 18.04 built with bazel on a9070ad7252f2af12ab89cb99eac0c0a92f92f13

It worked before without any changes on my side. Worked on topaz and witti.

pappas999 commented 4 years ago

Hi guys, I am also having this issue in windows running the .BAT file. When onyx went live it was working fine as it was on topaz, but then approx 48 hours ago I ran out of disk space and had to stop/restart the chain and validator. When I did, it may have gotten a new version of the client, and then I started getting this issue.

I followed my router instructions and tried to open/forward the required incoming ports to my local IP, but didn't work. I also disabled windows firewall after doing this too and restarted but still can't connect to any peers.

I also used https://canyouseeme.org/ to try ping my 13000 TCP port on my public IP but it says it can't reach it. Does this mean port forwarding isn't setup then? I followed the router instructions, and restarted it

SomervilleM commented 4 years ago

Yea my problem persists even with the update however I think these are new when I (bash prysm.sh beacon-chain --p2p-host-ip='mypublicip')

time="2020-06-17 21:23:50" level=warning msg="IP address is not accessible" address="mypublicip:13000" error="dial tcp 'mypublicip':13000: i/o timeout" prefix=p2p protocol=tcp

pappas999 commented 4 years ago

hi guys, I tried my node this morning on a different network not at my house to see if it was my router, still having the same issue. Have also tried running with v10 as instructed and still have the same issue. Is there some command I can run that produces high level of logging that I can generate and then attach here? Or if someone wants to generate a custom version of the node for me that has extra debugging in I can run it and put results here

SomervilleM commented 4 years ago

I saw on discord someone fixed the issue using docker over prysm.bat. I however tried to set up docker but can't because of my version of windows. what would be different about the two that it would work one way and not the other?

chongheToday at 11:17 AM Previously I have problems connecting to peers where it shows suitable=0 even after long time. I saw some also have this issue. I solved it by using docker instead of prysm.bat. Hope this can help others

pappas999 commented 4 years ago

hi guys, just an update on this. With a different laptop i got a fresh prysm.bat and started a beacon-chain and it synced up ok and found peers ok, so wondering if it had something to do with my old laptop and setup and something to do with me disconnecting in between v10 and 11?

Anyway, I am now running my validator successfully on this new laptop after copying the keys. So same network, same .bat version etc. On my old laptop it still can't find peers, but on this new one it doesn't. Is there anything I can try on my old laptop to try get it working there again? ie can I delete everything (except validator keys), then try all fresh again?

Enigmatic331 commented 4 years ago

Out of curiosity - Does your old laptop have any virtual networks (e.g. VM) installed?

I had issues with connecting to peers as well, and after disabling my VM virtual network adapters it connects fine.

(just to add, adding peers manually will work for a while and eventually the peers will drop off too)

nisdas commented 4 years ago

hey guys @Phistr90 @pappas999 @SomervilleM ,

with alpha.13, is this still an issue ?

if it is do you guy mind giving me info on OS, Architecture and other pertinent hardware details on the machines you guys are running this on?

SomervilleM commented 4 years ago

Still can't connect to peers on my end

pappas999 commented 4 years ago

hi, yes it's still not working with alpha13. Take note I am able to get it working on another laptop I have on the same network, so I believe it's not my home network. I was able to transfer the validator keys, get the .bat file via curl, then startup the beacon chain and validator successfully.

Then I went back to my laptop that isn't working (on the same network). I tried deleting everything except the validator keys including the beaconchain data etc, then I got the .bat file again with curl then started the beacon chain, but once again it was giving the unable to connect to peers error. Here is my hardware/setup

-windows 10 pro -12GB RAM -64 bit architecture -machine, CPU etc is this one https://www.dell.com/lt/business/p/precision-m4800-workstation/pd

prestonvanloon commented 4 years ago

I have not been able to reproduce this on windows. You're machine shouldn't have to listen on any ports to make outbound dials to remote peers.

It seems like something is blocking this type of traffic. Perhaps a router based firewall? Although, @pappas999 reports that it works on another windows machine in the same network.

SomervilleM commented 4 years ago

I also shut off all firewalls on the computer and in the router and still couldn't connect to peers

nisdas commented 4 years ago

@SomervilleM @pappas999 @Phistr90 , this should be resolved in the next release of alpha.17. Or alternatively if you are running docker, you can try with latest