juno: Closing websocket connection due to internal error.

I deployed the juno node v0.7.1 and v0.7.2 in the docker container. I saw errors in the log after enabling the web socket.

19:50:54.481 31/10/2023 +03:00  INFO    sync/sync.go:201        Stored Block    {"number": 366168, "hash": "0x49d7...85d7", "root": "0x27ad...51e4"}
19:51:09.883 31/10/2023 +03:00  WARN    jsonrpc/websocket.go:81 Closing websocket connection due to internal error      {"err": "failed to get reader: failed to read frame header: EOF"}
19:51:09.883 31/10/2023 +03:00  ERROR   jsonrpc/websocket.go:91 Failed to close websocket connection    {"err": "failed to close WebSocket: failed to write control frame opClose: WebSocket closed: failed to read frame header: EOF"}
github.com/NethermindEth/juno/jsonrpc.(*Websocket).ServeHTTP
        /app/jsonrpc/websocket.go:91
github.com/NethermindEth/juno/node.makeRPCOverWebsocket.exactPathServer.func1
        /app/node/http.go:71
net/http.HandlerFunc.ServeHTTP
        /usr/lib/go-1.21/src/net/http/server.go:2136
net/http.(*ServeMux).ServeHTTP
        /usr/lib/go-1.21/src/net/http/server.go:2514
github.com/NethermindEth/juno/node.makeRPCOverWebsocket.(*Cors).Handler.func3
        /root/go/pkg/mod/github.com/rs/cors@v1.10.1/cors.go:281
net/http.HandlerFunc.ServeHTTP
        /usr/lib/go-1.21/src/net/http/server.go:2136
net/http.serverHandler.ServeHTTP
        /usr/lib/go-1.21/src/net/http/server.go:2938
net/http.(*conn).serve
        /usr/lib/go-1.21/src/net/http/server.go:2009

My docker-compose.yaml

---
version: '3.9'
services:
  juno:
    image: nethermind/juno:v0.7.2
    command:
      - '--http'
      - '--http-host=0.0.0.0'
      - '--http-port=6060'
      - '--db-path=/var/lib/juno'
      - '--eth-node=ws://eth-node-ip:8548'
      - '--metrics'
      - '--metrics-host=0.0.0.0'
      - '--metrics-port=9090'
      - '--ws'
      - '--ws-host=0.0.0.0'
      - '--ws-port=6061'
    ports:
      - '6060:6060'
      - '9090:9090'
      - '6061:6061'
    volumes:
      - ./data:/var/lib/juno
    restart: unless-stopped

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Reactions: 1
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@joshklop, thanks a lot. I like your product. I will continue to look forward to the development of the product in the future.

Thanks for the information. I’m not very familiar with Lava, but based on the docs it seems Lava proxies user requests to my local Juno node. Is that correct?” YES

image

Try my docker-compose.yaml

version: '3.9'
services:
  provider:
    image: svetekllc/lava:v0.26.1-provider
    environment:
      - CHAIN_ID=lava-testnet-2
      - CONFIG_PATH=/root/.lava
      - GEOLOCATION=2
      - KEY=juno
      - KEYRING=test
      - KEYALGO=eth_secp256k1
      - RPC=https://public-rpc-testnet2.lavanet.xyz:443/rpc/
      - LOGLEVEL=info
      - MONIKER=Juno
      - REWARDS_STORAGE_DIR="rewards-storage"
      - PROMETHEUS_PORT=23002
      - TOTAL_CONNECTIONS=50
    ports:
      - '23002:23002'
    volumes:
      - ./lava:/root/.lava
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "1"
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: '4gb'
    networks:
      - starknet
    restart: unless-stopped

  juno:
    image: nethermind/juno:v0.7.2
    command:
      - '--http'
      - '--http-host=0.0.0.0'
      - '--http-port=6060'
      - '--db-path=/var/lib/juno'
      - '--eth-node=ws://x.x.x.x:yyyy'
      - '--metrics'
      - '--metrics-host=0.0.0.0'
      - '--metrics-port=9090'
      - '--ws'
      - '--ws-host=0.0.0.0'
      - '--ws-port=6061'
    ports:
      - '9090:9090'
    volumes:
      - ./juno:/var/lib/juno
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "1"
    networks:
      - starknet
    restart: unless-stopped

networks:
  starknet:
    name: starknet

In ./lava/config you need to add:

  #### Starknet mainnet (STRK) ####
  - api-interface: jsonrpc
    chain-id: STRK
    network-address:
      address: 0.0.0.0:22002
      disable-tls: true
    node-urls:
      - url: http://juno:6061

@MichaelLLC If you don’t mind sharing the websocket client you used, that could be really helpful.

I haven’t been able to reproduce the problem with wscat.

I deployed the lava rpc provider (https://www.lavanet.xyz/) and enabled websocket parameter. I also observed the problem with disconnecting the connection with http. image image