{"record":{"id":"63e5c1b0d407128f","repo":"GoogleContainerTools/skaffold","slug":"empty-minikube-profile","errorCode":null,"errorMessage":"empty minikube profile","messagePattern":"empty minikube profile","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/client.go","lineNumber":225,"sourceCode":"\tfor k, v := range env {\n\t\tenvironment = append(environment, fmt.Sprintf(\"%s=%s\", k, v))\n\t}\n\tsort.Strings(environment)\n\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))","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/client.go#L207-L243","documentation":"getMinikubeDockerEnv returns this when the minikubeProfile argument is an empty string. Skaffold needs a profile name to run 'minikube docker-env -p <profile>'; without one it cannot determine which minikube cluster's Docker daemon to connect to. It is a fast-fail input validation guard before shelling out to minikube.","triggerScenarios":"Calling newMinikubeAPIClient (directly or via newAPIClient) with an empty minikube profile — e.g. the --minikube-profile flag / MINIKUBE_PROFILE config value is unset or empty string.","commonSituations":"User forgot to pass --profile or left the minikubeProfile field empty in config; a script passes an unset shell variable as the profile; config file has 'minikubeProfile: \"\"'.","solutions":["Pass a valid minikube profile name, e.g. 'skaffold --profile minikube --minikube-profile myprofile' or set the profile field in your config.","Verify the profile exists with 'minikube profile list' and use one of the listed names (default is 'minikube').","If running from a script, ensure the variable holding the profile name is set: 'PROFILE=${PROFILE:-minikube}'."],"exampleFix":"// before\ncmd := exec.Command(\"skaffold\", \"run\", \"--minikube-profile\", profile)\n// after\nif profile == \"\" {\n    profile = \"minikube\"\n}\ncmd := exec.Command(\"skaffold\", \"run\", \"--minikube-profile\", profile)","handlingStrategy":"validation","validationCode":"if minikubeProfile == \"\" {\n    return fmt.Errorf(\"minikube profile must be non-empty; pass --minikube-profile or set it in config\")\n}","typeGuard":"func hasMinikubeProfile(cfg *Config) bool {\n    return cfg != nil && strings.TrimSpace(cfg.MinikubeProfile) != \"\"\n}","tryCatchPattern":"cli, err := newMinikubeAPIClient(ctx, profile)\nif err != nil {\n    if strings.Contains(err.Error(), \"empty minikube profile\") {\n        return fmt.Errorf(\"no minikube profile given: set --minikube-profile (e.g. 'minikube')\")\n    }\n    return err\n}","preventionTips":["Default the profile to 'minikube' in scripts when unset.","Validate non-empty profile values before invoking Skaffold.","Keep the profile name consistent between skaffold.yaml, scripts, and 'minikube profile list'."],"tags":["minikube","configuration","validation"],"backgroundTag":"missing-required-argument","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"}