{"record":{"id":"f5e0a9a6a961d7e8","repo":"abiosoft/colima","slug":"error-checking-lima-version-w","errorCode":null,"errorMessage":"error checking Lima version: %w","messagePattern":"error checking Lima version: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/core.go","lineNumber":55,"sourceCode":"\t// validate binfmt\n\tif err := guest.RunQuiet(\"command\", \"-v\", \"binfmt\"); err != nil {\n\t\treturn fmt.Errorf(\"binfmt not found: %w\", err)\n\t}\n\n\treturn install()\n}\n\n// LimaVersionSupported checks if the currently installed Lima version is supported.\nfunc LimaVersionSupported() error {\n\tvar values struct {\n\t\tVersion string `json:\"version\"`\n\t}\n\tvar buf bytes.Buffer\n\tcmd := cli.Command(\"limactl\", \"info\")\n\tcmd.Stdout = &buf\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"error checking Lima version: %w\", err)\n\t}\n\n\tif err := json.NewDecoder(&buf).Decode(&values); err != nil {\n\t\treturn fmt.Errorf(\"error decoding 'limactl info' json: %w\", err)\n\t}\n\t// remove pre-release hyphen\n\tparts := strings.SplitN(values.Version, \"-\", 2)\n\tif len(parts) > 0 {\n\t\tvalues.Version = parts[0]\n\t}\n\n\tif parts[0] == \"HEAD\" {\n\t\tlogrus.Warnf(\"to avoid compatibility issues, ensure lima development version (%s) in use is not lower than %s\", values.Version, limaVersion)\n\t\treturn nil\n\t}\n\n\tmin := semver.New(strings.TrimPrefix(limaVersion, \"v\"))\n\tcurrent, err := semver.NewVersion(strings.TrimPrefix(values.Version, \"v\"))","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/core/core.go#L37-L73","documentation":"LimaVersionSupported runs 'limactl info' via cli.Command with stdout captured into a buffer; if the command cannot start or exits non-zero, the error is wrapped as 'error checking Lima version'. The most common root cause is limactl missing from PATH because Lima is not installed or the brew prefix is absent from the environment.","triggerScenarios":"Starting colima when limactl is not in $PATH (Lima uninstalled, broken brew linkage, or a service/IDE context without the brew bin directory), or when limactl exists but 'limactl info' exits non-zero due to a broken Lima installation.","commonSituations":"Source installs of colima without lima; brew upgrade unlinking limactl; IDE terminals, launchd, or brew services where PATH lacks /opt/homebrew/bin; corrupted Lima config directory.","solutions":["Confirm 'limactl info' runs in the same shell colima is invoked from; if not found, brew install lima","Reinstall colima via brew so the lima dependency is restored: brew reinstall colima","Ensure PATH includes the brew prefix: eval \"$(brew shellenv)\" in the invoking shell or service unit","If limactl exists but errors, run 'limactl info' directly and fix or reinstall Lima"],"exampleFix":"# before\nlimactl info   # command not found\ncolima start   # error checking Lima version\n\n# after\nbrew install lima && colima start","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"limactl\"); err != nil {\n    // Lima missing: brew install lima, or fix PATH, before starting colima\n}\nout, err := exec.Command(\"limactl\", \"info\").Output()\nif err != nil {\n    // limactl present but broken: reinstall Lima\n}","typeGuard":null,"tryCatchPattern":"if err := core.LimaVersionSupported(); err != nil {\n    if strings.Contains(err.Error(), \"error checking Lima version\") {\n        // limactl missing or failing: verify PATH and 'limactl info' by hand\n    }\n}","preventionTips":["Install colima via brew so lima is installed and upgraded alongside","Export brew shellenv in every shell and service unit that runs colima","Run 'limactl info' as a smoke test after Lima or PATH changes"],"tags":["lima","version-check","dependencies","path"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}