{"record":{"id":"0f4fa6ac4261fa63","repo":"lima-vm/lima","slug":"inspect-status-command-failed-w-stderr-s","errorCode":null,"errorMessage":"inspect status command failed: %w; stderr: %s","messagePattern":"inspect status command failed: %w; stderr: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driverutil/vm.go","lineNumber":110,"sourceCode":"\tif err := encoder.Encode(payload); err != nil {\n\t\treturn \"\", err\n\t}\n\tstdin.Close()\n\n\tdecoder := json.NewDecoder(stdout)\n\tvar response []byte\n\tif err := decoder.Decode(&response); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar respInst limatype.Instance\n\tif err := respInst.UnmarshalJSON(response); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to unmarshal instance response: %w\", err)\n\t}\n\n\tif err := cmd.Wait(); err != nil {\n\t\tif stderrBuf.Len() > 0 {\n\t\t\treturn \"\", fmt.Errorf(\"inspect status command failed: %w; stderr: %s\", err, stderrBuf.String())\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"inspect status command failed: %w\", err)\n\t}\n\n\tif stderrBuf.Len() > 0 {\n\t\tlogrus.Debugf(\"external driver stderr: %s\", stderrBuf.String())\n\t}\n\n\t*inst = respInst\n\tlogrus.Debugf(\"Inspecting instance status action completed successfully for %#q\", extDriverPath)\n\treturn inst.Status, nil\n}\n","sourceCodeStart":92,"sourceCodeEnd":123,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driverutil/vm.go#L92-L123","documentation":"After the external driver's --inspect-status process exits non-zero, this error reports the wait error plus everything the driver wrote to stderr. Lima throws it so the driver's own diagnostic output (why it could not inspect the instance) is surfaced to the limactl user.","triggerScenarios":"cmd.Wait() returns a non-nil error for the external driver process — the driver exited with a non-zero status (bad instance JSON on stdin, missing VM state, internal panic) while stderrBuf was non-empty, so the stderr variant of the message is produced.","commonSituations":"External driver cannot find or lock the instance directory; VM is in a half-deleted state; driver binary incompatible with the piped Instance JSON; OS-level failures like missing dynamic libraries in the driver binary.","solutions":["Read the stderr suffix — it contains the driver's own error message and points to the real fix","Verify the instance directory is intact (lima.yaml, disk, iso present) and not locked by another lima process","Reinstall/rebuild the external driver matching your Lima version","Run the driver's --inspect-status manually with the same JSON on stdin to reproduce and debug"],"exampleFix":"// before: stderr: \"lock: resource temporarily unavailable\"\n// another limactl holds the lock\n// after\n$ pkill -f lima-driver-foo && limactl list","handlingStrategy":"try-catch","validationCode":"if err := exec.Command(extDriverPath, \"--inspect-status\", \"--help\").Run(); err != nil {\n    return fmt.Errorf(\"external driver binary broken: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"status, err := driverutil.InspectStatus(ctx, inst)\nif err != nil {\n    if strings.Contains(err.Error(), \"inspect status command failed\") {\n        if i := strings.Index(err.Error(), \"stderr:\"); i >= 0 {\n            log.Errorf(\"driver stderr: %s\", err.Error()[i:])\n            // act on driver-specific message (lock, missing files, crash)\n        }\n    }\n    return err\n}","preventionTips":["Always read the stderr suffix in the error — it names the driver-side cause","Avoid running concurrent lima commands on the same instance","Keep instance directories intact; don't delete disk/iso while querying status"],"tags":["external-driver","process-exit","stderr"],"backgroundTag":"driver-command-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}