redspread / localkube

DEPRECRATED - See https://github.com/kubernetes/minikube
Apache License 2.0
184 stars 11 forks source link

panic: bind: cannot assign requested address #37

Open vsimon opened 8 years ago

vsimon commented 8 years ago

On OSX 10.11.3. Docker 1.10.3 using docker-toolbox. Localkube 0.0.3. Not working after trying spread cluster up.

$ docker logs localkube
Unable to find image 'weaveworks/weaveexec:1.4.5' locally
1.4.5: Pulling from weaveworks/weaveexec
ee54741ab35b: Already exists
c396d61c0a32: Already exists
6f699aeb212d: Already exists
499a537fb87d: Already exists
6235aa6b611c: Already exists
3fb3a546cc1a: Already exists
3e46f21eea5d: Already exists
9dd33e219371: Already exists
b8e5c537a426: Already exists
Digest: sha256:0e0ba3023da99dfd7d90528eab350f16325d22e065d45e5a68722060cd174d45
Status: Downloaded newer image for weaveworks/weaveexec:1.4.5
Unable to find image 'weaveworks/weave:1.4.5' locally
1.4.5: Pulling from weaveworks/weave
3ff04c8da461: Pulling fs layer
b6c842ef1801: Pulling fs layer
3ff04c8da461: Verifying Checksum
3ff04c8da461: Download complete
3ff04c8da461: Pull complete
3ff04c8da461: Pull complete
b6c842ef1801: Verifying Checksum
b6c842ef1801: Download complete
b6c842ef1801: Pull complete
b6c842ef1801: Pull complete
Digest: sha256:82e21f9b4a1ecbd873a921c8724db2f6b5f2fefedefc4c389b1e85f662a30a3b
Status: Downloaded newer image for weaveworks/weave:1.4.5
e3026996c6229e74def402c72f3dce6daa3b77b7f18cc27c5018bd3f865a2a03
62291320597fb741129c59db9a07be2f17b0579547da1a4e427ffa8a471df90b
10.32.0.1
Starting etcd...
Starting LocalKube...
2016-03-26 05:47:06.296220 I | etcdserver: name = kubeetcd
2016-03-26 05:47:06.296281 I | etcdserver: data dir = /var/localkube/data
2016-03-26 05:47:06.296299 I | etcdserver: member dir = /var/localkube/data/member
2016-03-26 05:47:06.296315 I | etcdserver: heartbeat = 100ms
2016-03-26 05:47:06.296332 I | etcdserver: election = 1000ms
2016-03-26 05:47:06.296347 I | etcdserver: snapshot count = 10000
2016-03-26 05:47:06.296371 I | etcdserver: advertise client URLs = http://localhost:2379
2016-03-26 05:47:06.341816 I | etcdserver: restarting member 37807cb0bf7500f6 in cluster 2c833ae9c7555b5e at commit index 0
2016-03-26 05:47:06.341916 I | raft: 37807cb0bf7500f6 became follower at term 0
2016-03-26 05:47:06.341945 I | raft: newRaft 37807cb0bf7500f6 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
panic: listen tcp 198.105.254.228:2379: bind: cannot assign requested address

goroutine 1 [running]:
panic(0x2809520, 0xc8204226e0)
    /usr/local/go/src/runtime/panic.go:464 +0x3e6
rsprd.com/localkube.createListenersOrPanic(0xc82047c580, 0x1, 0x1, 0x0, 0x0, 0x0)
    /home/dan/kube/src/rsprd.com/localkube/etcd.go:141 +0x165
rsprd.com/localkube.(*EtcdServer).Start(0xc8204ace70)
    /home/dan/kube/src/rsprd.com/localkube/etcd.go:93 +0x212
rsprd.com/localkube.Servers.StartAll(0xc82047c780, 0x7, 0x8)
    /home/dan/kube/src/rsprd.com/localkube/server.go:45 +0x1ac
