{"record":{"id":"d3b1df42687811fd","repo":"GoogleContainerTools/skaffold","slug":"getting-minikube-profiles-w","errorCode":null,"errorMessage":"getting minikube profiles: %w","messagePattern":"getting minikube profiles: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/cluster/minikube.go","lineNumber":177,"sourceCode":"type versionErr struct {\n\terr error\n}\n\nfunc (v versionErr) Error() string {\n\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}","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/cluster/minikube.go#L159-L195","documentation":"matchServerURL runs `minikube profile list -o json` to compare cluster server URLs against minikube node IPs. If running that command fails (non-zero exit, no output), the underlying error is wrapped as 'getting minikube profiles'. Called by IsMinikube when determining whether a cluster is a minikube cluster.","triggerScenarios":"minikubeExec returns a command whose execution fails: minikube binary unusable, minikube version too old to support `profile list -o json`, kubectl context env problems, or the command exits non-zero due to minikube's own errors.","commonSituations":"Very old minikube without `profile list`; minikube needing KVM/virtualization drivers that fail at startup; corrupt minikube config file (~/.minikube) making profile list crash; running as a different user with a --user flag mismatch.","solutions":["Run `minikube profile list -o json` manually to see the underlying error","Upgrade minikube to a recent version that supports profile list -o json","Fix/repair the minikube installation (minikube delete + recreate) if its config is corrupt"],"exampleFix":"// before\n$ minikube profile list -o json\nF0915 ... profile list: decoding profile config: ...\n// after\nminikube delete\nminikube start","handlingStrategy":"retry","validationCode":"// preflight\nminikube profile list -o json >/dev/null 2>&1 || { echo 'minikube profile list failing'; minikube version; exit 1; }","typeGuard":null,"tryCatchPattern":"ok, err := cluster.IsMinikube(ctx, api, serverURL)\nif err != nil && strings.Contains(err.Error(), \"getting minikube profiles\") {\n\t// transient minikube failure: retry once after short delay\n\ttime.Sleep(2 * time.Second)\n\tok, err = cluster.IsMinikube(ctx, api, serverURL)\n}","preventionTips":["Keep minikube up to date (profile list -o json support)","Run `minikube profile list` manually after minikube upgrades","Repair corrupt ~/.minikube config with minikube delete"],"tags":["minikube","profiles","subprocess"],"backgroundTag":"minikube-profile-list-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"}