lima-vm/lima · error

inspect status command failed: %w

Error message

inspect status command failed: %w

What it means

limactl wraps the exit error of an external driver's status/inspect helper command, appending the command's stderr output when present. The library throws it because the subprocess implementing driver status inspection exited non-zero, and the underlying stderr is needed to diagnose why.

Source

Thrown at pkg/driverutil/vm.go:112

	}
	stdin.Close()

	decoder := json.NewDecoder(stdout)
	var response []byte
	if err := decoder.Decode(&response); err != nil {
		return "", err
	}

	var respInst limatype.Instance
	if err := respInst.UnmarshalJSON(response); err != nil {
		return "", fmt.Errorf("failed to unmarshal instance response: %w", err)
	}

	if err := cmd.Wait(); err != nil {
		if stderrBuf.Len() > 0 {
			return "", fmt.Errorf("inspect status command failed: %w; stderr: %s", err, stderrBuf.String())
		}
		return "", fmt.Errorf("inspect status command failed: %w", err)
	}

	if stderrBuf.Len() > 0 {
		logrus.Debugf("external driver stderr: %s", stderrBuf.String())
	}

	*inst = respInst
	logrus.Debugf("Inspecting instance status action completed successfully for %#q", extDriverPath)
	return inst.Status, nil
}

View on GitHub (pinned to dd909d0973)

Solutions

  1. Read the `stderr: ...` suffix of the wrapped error to see the driver's own failure message
  2. Verify the external driver binary exists, is executable, and matches the expected driver version
  3. Re-run with --debug (logrus) for more context on the command invoked
  4. Recreate or repair the instance state if the driver reports corrupted/stale state
Defensive patterns

Strategy: try-catch

Validate before calling

// before calling InspectStatus
if _, err := exec.LookPath(driverBinary); err != nil {
    return fmt.Errorf("driver %q not installed", driverBinary)
}

Try / catch

status, err := lima.InspectStatus(inst)
if err != nil {
    if strings.Contains(err.Error(), "stderr: ") {
        // surface driver stderr to the user / log it
        log.Errorf("driver inspect failed: %v", err)
    }
    return err
}

Prevention

When it happens

Trigger: Calling InspectStatus (handleInspectStatusAction) when the external driver binary is missing, not executable, exits with an error, or writes a failure to stderr during status inspection.

Common situations: Driver plugin not installed or wrong PATH; driver version mismatch with lima; the driver crashed or rejected the instance state; stale/partially-deleted VM state causing the driver to fail.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/42e70d27ef7579ca. Report an issue: GitHub.