kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.52k stars 4.89k forks source link

StartHost failed : container addresses should have 2 values, got 3 values #10079

Open ggjulio opened 3 years ago

ggjulio commented 3 years ago

I use a second network to give a range of ips to Metallb. Everyting work fine except at restart. Minikube complain about having two networks. I have to disconnect the second network before each restart. And then reconnect.

I find nothing helpful in the doc / github Issues.

Steps to reproduce the issue:

  1. minukube start --vm-driver=docker
  2. docker network create my-net
  3. docker network connect my-net minikube
  4. minikube stop
  5. minikube start

Full output of failed command:

๐Ÿƒ  Updating the running docker "minikube" container ...
I0101 20:57:39.509944 3016595 machine.go:88] provisioning docker machine ...
I0101 20:57:39.509978 3016595 ubuntu.go:169] provisioning hostname "minikube"
I0101 20:57:39.510046 3016595 cli_runner.go:111] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube
I0101 20:57:39.550282 3016595 main.go:119] libmachine: Using SSH client type: native
I0101 20:57:39.550473 3016595 main.go:119] libmachine: &{{{<nil> 0 [] [] []} docker [0x80b6c0] 0x80b680 <nil>  [] 0s} 127.0.0.1 49332 <nil> <nil>}
I0101 20:57:39.550495 3016595 main.go:119] libmachine: About to run SSH command:
sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
I0101 20:57:39.694466 3016595 main.go:119] libmachine: SSH cmd err, output: <nil>: minikube

I0101 20:57:39.694552 3016595 cli_runner.go:111] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube
I0101 20:57:39.733676 3016595 main.go:119] libmachine: Using SSH client type: native
I0101 20:57:39.733849 3016595 main.go:119] libmachine: &{{{<nil> 0 [] [] []} docker [0x80b6c0] 0x80b680 <nil>  [] 0s} 127.0.0.1 49332 <nil> <nil>}
I0101 20:57:39.733873 3016595 main.go:119] libmachine: About to run SSH command:

        if ! grep -xq '.*\sminikube' /etc/hosts; then
            if grep -xq '127.0.1.1\s.*' /etc/hosts; then
                sudo sed -i 's/^127.0.1.1\s.*/127.0.1.1 minikube/g' /etc/hosts;
            else 
                echo '127.0.1.1 minikube' | sudo tee -a /etc/hosts; 
            fi
        fi
I0101 20:57:39.862874 3016595 main.go:119] libmachine: SSH cmd err, output: <nil>: 
I0101 20:57:39.862918 3016595 ubuntu.go:175] set auth options {CertDir:/home/ggjulio/.minikube CaCertPath:/home/ggjulio/.minikube/certs/ca.pem CaPrivateKeyPath:/home/ggjulio/.minikube/certs/ca-key.pem CaCertRemotePath:/etc/docker/ca.pem ServerCertPath:/home/ggjulio/.minikube/machines/server.pem ServerKeyPath:/home/ggjulio/.minikube/machines/server-key.pem ClientKeyPath:/home/ggjulio/.minikube/certs/key.pem ServerCertRemotePath:/etc/docker/server.pem ServerKeyRemotePath:/etc/docker/server-key.pem ClientCertPath:/home/ggjulio/.minikube/certs/cert.pem ServerCertSANs:[] StorePath:/home/ggjulio/.minikube}
I0101 20:57:39.863002 3016595 ubuntu.go:177] setting up certificates
I0101 20:57:39.863023 3016595 provision.go:83] configureAuth start
I0101 20:57:39.863092 3016595 cli_runner.go:111] Run: docker container inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}},{{.GlobalIPv6Address}}{{end}}" minikube
I0101 20:57:39.904544 3016595 provision.go:86] duration metric: configureAuth took 41.505805ms
W0101 20:57:39.904583 3016595 ubuntu.go:180] configureAuth failed: error getting ip during provisioning: container addresses should have 2 values, got 3 values: [192.168.49.2 172.20.0.2 ]
I0101 20:57:39.904600 3016595 retry.go:31] will retry after 110.466ยตs: Temporary Error: error getting ip during provisioning: container addresses should have 2 values, got 3 values: [192.168.49.2 172.20.0.2 ]
I0101 20:57:39.904801 3016595 provision.go:83] configureAuth start
โžœ  ~ docker container inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}},{{.GlobalIPv6Address}}{{end}}" minikube
192.168.49.2,172.20.0.2,

Full output of minikube start command used, if not already included:

โžœ  ~ minikube start
๐Ÿ˜„  minikube v1.16.0 on Ubuntu 20.04
โœจ  Using the docker driver based on existing profile
๐Ÿ‘  Starting control plane node minikube in cluster minikube
๐Ÿ”„  Restarting existing docker container for "minikube" ...
๐Ÿคฆ  StartHost failed, but will try again: container addresses should have 2 values, got 3 values: [192.168.49.2 172.20.0.2 ]
๐Ÿƒ  Updating the running docker "minikube" container ...
afbjorklund commented 3 years ago

