# Ipfs-cluster: Error HTTP API when starting docker container

**URL:** <https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354>\
**Category:** Uncategorized\
**Tags:** ipfs-cluster\
**Created:** [October 31, 2017, 1:24pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354 "2017-10-31T13:24:26Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 1:24pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/1 "2017-10-31T13:24:26Z")

</div>

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

```auto
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

```

> [@Ipfs-cluster: Unable to start a docker container](https://discuss.ipfs.tech/t/ipfs-cluster-unable-to-start-a-docker-container/1352/1):
>
> When i’m trying to run a docker container something goes wrong but I am not able to understand what it is.
> 
> Run the container :  
> `docker run ipfs/ipfs-cluster`
> 
> Logs :
> 
> ```
> Changing user to ipfs
> ipfs version 0.4.11
> initializing IPFS node at /data/ipfs
> generating 2048-bit RSA keypair...done
> peer identity: QmQsTifxncDb4jtKzcHA8JNo7gWzyhRQDgENLK5Nxsvno9
> to get started, enter:
> 2017-10-31T10:01:17.122611563Z 
> ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
> 2017-10-31T10:01:17.122620702Z 
> Initializing daemon...
> ipfs-cluster-service version 0.2.1
> 10:01:22.139 INFO config: Saving configuration config.go:289
> ipfs-cluster-service configuration written to /data/ipfs-cluster/service.json
> Unknown subcommand. Run "ipfs-cluster-service help" for more info
> 
> ```
> 
> The container cannot start.

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 1:25pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/2 "2017-10-31T13:25:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 1:33pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/3 "2017-10-31T13:33:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [October 31, 2017, 1:55pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/4 "2017-10-31T13:55:47Z")

</div>

hello,

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

regards

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 1:58pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/5 "2017-10-31T13:58:01Z")

</div>

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

I still have the same issue.

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [October 31, 2017, 2:14pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/6 "2017-10-31T14:14:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 2:17pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/7 "2017-10-31T14:17:23Z")

</div>

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/](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.

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [October 31, 2017, 2:18pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/8 "2017-10-31T14:18:37Z")

</div>

i agree with you on this point yeah.

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 2:19pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/9 "2017-10-31T14:19:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 2:20pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/10 "2017-10-31T14:20:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [October 31, 2017, 2:24pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/11 "2017-10-31T14:24:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 2:33pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/12 "2017-10-31T14:33:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![raucoule1u](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/raucoule1u/32/425_2.png) [@raucoule1u](https://discuss.ipfs.tech/u/raucoule1u)\
**Post date:** [October 31, 2017, 2:33pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/13 "2017-10-31T14:33:53Z")

</div>

> [@raucoule1u](#):
>
> 192.168.99.100

is the docker-machine IP

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [October 31, 2017, 6:14pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/14 "2017-10-31T18:14:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [November 1, 2017, 9:56am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/15 "2017-11-01T09:56:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [November 1, 2017, 10:34am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/16 "2017-11-01T10:34:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [November 1, 2017, 10:34am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-error-http-api-when-starting-docker-container/1354/17 "2017-11-01T10:34:16Z")

</div>

Closed on November 1, 2017, 10:34am UTC


