{"record":{"id":"1f9e151eaa5549fe","repo":"abiosoft/colima","slug":"invalid-semver-version-for-lima-w","errorCode":null,"errorMessage":"invalid semver version for Lima: %w","messagePattern":"invalid semver version for Lima: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/core.go","lineNumber":75,"sourceCode":"\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\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid semver version for Lima: %w\", err)\n\t}\n\n\tif min.Compare(*current) > 0 {\n\t\treturn fmt.Errorf(\"minimum Lima version supported is %s, current version is %s\", limaVersion, values.Version)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":57,"sourceCodeEnd":84,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/core/core.go#L57-L84","documentation":"LimaVersionSupported strips any pre-release suffix after the first hyphen, special-cases 'HEAD' builds with a warning, then parses Lima's reported version with semver.NewVersion. If the remaining string is not valid semantic versioning, the parse error is wrapped as 'invalid semver version for Lima'.","triggerScenarios":"limactl info reporting a version that, after cutting at the first '-', is not valid semver: two-segment versions like '0.20', date-based schemes like '20240812', or words like 'master'/'stable' in the version field.","commonSituations":"Distro-packaged Lima (Debian, Fedora) with custom version schemes; bleeding-edge or forked Lima builds; wrappers that rewrite the reported version string.","solutions":["Switch to an official upstream Lima release: brew install lima (v0.18.0 or newer)","Inspect the exact string with 'limactl info | jq -r .version' to see what colima cannot parse","Remove distro forks or wrappers that alter the version output and retest"],"exampleFix":"# before (limactl reports version '0.20')\ncolima start   # invalid semver version for Lima\n\n# after\nbrew reinstall lima   # reports e.g. '0.20.0', valid semver\ncolima start","handlingStrategy":"validation","validationCode":"out, _ := exec.Command(\"limactl\", \"info\").Output()\nvar v struct{ Version string `json:\"version\"` }\n_ = json.Unmarshal(out, &v)\ncleaned := strings.SplitN(v.Version, \"-\", 2)[0]\nif _, err := semver.NewVersion(strings.TrimPrefix(cleaned, \"v\")); err != nil {\n    // reported Lima version is not semver: switch to an official release\n}","typeGuard":null,"tryCatchPattern":"if err := core.LimaVersionSupported(); err != nil {\n    if strings.Contains(err.Error(), \"invalid semver\") {\n        // forked/distro Lima reports a non-semver version; install upstream lima\n    }\n}","preventionTips":["Prefer brew-managed Lima on macOS and official binaries elsewhere","Check 'limactl info | jq -r .version' returns an X.Y.Z string before deploying colima","Avoid version-rewriting wrappers around limactl in managed environments"],"tags":["lima","semver","version-check","parsing"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}