{"record":{"id":"76f9025cc561cdfa","repo":"GoogleContainerTools/skaffold","slug":"unable-to-parse-minikube-docker-env-keyvalue-s","errorCode":null,"errorMessage":"unable to parse minikube docker-env keyvalue: %s, line: %s, output: %s","messagePattern":"unable to parse minikube docker-env keyvalue: (.+?), line: (.+?), output: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/client.go","lineNumber":243,"sourceCode":"\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}\n\t\tenv[kv[0]] = kv[1]\n\t}\n\n\treturn env, nil\n}\n\n// This was copied from api/server/router/image/image_routes.go, since it's not\n// exported. The ImageInspect API now returns a dockerspec.DockerOCIImageConfig,\n// whereas before it used to return a container.Config, so we need to convert it\n// before using it to call ContainerCreate.\nfunc OCIImageConfigToContainerConfig(img string, cfg *dockerspec.DockerOCIImageConfig) *container.Config {\n\texposedPorts := make(network.PortSet, len(cfg.ExposedPorts))\n\tfor k, v := range cfg.ExposedPorts {\n\t\tp, err := network.ParsePort(k)","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/client.go#L225-L261","documentation":"getMinikubeDockerEnv parses minikube's docker-env output line-by-line as KEY=VALUE pairs; this error is returned when a non-empty, non-comment line contains no '=' separator. It indicates minikube produced unexpected output — often a warning, deprecation notice, or error banner printed alongside the env exports.","triggerScenarios":"newMinikubeAPIClient -> getMinikubeDockerEnv where minikube's stdout includes a line without '=' (e.g. kubectlNotFound warnings, driver warnings, or shell-mangled output) that fails strings.SplitN(line, \"=\", 2) yielding len != 2.","commonSituations":"Outdated minikube version emitting extra banner text; minikube emitting warnings to stdout instead of stderr; locale/encoding issues corrupting output; a wrapper script around minikube that prints extra text.","solutions":["Update minikube to the latest version so docker-env emits clean KEY=VALUE output.","Run 'minikube -p <profile> docker-env --shell none' manually and inspect any stray lines/warnings; resolve what prints them.","Check for shell wrappers, aliases, or profile scripts that inject output into the minikube invocation.","Verify the profile is healthy ('minikube -p <profile> status'); warnings about stopped/unhealthy clusters often add extra output."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"out, err := exec.Command(\"minikube\", \"-p\", profile, \"docker-env\", \"--shell\", \"none\").Output()\nif err == nil {\n    for _, line := range strings.Split(string(out), \"\\n\") {\n        if line == \"\" || strings.HasPrefix(line, \"#\") {\n            continue\n        }\n        if !strings.Contains(line, \"=\") {\n            return fmt.Errorf(\"unexpected minikube docker-env output line %q; update minikube\", line)\n        }\n    }\n}","typeGuard":"func isParseableEnvOutput(out []byte) bool {\n    for _, line := range strings.Split(string(out), \"\\n\") {\n        if line == \"\" || strings.HasPrefix(line, \"#\") {\n            continue\n        }\n        if len(strings.SplitN(line, \"=\", 2)) != 2 {\n            return false\n        }\n    }\n    return true\n}","tryCatchPattern":"cli, err := newMinikubeAPIClient(ctx, profile)\nif err != nil {\n    if strings.Contains(err.Error(), \"unable to parse minikube docker-env keyvalue\") {\n        return fmt.Errorf(\"minikube docker-env output not parseable — update minikube and check for warnings polluting stdout: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep minikube up to date; older versions emit extra output.","Run 'minikube -p <profile> docker-env --shell none' manually to inspect raw output.","Remove wrappers/aliases around minikube that print extra text.","Keep the profile healthy (minikube status) so warning banners don't appear."],"tags":["minikube","parsing","output"],"backgroundTag":"unexpected-command-output","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"}