minikube: minikube start: kubectl info: exec: exit status 2

Steps to reproduce the issue:

  1. minikube start --vm=true --kubernetes-version='v1.20.0'

Full output of failed command:

$ minikube start --vm=true --kubernetes-version='v1.20.0'
😄  minikube v1.15.1 on Darwin 11.1
✨  Automatically selected the hyperkit driver. Other choices: vmware, vmwarefusion
👍  Starting control plane node minikube in cluster minikube
🔥  Creating hyperkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.20.0 on Docker 19.03.13 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
E1216 11:24:31.467901   25710 start.go:266] kubectl info: exec: exit status 2
$

--alsologtostderr didn’t help clarify this error. Last few lines of run with --alsologtostderr:

I1216 11:28:23.304254   25968 start.go:203] waiting for startup goroutines ...
I1216 11:28:23.408164   25968 out.go:110] 🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
E1216 11:28:23.408190   25968 start.go:266] kubectl info: exec: exit status 2
$

If neccessary I can attach the full log with --alsologtostderr.

Optional: Full output of minikube logs command: logs.zip

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (3 by maintainers)

Most upvoted comments

No, I don’t mind at all. Thank you for your help @prezha! ❤️

It’s a little odd that it started with k8s v1.20, but…🤷

thanks for confirming, that’s great, and also for referencing where the linking part comes from 😃

there, if you don’t have (or don’t want to download) kubectl, alias kubectl="minikube kubectl --" would work just fine, but tbh, i’m not sure what was the idea in the handbook with linking it

@bl-ue thank you for your reply

i’m still a bit confused why are you linking kubectl to minikube - the error seems to root to then when, at the end (as shown in your logs), calling effectively minikube with version --client --output=json params, which are for kubectl and would not work for minikube:

https://github.com/kubernetes/minikube/blob/18e215fed113d3ad1bc1797860e303cae0772373/cmd/minikube/cmd/start.go#L269-L271

->

https://github.com/kubernetes/minikube/blob/18e215fed113d3ad1bc1797860e303cae0772373/cmd/minikube/cmd/start.go#L448-L451

->

https://github.com/kubernetes/minikube/blob/18e215fed113d3ad1bc1797860e303cae0772373/cmd/minikube/cmd/start.go#L520-L526

why do you link them?

can you please try w/o linking and see if you still have the issue

It is supposed to be possible to run “minikube kubectl” using a symlink like that.

Looks like something went wrong, when calling the actual kubectl binary ?

Try something like:

minikube --alsologtostderr kubectl version

It should have more info.

Like using and Running

The log line is: https://github.com/kubernetes/minikube/blob/fdab252f4f1d3aaeea028f90a2153cb1da8e54cb/cmd/minikube/cmd/start.go#L271

minikube is trying to exec /usr/local/bin/kubectl version --client --output=json, but getting error 2 aka “No such file or directory”.

kubectl is linked to minikube i.e.

lrwxr-xr-x 1 me admin 23 Dec 13 09:10 /usr/local/bin/kubectl -> /usr/local/bin/minikube*