abiosoft/colima · warning
error retrieving macOS version: %w
Error message
error retrieving macOS version: %w
What it means
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.
Source
Thrown at util/macos.go:45
// MacOS13OrNewer returns if the current OS is macOS 13 or newer.
func MacOS13OrNewer() bool { return minMacOSVersion("13.0.0") }
// MacOS15OrNewer returns if the current OS is macOS 15 or newer.
func MacOS15OrNewer() bool { return minMacOSVersion("15.0.0") }
// MacOSNestedVirtualizationSupported returns if the current device supports nested virtualization.
func MacOSNestedVirtualizationSupported() bool {
return IsMxOrNewer(3) && MacOS15OrNewer()
}
func minMacOSVersion(version string) bool {
if !MacOS() {
return false
}
ver, err := macOSProductVersion()
if err != nil {
logrus.Warnln(fmt.Errorf("error retrieving macOS version: %w", err))
return false
}
cver, err := semver.NewVersion(version)
if err != nil {
logrus.Warnln(fmt.Errorf("error parsing version: %w", err))
return false
}
return cver.Compare(*ver) <= 0
}
// IsMxOrNewer returns true if the machine is Apple Silicon M{n} where n >= min
// e.g. IsMxOrNewer(3) returns true for M3, M4, M5, ...
func IsMxOrNewer(min int) bool {
chip, err := chipDetector.GetChipType()
if err != nil {
logrus.Trace(fmt.Errorf("error getting chip type: %w", err))View on GitHub (pinned to c3a5f9184d)
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
Defensive patterns
Strategy: fallback
Try / catch
// never gate hard on macOS version detection: it degrades to false on failure
if !util.MacOS15OrNewer() {
// take the code path that does not require macOS 15+
// (detection failure already landed here conservatively)
} Prevention
- 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
When it happens
Trigger: On macOS, macOSProductVersion() fails while code evaluates a version gate such as MacOS15OrNewer() or MacOSNestedVirtualizationSupported().
Common situations: Sandboxed or MDM-locked environments blocking subprocess spawn; minimal PATH when the check runs from a launchd/GUI context.
Related errors
- failed to execute %v: %w
- failed to parse macOS version %q: %w
- error in config: %w
- invalid mountType: '%s'
- error preparing colima privileged dir: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/412cff678e04c9a4.
Report an issue: GitHub.