Minikube needs to handle multiple networks, and filter out the created network only.

It actually got 4 values, but output format fails to add a delimiter between networks..

fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten

sharifelgamal commented 3 years ago

It would seem that we don't support multiple networks in our docker driver. We would some help getting this fixed! I'd be happy to review any PR.

sharifelgamal commented 3 years ago

This is the function we would need to fix: https://github.com/kubernetes/minikube/blob/master/pkg/drivers/kic/oci/network_create.go#L181

vishjain commented 3 years ago

/assign

k8s-triage-robot commented 3 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 3 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

medyagh commented 3 years ago

I havent seen this error in long time, did we fix it ?

@vishjain are you still working on this ?

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

klaases commented 2 years ago

Hi @ggjulio โ€“ is this issue still occurring? If so, please feel free to re-open the issue by commenting with /reopen. This issue will be closed as additional information was unavailable and some time has passed.

Additional information that may be helpful:

Thank you for sharing your experience!

ololobus commented 2 years ago

I can confirm that on the latest:

minikube version: v1.25.2
commit: 362d5fdc0a3dbee389b3d3f1034e8023e72bd3a7

the problem is still there. I have a minikube k8s cluster with additional docker-compose network attached to the minikube container and get the same error:

minikube start
๐Ÿ˜„  minikube v1.25.2 on Debian 11.0
โœจ  Using the docker driver based on existing profile
๐Ÿ‘  Starting control plane node minikube in cluster minikube
๐Ÿšœ  Pulling base image ...
๐Ÿ”„  Restarting existing docker container for "minikube" ...
๐Ÿคฆ  StartHost failed, but will try again: container addresses should have 2 values, got 3 values: [192.168.49.2 172.54.32.2 ]
๐Ÿƒ  Updating the running docker "minikube" container ...
๐Ÿ˜ฟ  Failed to start docker container. Running "minikube delete" may fix it: provision: Temporary Error: error getting ip during provisioning: container addresses should have 2 values, got 3 values: [192.168.49.2 172.54.32.2 ]

โŒ  Exiting due to GUEST_PROVISION: Failed to start host: provision: Temporary Error: error getting ip during provisioning: container addresses should have 2 values, got 3 values: [192.168.49.2 172.54.32.2 ]

Disconnecting the additional network before start (and connecting it back again after start) helps as a workaround, though.

/reopen

k8s-ci-robot commented 2 years ago

@ololobus: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/kubernetes/minikube/issues/10079#issuecomment-1068978284): >I can confirm that on the latest: >``` >minikube version: v1.25.2 >commit: 362d5fdc0a3dbee389b3d3f1034e8023e72bd3a7 >``` >the problem is still there. I have a `minikube` k8s cluster with additional `docker-compose` network attached to the `minikube` container and get the same error: >``` >minikube start >๐Ÿ˜„ minikube v1.25.2 on Debian 11.0 >โœจ Using the docker driver based on existing profile >๐Ÿ‘ Starting control plane node minikube in cluster minikube >๐Ÿšœ Pulling base image ... >๐Ÿ”„ Restarting existing docker container for "minikube" ... >๐Ÿคฆ StartHost failed, but will try again: container addresses should have 2 values, got 3 values: [192.168.49.2 172.54.32.2 ] >๐Ÿƒ Updating the running docker "minikube" container ... >๐Ÿ˜ฟ Failed to start docker container. Running "minikube delete" may fix it: provision: Temporary Error: error getting ip during provisioning: container addresses should have 2 values, got 3 values: [192.168.49.2 172.54.32.2 ] > >โŒ Exiting due to GUEST_PROVISION: Failed to start host: provision: Temporary Error: error getting ip during provisioning: container addresses should have 2 values, got 3 values: [192.168.49.2 172.54.32.2 ] >``` > >Disconnecting the additional network before start (and connecting it back again after start) helps as a workaround, though. > >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
ololobus commented 2 years ago

@klaases or @ggjulio, please, reopen once you have time.

ggjulio commented 2 years ago

/reopen

k8s-ci-robot commented 2 years ago

@ggjulio: Reopened this issue.

In response to [this](https://github.com/kubernetes/minikube/issues/10079#issuecomment-1070963191): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
klaases commented 2 years ago

As @sharifelgamal mentioned, we would appreciate any PR that goes towards resolving this issue.

sharifelgamal commented 2 years ago

I'm freezing this issue as it is a genuine minikube bug. Help wanted!

sandeep-ongit commented 1 day ago

+1 this issue still persists