Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solution message for unsupported legacy docker versions #10282

Closed
ilya-zuyev opened this issue Jan 27, 2021 · 6 comments · Fixed by #10301
Closed

Add solution message for unsupported legacy docker versions #10282

ilya-zuyev opened this issue Jan 27, 2021 · 6 comments · Fixed by #10301
Labels
co/docker-driver Issues related to kubernetes in container good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. needs-solution-message Issues where where offering a solution for an error would be helpful
Milestone

Comments

@ilya-zuyev
Copy link
Contributor

ilya-zuyev commented Jan 27, 2021

We do not support old docker daemon versions in docker driver because of docker network inspect minikube output format. But the error message is very confusing (see below). We need to check docker version on start and if it's too old (>18.06.3 should be fine, but need to verify) we should report an error and exit

ilyaz@debian:~$ minikube start 
* minikube v1.17.0 on Debian 8.11
* Using the docker driver based on existing profile
! For improved Docker performance, enable the overlay Linux kernel module using 'modprobe overlay'
! docker is currently using the aufs storage driver, consider switching to overlay2 for better performance
* Starting control plane node minikube in cluster minikube
* Updating the running docker "minikube" container ...
* Preparing Kubernetes v1.20.2 on Docker 20.10.2 ...| E0127 11:53:35.789213    2598 start.go:99] Unable to get host IP: network inspect: docker network inspect minikube --format "{"Name": "{{.Name}}","Driver": "{{.Driver}}","Subnet": "{{range .IPAM.Config}}{{.Subnet}}{{end}}","Gateway": "{{range .IPAM.Config}}{{.Gateway}}{{end}}","MTU": {{if (index .Options "com.docker.network.driver.mtu")}}{{(index .Options "com.docker.network.driver.mtu")}}{{else}}0{{end}},{{$first := true}} "ContainerIPs": [{{range $k,$v := .Containers }}{{if $first}}{{$first = false}}{{else}}, {{end}}"{{$v.IPv4Address}}"{{end}}]}": exit status 64
stdout:

stderr:
Template parsing error: template: :1: unexpected "=" in operand
E0127 11:53:35.789800    2598 out.go:330] unable to execute Failed to setup kubeconfig: network inspect: docker network inspect minikube --format "{"Name": "{{.Name}}","Driver": "{{.Driver}}","Subnet": "{{range .IPAM.Config}}{{.Subnet}}{{end}}","Gateway": "{{range .IPAM.Config}}{{.Gateway}}{{end}}","MTU": {{if (index .Options "com.docker.network.driver.mtu")}}{{(index .Options "com.docker.network.driver.mtu")}}{{else}}0{{end}},{{$first := true}} "ContainerIPs": [{{range $k,$v := .Containers }}{{if $first}}{{$first = false}}{{else}}, {{end}}"{{$v.IPv4Address}}"{{end}}]}": exit status 64
stdout:

stderr:
Template parsing error: template: :1: unexpected "=" in operand
: template: Failed to setup kubeconfig: network inspect: docker network inspect minikube --format "{"Name": "{{.Name}}","Driver": "{{.Driver}}","Subnet": "{{range .IPAM.Config}}{{.Subnet}}{{end}}","Gateway": "{{range .IPAM.Config}}{{.Gateway}}{{end}}","MTU": {{if (index .Options "com.docker.network.driver.mtu")}}{{(index .Options "com.docker.network.driver.mtu")}}{{else}}0{{end}},{{$first := true}} "ContainerIPs": [{{range $k,$v := .Containers }}{{if $first}}{{$first = false}}{{else}}, {{end}}"{{$v.IPv4Address}}"{{end}}]}": exit status 64
stdout:

stderr:
Template parsing error: template: :1: unexpected "=" in operand
:1:253: executing "Failed to setup kubeconfig: network inspect: docker network inspect minikube --format \"{\"Name\": \"{{.Name}}\",\"Driver\": \"{{.Driver}}\",\"Subnet\": \"{{range .IPAM.Config}}{{.Subnet}}{{end}}\",\"Gateway\": \"{{range .IPAM.Config}}{{.Gateway}}{{end}}\",\"MTU\": {{if (index .Options \"com.docker.network.driver.mtu\")}}{{(index .Options \"com.docker.network.driver.mtu\")}}{{else}}0{{end}},{{$first := true}} \"ContainerIPs\": [{{range $k,$v := .Containers }}{{if $first}}{{$first = false}}{{else}}, {{end}}\"{{$v.IPv4Address}}\"{{end}}]}\": exit status 64\nstdout:\n\nstderr:\nTemplate parsing error: template: :1: unexpected \"=\" in operand\n" at <index .Options "com.docker.network.driver.mtu">: error calling index: index of untyped nil - returning raw string.


