Algorand node started but unable to respond to RPC Error: Recv failure: Connection reset by peer

I have started Algorand node using dockerfile and compose file. I am first creating an image of the latest 2.1.4 version and creating the containers using this image.

My node is getting up but when i am trying to get the status using below CURL , i am getting Recv failure: Connection reset by peer. Anyone can help:

Request:
sudo curl -v http://127.0.0.1:/v1/status -H “X-Algo-API-Token:<token fetched from var/lib/algorand/algo.token>”

Response:

  • Trying 127.0.0.1…
  • TCP_NODELAY set
  • Connected to 127.0.0.1 (127.0.0.1) port (#0)

GET /v1/status HTTP/1.1
Host: 127.0.0.1:
User-Agent: curl/7.58.0
Accept: /
X-Algo-API-Token:

  • Recv failure: Connection reset by peer
  • stopped the pause stream!
  • Closing connection 0
    curl: (56) Recv failure: Connection reset by peer
  1. What port are you using?
  2. Can you provide the docker-compose file you used? Have you opened the port correctly in the docker-compose file?
  3. Have you changed the EndpointAddress in config.json to allow connections to come from 0.0.0.0 instead of just localhost? See https://developer.algorand.org/docs/reference/node/config/
  4. Which OS are you using?

Notes:

  1. The latest version of the Algorand software is 2.1.5.
  2. You should not need to run curl with sudo. curl is not a privileged command.

Thanks for replying.

Ans1: I am using 8887 port.
Ans2: Below is the docker file and compose file i am using:

dockerfile:

FROM debian:stable-slim

RUN apt-get update
RUN apt-get install -y gnupg2 curl software-properties-common
RUN curl -O https://releases.algorand.com/key.pub
RUN apt-key add key.pub
RUN add-apt-repository "deb https://releases.algorand.com/deb/ stable main"
RUN apt-get update
RUN apt-get install -y algorand

VOLUME ["/var/lib/algorand"]
EXPOSE 8887 8886 4160
ENTRYPOINT ["algod"]

docker-compose:

version: '2'
services:
    node-algo:
        image: algo:2.1.4
        container_name: algonode8887
        restart: always
        ports:
            - "8887:8887"
            - "8886:8886"
            - "4160:4160"
        command: ["-d=/var/lib/algorand/data"]
        volumes:
            - /disklocation/node-algorand:/var/lib/algorand
        mem_limit: 3g

Ans3: Yes i have 0.0.0.0:8887 as endpoint address in config.json
Ans4: Ubuntu 18.04

I think there may be the following issues:

Note: If you want to include code, it is best to include them between triple backquotes ``` I’ve edited the post for you.

Hello,

I had the same issue before.

Read the following stack-overflow question:

Basically,
I have updated the “EndpointAddress” in config.json file as follows:
“EndpointAddress”: “0.0.0.0:8080”

(Before it was “EndpointAddress”: “127.0.0.1:0”)

In data folder, the is config.json.example you can rename it as config.json and update the related field.