rsprd.com/localkube.(*LocalKube).Run(0xc8204a49a0, 0xc82000a0e0, 0x2, 0x2, 0x7f997d4ff358, 0xc820020018, 0x0, 0x0)
    /home/dan/kube/src/rsprd.com/localkube/localkube.go:28 +0x772
main.main()
    /home/dan/kube/src/rsprd.com/localkube/cmd/localkube/main.go:71 +0x8d
ethernetdan commented 8 years ago

Are you running Etcd or something else on 2379 of the docker-machine host?

This should be changed to use a free port returned by the OS to prevent this kind of collision.

vsimon commented 8 years ago

No, I don't have etcd running on OSX, I did sudo lsof -i and sudo netstat -A to see if anything was listening on that port but saw nothing on 2379. I started Docker with the Docker Quickstart Terminal (https://docs.docker.com/mac/step_one/) then ran spread cluster up. After that I checked docker logs localkube to see the panic in the output.

ethernetdan commented 8 years ago

@vsimon: Are you checking ports on the host machine or within the VM running docker? If you are using OS X the ports would be opened on the VM.

If you are using docker-machine, SSH onto the machine using: docker-machine ssh <machine name> (you can get the machine name with docker-machine ls)

Once you are on the machine check which ports have listeners with: sudo netstat -tlp

Also are you running containers other than the ones that come with localkube?

vsimon commented 8 years ago

OSX. Started Docker via Docker Quickstart Terminal, got a Terminal. $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES No Containers Running. Logging onto the VM to see what ports open...

$ sudo netstat -tlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN      2381/sshd
tcp        0      0 :::2376                 :::*                    LISTEN      2698/docker
tcp        0      0 :::ssh                  :::*                    LISTEN      2381/sshd

No ports on 2379.. Exited the VM.

Going to start localkube

$ spread cluster start
Pulling localkube image...
Started localkube...
Setup and using kubectl `localkube` context.

Checking docker

$ docker ps
CONTAINER ID        IMAGE                            COMMAND             CREATED             STATUS                              PORTS               NAMES
2ee7d56c4dfc        redspreadapps/localkube:latest   "start.sh"          6 minutes ago       Restarting (0) About a minute ago                       localkube

Check docker logs