X Exiting due to GUEST_START: Failed to setup kubeconfig: network inspect: docker network inspect minikube --format "{"Name": "{{.Name}}","Driver": "{{.Driver}}","Subnet": "{{range .IPAM.Config}}{{.Subnet}}{{end}}","Gateway": "{{range .IPAM.Config}}{{.Gateway}}{{end}}","MTU": {{if (index .Options "com.docker.network.driver.mtu")}}{{(index .Options "com.docker.network.driver.mtu")}}{{else}}0{{end}},{{$first := true}} "ContainerIPs": [{{range $k,$v := .Containers }}{{if $first}}{{$first = false}}{{else}}, {{end}}"{{$v.IPv4Address}}"{{end}}]}": exit status 64
stdout:

stderr:
Template parsing error: template: :1: unexpected "=" in operand

* 
* If the above advice does not help, please let us know: 
  - https://github.com/kubernetes/minikube/issues/new/choose
ilyaz@debian:~$ uname -a
Linux debian 3.16.0-6-amd64 #1 SMP Debian 3.16.56-1+deb8u1 (2018-05-08) x86_64 GNU/Linux
ilyaz@debian:~$ docker version
Client:
 Version:           18.06.3-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        d7080c1
 Built:             Wed Feb 20 02:28:55 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.3-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       d7080c1
  Built:            Wed Feb 20 02:27:21 2019
  OS/Arch:          linux/amd64
  Experimental:     false
ilyaz@debian:~$ minikube version
minikube version: v1.17.0
commit: 691a62dc8fffc4ce30befa53980d7b680b23a31f
ilyaz@debian:~$ cat /etc/issue
Debian GNU/Linux 8 \n \l
@ilya-zuyev ilya-zuyev added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Jan 27, 2021
@medyagh
Copy link
Member

medyagh commented Jan 27, 2021

here in the code we check for docker verison
we could return unhealthy if the version is less than 18.07

https://github.com/medyagh/minikube/blob/72443005764661ff12dafedee6c0afed4829b379/pkg/minikube/registry/drvs/docker/docker.go#L95

and also another place to check is

https://github.com/medyagh/minikube/blob/72443005764661ff12dafedee6c0afed4829b379/pkg/drivers/kic/oci/network_create.go#L175

if the output of that command is err and error contains "template: :1: unexpected "=" in operan"
we should return a different ErrorType of type FailFast

https://github.com/medyagh/minikube/blob/72443005764661ff12dafedee6c0afed4829b379/pkg/drivers/kic/oci/errors.go#L32

@medyagh medyagh added the needs-solution-message Issues where where offering a solution for an error would be helpful label Jan 27, 2021
@afbjorklund
Copy link
Collaborator

Similar to #9077

@afbjorklund afbjorklund added the co/docker-driver Issues related to kubernetes in container label Jan 28, 2021
@Patil2099
Copy link
Contributor

@ilya-zuyev I am new to this repo. Can you guide me in closing this issue? I would love to help in solving this

@daehyeok
Copy link
Contributor

daehyeok commented Jan 28, 2021

and also another place to check is

https://github.com/medyagh/minikube/blob/72443005764661ff12dafedee6c0afed4829b379/pkg/drivers/kic/oci/network_create.go#L175

docker network inspect command not include version info. Do you want to run another command(similary way with docker.go) to check version?

❯ docker network inspect multinode-20210127144027-24120 -v
[
    {
        "Name": "multinode-20210127144027-24120",
        "Id": "32fef472bdd241739730ef91063aa64dee59b0a0edac52b8948541642e6759b5",
        "Created": "2021-01-27T22:41:41.5335495Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.49.0/24",
                    "Gateway": "192.168.49.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
            "--icc": "",
            "--ip-masq": "",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {
            "created_by.minikube.sigs.k8s.io": "true"
        }
    }
]

@afbjorklund
Copy link
Collaborator

afbjorklund commented Feb 1, 2021

we could return unhealthy if the version is less than 18.07

I think you mean 18.09 ? i.e. we don't want to support 18.06

https://docs.docker.com/engine/release-notes/#version-2010

https://docs.docker.com/engine/release-notes/19.03/

https://docs.docker.com/engine/release-notes/18.09/

https://docs.docker.com/engine/release-notes/18.06/

Actually I think we should require 19.03, at least for vendor.

That is, drop minikube support also for Docker version 18.09

EDIT: Don't need to drop 18.09 for this particular issue.
Makes sense to allow the version that is in all the releases.

Maybe if we want to support system, for older distributions ?

https://packages.ubuntu.com/search?keywords=docker.io

See #10089

@medyagh medyagh added this to the v1.18.0-candidate milestone Feb 1, 2021
@medyagh medyagh changed the title Bad error message on start when running with legacy docker versions Add solution message for unsupported legacy docker versions Feb 1, 2021
@afbjorklund
Copy link
Collaborator

afbjorklund commented Feb 2, 2021

@medyagh : as per previous notes, this now excludes RHEL 7
(system version is too old or non-existing, no vendor version)

It has Docker 1.13.1 (from 2017) and Podman 1.6. But also KVM.
I think things are slightly better in RHEL 8 (from 2018, not 2014)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. needs-solution-message Issues where where offering a solution for an error would be helpful
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants