Having Trouble Connecting Port 8551

It seems I'm having troubles getting either getting my execution client to open an http connection on port 8551, or my concensus client (nimbus) to connect to the connection on port 8551.

No errors from besu, but nimus keeps throwing a warning in the log:

"WRN 2022-08-27 04:50:51.599+00:00 Eth1 chain monitoring failure, restarting topics="eth1" err="Failed to setup web3 connection: WebSocket connection error: 403 Forbidden"

Is there a good place to start making the sure the connection is open or accessible? Have exactly same setup as recent Somer guides.

[EDIT] I don't know what finally made it work but ended up having to enable authentication in Besu, (--rpc-http-enabled --rpc-ws-wnabled), specify the ports, then use websocket connection via Nimbus config file, rather than http. Hope this doesn't leave any security holes but at least it's linking up now, can see that Nimbus reads the block headers from besu on my machine.

besu.service

ExecStart=/usr/local/bin/besu/bin/besu \

--network=mainnet \

--sync-mode=X_SNAP \

--data-path=/var/lib/besu \

--data-storage-format=BONSAI \

--rpc-http-enabled \

--rpc-http-port 8545 \

--engine-rpc-port 8551 \

--rpc-ws-enabled \

--engine-jwt-secret=/var/lib/jwtsecret/jwt.hex

nimbus.service

ExecStart=/usr/local/bin/nimbus_beacon_node \

--network=mainnet \

--data-dir=/var/lib/nimbus \

--web3-url=ws://127.0.0.1:8546 \

--jwt-secret=/var/lib/jwtsecret/jwt.hex \

--suggested-fee-recipient=MYADDRESS \

--graffiti="grafitti" \

--enr-auto-update=true

Just seemed like for me each client needed extra manual flags and port designations that weren't outlined in the Somer guides. Took brand new ETH1 sync, and lot of config variations to find one that worked. Hopefully this helps someone else if they get stuck. Thank you to everyone that helped and responded.

Posted Aug 27, 2022, 4:52 AM UTC · edited

517
LuisNaldo7•

Seems like you are missing a JWT. The beacon client has to use it to authenticate against the execution endpoint. The token should be somewhere in the execution client’s data directory (at least this is how geth works). You can also create a JWT and pass it to both clients manually.

3
stablecoinOP•

thank you. JWT was generated using Somer guides:

openssl rand -hex 32 | sudo tee /var/lib/jwtsecret/jwt.hex > /dev/null

and starting Nimbus using flags in /etc/systemd/system/nimbus.service is:

ExecStart=/usr/local/bin/nimbus_beacon_node --network=mainnet --data-dir=/var/lib/nimbus --web3-url=http://127.0.0.1:8551 --web3-url=ws://127.0.0.1:8551 --jwt-secret=/var/lib/jwtsecret/jwt.hex --suggested-fee-recipient=myaddress --graffiti="<grafitti here>"

I put both http and ws links pulling my hair out, Nimbus docs said you can do both. Do you think it's a permissions or firewall issue?

2
SpacesiderTrusted Contributor•

It wont be a firewall issue if you are running both the execution and consensus nodes on the same machine.

It could definitely be a permissions issue though. In your services file, (For both Nimbus and Besu) which user as you executing the service as?

What happens when you type in

ls -lah /var/lib/jwtsecret

It will tell you which user owns the file, and what kind of permissions they (and everyone else) has.

2
stablecoinOP•

Not sure if this formatting works but:

user@ethvalidator:~$ ls -lah /var/lib/jwtsecret

total 12K

drwxr-xr-x 2 root root 4.0K Aug 27 00:10 .

drwxr-xr-x 48 root root 4.0K Aug 27 03:55 ..

-rw-r--r-- 1 root root 65 Aug 27 03:43 jwt.hex

It's all root owned but most should be able to read it. I can access for reading with my normal login account. Someone else mentioned copying the JWT to the data directory of besu, but not sure that would help if permissions are working.

1
busa1•

Is Besu running on the same machine as nimbus?

Did you pass the same jtw to Besu as nimbus?

Firewall only plays a role if the two services are on different machines.

What’s your Besu and what’s your nimbus config looks like?

3
stablecoinOP•

Besu is on the same machine.

Pass the JWT to Besu in the following systemd config:

ExecStart=/usr/local/bin/besu/bin/besu \

--network=mainnet \

--sync-mode=X_SNAP \

--data-path=/var/lib/besu \

--data-storage-format=BONSAI \

--engine-jwt-secret=/var/lib/jwtsecret/jwt.hex

Which config files are you referring to? Only one's I've ever set up were the systemd service files, for auto starting. Following the Somer guides.

/etc/systemd/system/besu.service & /etc/systemd/system/nimbus.service.

1
busa1•

On Besu’s side you should set these flags.

Setting http to 8551 won’t authenticate.

—rpc-http-port 8545 —engine-rpc-port 8551

2
[deleted]•

[deleted]

1
[deleted]•

[deleted]

1
stablecoinOP•

Read main edit, thank you for your help I seem to have got it to link by some combination of enabling authentcation and specific port flags.

1
busa1•

Nimbus should use 8551 port not 8546 for sure.

2
AutoModeratorMOD•

r/ethstaker strives for high quality interactions, our motto is "welcoming first, knowledgeable second", so please endeavor to welcome every question and comment in this spirit. Participants who openly disregard this ethos will find their comments removed. This is a safe space for ALL Ethereum stakers, regardless of how they stake. We strive to continually decentralize the Ethereum network in every conceivable way and with that in mind we promote long term healthy choices over short term gains.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1
[deleted]•

[deleted]

1
chonghe•

What is your ExecStart command? Do you have this flag?

--web3-url=http://127.0.0.1:8551

1
stablecoinOP•

thank you. JWT was generated using Somer guides:

openssl rand -hex 32 | sudo tee /var/lib/jwtsecret/jwt.hex > /dev/null

and starting Nimbus using flags in /etc/systemd/system/nimbus.service is:

ExecStart=/usr/local/bin/nimbus_beacon_node --network=mainnet --data-dir=/var/lib/nimbus --web3-url=http://127.0.0.1:8551 --web3-url=ws://127.0.0.1:8551 --jwt-secret=/var/lib/jwtsecret/jwt.hex --suggested-fee-recipient=myaddress --graffiti="<grafitti here>"

I put both http and ws links pulling my hair out, Nimbus docs said you can do both. Do you think it's a permissions or firewall issue?

1
chonghe•

Have you tried with only 1 web3-url flag? I use ws before and I had the same error with you. Using only http works for me

1
stablecoinOP•

Yes I will revert back, but started with only the "http" flag. Adding in the "ws" was my stab in the dark, saw in the Nimbus docs you could run multiple.

1
[deleted]•

[removed]

1
[deleted]•

[removed]

1