$ docker logs localkube
Unable to find image 'weaveworks/weaveexec:1.4.5' locally
1.4.5: Pulling from weaveworks/weaveexec
ee54741ab35b: Already exists
c396d61c0a32: Pulling fs layer
6f699aeb212d: Pulling fs layer
499a537fb87d: Pulling fs layer
6235aa6b611c: Pulling fs layer
3fb3a546cc1a: Pulling fs layer
3e46f21eea5d: Pulling fs layer
9dd33e219371: Pulling fs layer
b8e5c537a426: Pulling fs layer
6235aa6b611c: Waiting
3fb3a546cc1a: Waiting
3e46f21eea5d: Waiting
9dd33e219371: Waiting
b8e5c537a426: Waiting
c396d61c0a32: Verifying Checksum
c396d61c0a32: Download complete
c396d61c0a32: Pull complete
c396d61c0a32: Pull complete
499a537fb87d: Verifying Checksum
499a537fb87d: Download complete
6235aa6b611c: Verifying Checksum
6235aa6b611c: Download complete
6f699aeb212d: Verifying Checksum
6f699aeb212d: Download complete
3fb3a546cc1a: Verifying Checksum
3fb3a546cc1a: Download complete
6f699aeb212d: Pull complete
6f699aeb212d: Pull complete
499a537fb87d: Pull complete
499a537fb87d: Pull complete
6235aa6b611c: Pull complete
6235aa6b611c: Pull complete
3fb3a546cc1a: Pull complete
3fb3a546cc1a: Pull complete
3e46f21eea5d: Verifying Checksum
3e46f21eea5d: Download complete
3e46f21eea5d: Pull complete
3e46f21eea5d: Pull complete
9dd33e219371: Verifying Checksum
9dd33e219371: Download complete
9dd33e219371: Pull complete
9dd33e219371: Pull complete
b8e5c537a426: Verifying Checksum
b8e5c537a426: Download complete
b8e5c537a426: Pull complete
b8e5c537a426: Pull complete
Digest: sha256:0e0ba3023da99dfd7d90528eab350f16325d22e065d45e5a68722060cd174d45
Status: Downloaded newer image for weaveworks/weaveexec:1.4.5
Unable to find image 'weaveworks/weave:1.4.5' locally
1.4.5: Pulling from weaveworks/weave
3ff04c8da461: Pulling fs layer
b6c842ef1801: Pulling fs layer
3ff04c8da461: Verifying Checksum
3ff04c8da461: Download complete
3ff04c8da461: Pull complete
3ff04c8da461: Pull complete
b6c842ef1801: Verifying Checksum
b6c842ef1801: Download complete
b6c842ef1801: Pull complete
b6c842ef1801: Pull complete
Digest: sha256:82e21f9b4a1ecbd873a921c8724db2f6b5f2fefedefc4c389b1e85f662a30a3b
Status: Downloaded newer image for weaveworks/weave:1.4.5
4487e961dd8d195ff62c8a99e2bad1444b4263f7b9a0885b0013f7666f1e2604
8162c83b7e024a6544b072ce866cb7480b031c0231a28e14a65a5d8d8adeec72
10.32.0.1
Starting etcd...
Starting LocalKube...
2016-04-02 03:55:01.828764 I | etcdserver: name = kubeetcd
2016-04-02 03:55:01.828830 I | etcdserver: data dir = /var/localkube/data
2016-04-02 03:55:01.828852 I | etcdserver: member dir = /var/localkube/data/member
2016-04-02 03:55:01.828869 I | etcdserver: heartbeat = 100ms
2016-04-02 03:55:01.828952 I | etcdserver: election = 1000ms
2016-04-02 03:55:01.828967 I | etcdserver: snapshot count = 10000
2016-04-02 03:55:01.828992 I | etcdserver: advertise client URLs = http://localhost:2379
2016-04-02 03:55:01.845919 I | etcdserver: restarting member 37807cb0bf7500f6 in cluster 2c833ae9c7555b5e at commit index 0
2016-04-02 03:55:01.845996 I | raft: 37807cb0bf7500f6 became follower at term 0
2016-04-02 03:55:01.846021 I | raft: newRaft 37807cb0bf7500f6 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
panic: listen tcp 198.105.254.228:2379: bind: cannot assign requested address

goroutine 1 [running]:
panic(0x2818320, 0xc820422640)
    /home/travis/.gimme/versions/go1.6.linux.amd64/src/runtime/panic.go:464 +0x3e6
rsprd.com/localkube.createListenersOrPanic(0xc820480580, 0x1, 0x1, 0x0, 0x0, 0x0)
    /home/travis/gopath/src/rsprd.com/localkube/etcd.go:141 +0x165
rsprd.com/localkube.(*EtcdServer).Start(0xc8204b0e70)
    /home/travis/gopath/src/rsprd.com/localkube/etcd.go:93 +0x212
rsprd.com/localkube.Servers.StartAll(0xc820480780, 0x7, 0x8)
    /home/travis/gopath/src/rsprd.com/localkube/server.go:45 +0x1ac
rsprd.com/localkube.(*LocalKube).Run(0xc8204a8940, 0xc82000a0e0, 0x2, 0x2, 0x7f72536bc358, 0xc820020018, 0x0, 0x0)
    /home/travis/gopath/src/rsprd.com/localkube/localkube.go:28 +0x772
main.main()
    /home/travis/gopath/src/rsprd.com/localkube/cmd/localkube/main.go:71 +0x8d