{"record":{"id":"412cff678e04c9a4","repo":"abiosoft/colima","slug":"error-retrieving-macos-version-w","errorCode":null,"errorMessage":"error retrieving macOS version: %w","messagePattern":"error retrieving macOS version: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"util/macos.go","lineNumber":45,"sourceCode":"\n// MacOS13OrNewer returns if the current OS is macOS 13 or newer.\nfunc MacOS13OrNewer() bool { return minMacOSVersion(\"13.0.0\") }\n\n// MacOS15OrNewer returns if the current OS is macOS 15 or newer.\nfunc MacOS15OrNewer() bool { return minMacOSVersion(\"15.0.0\") }\n\n// MacOSNestedVirtualizationSupported returns if the current device supports nested virtualization.\nfunc MacOSNestedVirtualizationSupported() bool {\n\treturn IsMxOrNewer(3) && MacOS15OrNewer()\n}\n\nfunc minMacOSVersion(version string) bool {\n\tif !MacOS() {\n\t\treturn false\n\t}\n\tver, err := macOSProductVersion()\n\tif err != nil {\n\t\tlogrus.Warnln(fmt.Errorf(\"error retrieving macOS version: %w\", err))\n\t\treturn false\n\t}\n\n\tcver, err := semver.NewVersion(version)\n\tif err != nil {\n\t\tlogrus.Warnln(fmt.Errorf(\"error parsing version: %w\", err))\n\t\treturn false\n\t}\n\n\treturn cver.Compare(*ver) <= 0\n}\n\n// IsMxOrNewer returns true if the machine is Apple Silicon M{n} where n >= min\n// e.g. IsMxOrNewer(3) returns true for M3, M4, M5, ...\nfunc IsMxOrNewer(min int) bool {\n\tchip, err := chipDetector.GetChipType()\n\tif err != nil {\n\t\tlogrus.Trace(fmt.Errorf(\"error getting chip type: %w\", err))","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/util/macos.go#L27-L63","documentation":"minMacOSVersion asks sw_vers for the host version; on failure it logs this warning via logrus and conservatively returns false, so the gated capability (e.g. MacOS15OrNewer, nested virtualization support) is treated as unsupported. Nothing aborts — this is graceful degradation, and the root cause is one of errors 277/278.","triggerScenarios":"On macOS, macOSProductVersion() fails while code evaluates a version gate such as MacOS15OrNewer() or MacOSNestedVirtualizationSupported().","commonSituations":"Sandboxed or MDM-locked environments blocking subprocess spawn; minimal PATH when the check runs from a launchd/GUI context.","solutions":["Run sw_vers -productVersion by hand to confirm it works in that environment","Ensure /usr/bin is on PATH for daemonized execution","Accept the degraded answer: features gated on macOS version report unsupported","Fix the underlying 277/278 cause if the feature is required"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// never gate hard on macOS version detection: it degrades to false on failure\nif !util.MacOS15OrNewer() {\n    // take the code path that does not require macOS 15+\n    // (detection failure already landed here conservatively)\n}","preventionTips":["Design feature gates so 'unknown version' maps to the conservative path, never to a crash","When this warning appears, go fix the sw_vers execution environment instead of ignoring it"],"tags":["macos","version","graceful-degradation"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}