Ipfs-cluster: Error HTTP API when starting docker container

It works now but there is still an issue with the IPFS HTTP API on port 5001 :

12:43:24.044  INFO    cluster: IPFS Cluster is ready cluster.go:379
12:43:24.048 ERROR   ipfshttp: error getting:Post http://127.0.0.1:5001/api/v0/r
epo/stat: dial tcp 127.0.0.1:5001: getsockopt: connection refused ipfshttp.go:68
9
12:43:24.048 ERROR   ipfshttp: Post http://127.0.0.1:5001/api/v0/repo/stat: dial
 tcp 127.0.0.1:5001: getsockopt: connection refused ipfshttp.go:806
12:43:24.048 ERROR  p2p-gorpc: Post http://127.0.0.1:5001/api/v0/repo/stat: dial
 tcp 127.0.0.1:5001: getsockopt: connection refused client.go:125
12:43:24.048 ERROR   diskinfo: Post http://127.0.0.1:5001/api/v0/repo/stat: dial
 tcp 127.0.0.1:5001: getsockopt: connection refused disk.go:87

It is good to know that I can use the HTTP API despite those errors.

@hector maybe you know what is happening ? Thanks in advance.

hello,

i think your conainer not expose ports : https://docs.docker.com/engine/reference/run/#expose-incoming-ports

regards

$ docker run --name ipfs-cluster-node -p 5001:5001 --expose 5001 ipfs/ipfs-cluster:latest

I still have the same issue.

It’s weird i can’t see 5001 port expose on : https://github.com/ipfs/ipfs-cluster/blob/master/Dockerfile maybe maintainer forget that

The ipfs/ipfs-cluster docker image is based on the ipfs/go-ipfs docker image. The parent image ipfs/go-ipfs exposes the port 5001 (see: https://hub.docker.com/r/ipfs/go-ipfs/~/dockerfile/) so I don’t think it is necessary that the image ipfs/ipfs-cluster expose the ports.

i agree with you on this point yeah.

Maybe the issue comes from the IP which is 127.0.0.1. But as ipfs-cluster is running in the same container as ipfs it should not be the issue but it is possible that we are missing something over there.

In my case i’m using docker-machine so the IP of the machine running the container is not 127.0.0.1

me i have the same issue with latest docker version on centos 7

When I try this : http://192.168.99.100:5001/api/v0/repo/stat
I got the response without problems.

is the docker-machine IP

Are you running the ipfs daemon on the same machine as the docker image? the docker image runs ipfs too, so if you are running it on the side, the docker-ipfs will not be able to start and not be available at localhost:5001.

in my side no just run your docker image ‘ipfs/ipfs-cluster’

Let’s move this conversation to https://github.com/ipfs/ipfs-cluster/issues/216, as it is happening in two places at the same time.