GoogleContainerTools/skaffold · error

executing minikube command: %w

Error message

executing minikube command: %w

What it means

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.

Source

Thrown at pkg/skaffold/docker/client.go:229

	return environment, api, err
}

func getUserAgentHeader() map[string]string {
	userAgent := fmt.Sprintf("skaffold-%s", version.Get().Version)
	log.Entry(context.TODO()).Debugf("setting Docker user agent to %s", userAgent)
	return map[string]string{
		"User-Agent": userAgent,
	}
}

func getMinikubeDockerEnv(ctx context.Context, minikubeProfile string) (map[string]string, error) {
	if minikubeProfile == "" {
		return nil, fmt.Errorf("empty minikube profile")
	}
	cmd, err := cluster.GetClient().MinikubeExec(ctx, "docker-env", "--shell", "none", "-p", minikubeProfile)
	if err != nil {
		return nil, fmt.Errorf("executing minikube command: %w", err)
	}
	out, err := util.RunCmdOut(ctx, cmd)
	if err != nil {
		return nil, fmt.Errorf("getting minikube env: %w", err)
	}

	env := map[string]string{}
	for _, line := range strings.Split(string(out), "\n") {
		if line == "" || strings.HasPrefix(line, "#") {
			continue
		}
		kv := strings.SplitN(line, "=", 2)
		if len(kv) != 2 {
			return nil, fmt.Errorf("unable to parse minikube docker-env keyvalue: %s, line: %s, output: %s", kv, line, string(out))
		}
		if kv[1] == "" {
			continue
		}

View on GitHub (pinned to a1189de023)

Solutions

  1. Install minikube or add it to PATH: 'which minikube' should resolve; if not, install per minikube docs.
  2. In CI/containers, ensure the minikube binary is present in the image and PATH includes its directory.
  3. Verify with 'minikube version' that the binary executes correctly; reinstall if corrupted.

Example fix

// before (CI dockerfile missing minikube)
RUN skaffold run --minikube-profile minikube
// after
RUN curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \
    install minikube-linux-amd64 /usr/local/bin/minikube
RUN skaffold run --minikube-profile minikube
Defensive patterns

Strategy: validation

Validate before calling

if _, err := exec.LookPath("minikube"); err != nil {
    return fmt.Errorf("minikube binary not found on PATH: %w", err)
}

Try / catch

cli, err := newMinikubeAPIClient(ctx, profile)
if err != nil {
    if strings.Contains(err.Error(), "executing minikube command") {
        return fmt.Errorf("cannot run minikube: is it installed and on PATH? (install: https://minikube.sigs.k8s.io/docs/start/)")
    }
    return err
}

Prevention

When it happens

Trigger: newMinikubeAPIClient -> getMinikubeDockerEnv where MinikubeExec fails because the minikube executable is not found on PATH or the cluster client cannot construct the exec command.

Common situations: 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.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/541f11fb98a807ad. Report an issue: GitHub.