{"record":{"id":"6c308f6b4513037e","repo":"GoogleContainerTools/skaffold","slug":"failed-to-unmarshal-minikube-profile-list-w","errorCode":null,"errorMessage":"failed to unmarshal minikube profile list: %w","messagePattern":"failed to unmarshal minikube profile list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/cluster/minikube.go","lineNumber":182,"sourceCode":"\treturn v.err.Error()\n}\n\n// matchClusterCertPath checks if the cluster certificate for this context is from inside the minikube directory\nfunc matchClusterCertPath(certPath string) bool {\n\treturn certPath != \"\" && util.IsSubPath(minikubePath(), certPath)\n}\n\n// matchServerURL checks if the k8s server url is same as any of the minikube nodes IPs\nfunc matchServerURL(ctx context.Context, server string) (bool, error) {\n\tcmd, _ := minikubeExec(ctx, \"profile\", \"list\", \"-o\", \"json\")\n\tout, err := util.RunCmdOut(ctx, cmd)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"getting minikube profiles: %w\", err)\n\t}\n\n\tvar data profileList\n\tif err = json.Unmarshal(out, &data); err != nil {\n\t\treturn false, fmt.Errorf(\"failed to unmarshal minikube profile list: %w\", err)\n\t}\n\n\tserverURL, err := url.Parse(server)\n\tif err != nil {\n\t\tlog.Entry(context.TODO()).Tracef(\"invalid server url: %v\", err)\n\t}\n\n\tfor _, v := range data.Valid {\n\t\tfor _, n := range v.Config.Nodes {\n\t\t\tif err == nil && serverURL.Host == fmt.Sprintf(\"%s:%d\", n.IP, n.Port) {\n\t\t\t\t// TODO: Revisit once https://github.com/kubernetes/minikube/issues/6642 is fixed\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn false, nil\n}\n","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/cluster/minikube.go#L164-L200","documentation":"After successfully running `minikube profile list -o json`, matchServerURL unmarshals the output into the profileList struct. If the JSON doesn't match the expected schema, the error is wrapped as 'failed to unmarshal minikube profile list'. This typically means minikube's output format differs from what this Skaffold version expects.","triggerScenarios":"json.Unmarshal(out, &data) fails because minikube emits a different profile-list JSON schema than profileList expects — different minikube version, warnings mixed into output, or empty/garbage output.","commonSituations":"Skaffold built against newer/older minikube JSON schema (field renames like machineName/nodeName); minikube printing deprecation warnings before the JSON; empty output from a failing-but-zero-exit run.","solutions":["Run `minikube profile list -o json` and compare the schema to the version your skaffold expects","Upgrade or downgrade skaffold to match the installed minikube version","Upgrade minikube to the latest version to get the canonical JSON format","Inspect ~/.minikube config for anomalies causing unusual profile list output"],"exampleFix":"// before (minikube v0.30 with old output)\nskaffold (old) <-> minikube profile list\n// after\nbrew upgrade minikube  # or update skaffold to latest","handlingStrategy":"validation","validationCode":"const out = require('child_process').execSync('minikube profile list -o json').toString();\ntry { const j = JSON.parse(out); if (!Array.isArray(j.invalid) && !j.profiles) throw 0; } catch { console.error('minikube JSON schema mismatch — upgrade minikube or skaffold'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep skaffold and minikube versions mutually current","Spot-check `minikube profile list -o json` output after upgrades","Suppress/ignore minikube warnings that can pollute stdout (use -o json)"],"tags":["minikube","json","unmarshal","version-compat"],"backgroundTag":"json-unmarshal-failed","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"}