prysmaticlabs / prysm

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

"beacon node misconfiguration" error on /eth/v1/events #14607

Open a26nine opened 2 weeks ago

a26nine commented 2 weeks ago

Describe the bug

When trying to subscribe to events with Prysm v5.1.2, the node throws misconfiguration error.

Flags

prysm \
    --accept-terms-of-use \
    --datadir=/data/prysm \
    --chain-config-file=/data/prysm/config.yml \
    --genesis-state=/data/prysm/genesis.ssz \
    --chain-id=xxx \
    --network-id=xxx \
    --execution-endpoint=http://127.0.0.1:8551 \
    --jwt-secret=/data/jwtsecret \
    --http-host=0.0.0.0 \
    --http-port=3500 \
    --rpc-host=0.0.0.0 \
    --rpc-port=4000 \
    --http-cors-domain="*" \
    --http-modules=eth,prysm \
    --bootstrap-node=xxx \
    --peer=xxx \
    --min-sync-peers=1 \
    --p2p-tcp-port=13000 \
    --p2p-udp-port=12000 \
    --p2p-max-peers=50 \
    --p2p-static-id \
    --slots-per-archive-point=32 \
    --blob-retention-epochs=1000000 \
    --api-timeout=30s \
    --monitoring-host=127.0.0.1 \
    --monitoring-port=8080

Execution Client: Geth v1.14.11

The node is syncing fine and responds to other methods without any issues.

Has this worked before in a previous version?

No response

🔬 Minimal Reproduction

  1. Run Prysm v5.1.2 (with the above flags).
  2. Call curl "http://localhost:3500/eth/v1/events?topics=head" -H "Accept: text/event-stream"

Error

{"message":"beacon node misconfiguration: http stack may not support required response handling features, like flushing","code":500}

Platform(s)

Linux (x86)

What version of Prysm are you running? (Which release)

v5.1.2

Anything else relevant (validator index / public key)?

No response

james-prysm commented 2 weeks ago

Is there possibly something else with your setup that may be different? cURL should be supported here

a26nine commented 2 weeks ago

Is there possibly something else with your setup that may be different? cURL should be supported here

I don't think or am aware of anything else that would be different here. You can see the node config in the OP. Plus, other Beacon API methods seem to work without any issues.

james-prysm commented 2 weeks ago

Could you try using any other tool outside of curl to see if you're able to query, the flush is required for event stream endpoints

a26nine commented 2 weeks ago

Could you try using any other tool outside of curl to see if you're able to query, the flush is required for event stream endpoints

websocat ws://localhost:3500/eth/v1/events?topics=head

---

websocat: WebSocketError: WebSocketError: Received unexpected status code (500 Internal Server Error)
websocat: error running
#!/usr/bin/python3
import requests
import sys

try:
    response = requests.get(
        'http://localhost:3500/eth/v1/events?topics=head',
        headers={
            'Accept': 'text/event-stream',
            'Cache-Control': 'no-cache'
        },
        stream=True,
        timeout=30
    )

    print(f"Status: {response.status_code}")
    print(f"Headers: {dict(response.headers)}")

    for line in response.iter_lines():
        if line:
            print(line.decode('utf-8'))
            sys.stdout.flush()

except Exception as e:
    print(f"Error: {e}")

---

Status: 500
Headers: {'Content-Length': '132', 'Content-Type': 'application/json', 'Vary': 'Origin', 'Date': 'Tue, 05 Nov 2024 17:54:16 GMT'}
{"message":"beacon node misconfiguration: http stack may not support required response handling features, like flushing","code":500}
root@vana-mainnet-archive-ora-iad-a00:~# 
a26nine commented 2 weeks ago

Is there any configuration flag that may be causing or can help with this issue?

prestonvanloon commented 2 weeks ago

Where does this error come from? "beacon node misconfiguration" is not a string found in our repo.

james-prysm commented 2 weeks ago

@prestonvanloon This error was in v5.1.2, but due to recent changes from kasey it shouldn't be there anymore https://github.com/prysmaticlabs/prysm/blob/944f94a9bf6cbd19699b319917499fd7262e2f73/beacon-chain/rpc/eth/events/events.go#L164

still... both of us were testing with curl and haven't run into the above error, which should be that the client is unable to call the flush function on the writer.