{"record":{"id":"541f11fb98a807ad","repo":"GoogleContainerTools/skaffold","slug":"executing-minikube-command-w","errorCode":null,"errorMessage":"executing minikube command: %w","messagePattern":"executing minikube command: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/client.go","lineNumber":229,"sourceCode":"\n\treturn environment, api, err\n}\n\nfunc getUserAgentHeader() map[string]string {\n\tuserAgent := fmt.Sprintf(\"skaffold-%s\", version.Get().Version)\n\tlog.Entry(context.TODO()).Debugf(\"setting Docker user agent to %s\", userAgent)\n\treturn map[string]string{\n\t\t\"User-Agent\": userAgent,\n\t}\n}\n\nfunc getMinikubeDockerEnv(ctx context.Context, minikubeProfile string) (map[string]string, error) {\n\tif minikubeProfile == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty minikube profile\")\n\t}\n\tcmd, err := cluster.GetClient().MinikubeExec(ctx, \"docker-env\", \"--shell\", \"none\", \"-p\", minikubeProfile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"executing minikube command: %w\", err)\n\t}\n\tout, err := util.RunCmdOut(ctx, cmd)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting minikube env: %w\", err)\n\t}\n\n\tenv := map[string]string{}\n\tfor _, line := range strings.Split(string(out), \"\\n\") {\n\t\tif line == \"\" || strings.HasPrefix(line, \"#\") {\n\t\t\tcontinue\n\t\t}\n\t\tkv := strings.SplitN(line, \"=\", 2)\n\t\tif len(kv) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse minikube docker-env keyvalue: %s, line: %s, output: %s\", kv, line, string(out))\n\t\t}\n\t\tif kv[1] == \"\" {\n\t\t\tcontinue\n\t\t}","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/client.go#L211-L247","documentation":"This error wraps a failure from cluster.GetClient().MinikubeExec when Skaffold tries to build the 'minikube docker-env --shell none -p <profile>' command. It means the minikube binary could not be located or invoked, not that the command itself failed to run (that produces error 283). The underlying error is wrapped with %w for unwrapping.","triggerScenarios":"newMinikubeAPIClient -> getMinikubeDockerEnv where MinikubeExec fails because the minikube executable is not found on PATH or the cluster client cannot construct the exec command.","commonSituations":"minikube is not installed or not on PATH; running inside a container without minikube; a broken minikube installation; PATH differs in the CI environment vs local shell.","solutions":["Install minikube or add it to PATH: 'which minikube' should resolve; if not, install per minikube docs.","In CI/containers, ensure the minikube binary is present in the image and PATH includes its directory.","Verify with 'minikube version' that the binary executes correctly; reinstall if corrupted."],"exampleFix":"// before (CI dockerfile missing minikube)\nRUN skaffold run --minikube-profile minikube\n// after\nRUN curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \\\n    install minikube-linux-amd64 /usr/local/bin/minikube\nRUN skaffold run --minikube-profile minikube","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"minikube\"); err != nil {\n    return fmt.Errorf(\"minikube binary not found on PATH: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cli, err := newMinikubeAPIClient(ctx, profile)\nif err != nil {\n    if strings.Contains(err.Error(), \"executing minikube command\") {\n        return fmt.Errorf(\"cannot run minikube: is it installed and on PATH? (install: https://minikube.sigs.k8s.io/docs/start/)\")\n    }\n    return err\n}","preventionTips":["Install minikube in every environment (CI images, dev containers) where Skaffold runs with the minikube profile.","Run 'minikube version' as a preflight check in CI pipelines.","Pin the minikube version to avoid surprises from wrapper or PATH changes."],"tags":["minikube","cli","environment"],"backgroundTag":"command-not-found","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}