crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.27k stars 242 forks source link

[BUG] Supported MacOS version check on crc setup incorrect #4086

Closed reestr closed 7 months ago

reestr commented 8 months ago

General information

CRC version

CRC version: 2.33.0+c43b17
OpenShift version: 4.14.12
Podman version: 4.4.4

CRC status

DEBU CRC version: 2.33.0+c43b17
DEBU OpenShift version: 4.14.12
DEBU Podman version: 4.4.4
DEBU Running 'crc status'
CRC VM:          Stopped
OpenShift:       Stopped (v4.14.8)
RAM Usage:       0B of 0B
Disk Usage:      0B of 0B (Inside the CRC VM)
Cache Usage:     144.9GB
Cache Directory: /Users/trees/.crc/cache

CRC config

- consent-telemetry                     : no
- cpus                                  : 12
- disk-size                             : 200
- memory                                : 49152

Host Operating System

ProductName:        macOS
ProductVersion:     14.4.1
BuildVersion:       23E224

Intel Mac Pro

Steps to reproduce

  1. Run crc setup

Expected

No warning about MacOS version being old

Actual

➜  ~ crc setup
INFO Using bundle path /Users/trees/.crc/cache/crc_vfkit_4.14.12_amd64.crcbundle
INFO Checking if running macOS version >= 13.x
**WARN This version of macOS is going to be unsupported for CRC, Please update to macOS 13 or newer**
INFO Checking if running as non-root
INFO Checking if crc-admin-helper executable is cached
INFO Checking if running on a supported CPU architecture
INFO Checking if crc executable symlink exists
INFO Checking minimum RAM requirements
INFO Checking if running emulated on Apple silicon
INFO Checking if vfkit is installed
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
INFO Checking if /Users/trees/.crc/cache/crc_vfkit_4.14.12_amd64.crcbundle exists

Logs

Before gather the logs try following if that fix your issue

$ crc delete -f
$ crc cleanup
$ crc setup
$ crc start --log-level debug

Please consider posting the output of crc start --log-level debug on http://gist.github.com/ and post the link in the issue.

gbraad commented 8 months ago

This does not prevent execution, right? It is a WARN level.

There are two places where we check this, installer and preflights. The error reported is for preflights, which is as follows:

https://github.com/crc-org/crc/blob/0cd39c48f8b1efc3b8d667d95afe8e416b86f2ec/pkg/crc/preflight/preflight_checks_darwin.go#L229-L238

darwin.atleast returns the wrong result?

And for the installer:

https://github.com/crc-org/crc/blob/0cd39c48f8b1efc3b8d667d95afe8e416b86f2ec/packaging/darwin/Distribution.in#L30-L35

@anjannath, something seems off... because I do not believe we have seen this for other 14.x-based releases.

reestr commented 8 months ago

This does not prevent execution, right? It is a WARN level.

Correct, only a warning. It makes me anxious that it could have been intentional and you're ending support for Intel based Macs, for greater focus on AS.

gbraad commented 8 months ago

Intel based Macs

we will follow the Apple recommendations/enforcements for this... so eventually we will have a cut-off happening. We will try to keep current version -1 (which is now 13 and 14).

The current check seems to be wrong... or perhaps there is more? @cfergeau might be able to chime in.

anjannath commented 8 months ago

this is not having the same behavior on a Apple silicon mac.. running on M1 macOS 14 it doesn't show the warning message..

% sw_vers
ProductName:        macOS
ProductVersion:     14.4
BuildVersion:       23E214

% crc setup
WARN Using crc_vfkit_4.15.3_arm64.crcbundle bundle, but crc_vfkit_4.14.12_arm64.crcbundle is expected for this release
INFO Using bundle path /Users/anath/.crc/cache/crc_vfkit_4.15.3_arm64.crcbundle
INFO Checking if running macOS version >= 13.x
INFO Checking if running as non-root
INFO Checking if crc-admin-helper executable is cached
INFO Checking if running on a supported CPU architecture
INFO Checking if crc executable symlink exists
INFO Checking minimum RAM requirements
INFO Check if Podman binary exists in: /Users/anath/.crc/bin/oc
INFO Checking if running emulated on Apple silicon
INFO Checking if vfkit is installed
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
INFO Checking if /Users/anath/.crc/cache/crc_vfkit_4.15.3_arm64.crcbundle exists
INFO Checking if old launchd config for tray and/or daemon exists
INFO Checking if crc daemon plist file is present and loaded
INFO Checking SSH port availability
Your system is correctly setup for using CRC. Use 'crc start' to start the instance
gbraad commented 8 months ago

Perhaps share a small test app to see if the library might be broken? As we rely on the library function.

anjannath commented 8 months ago

there's a debug log of the raw output, https://github.com/crc-org/crc/blob/0cd39c48f8b1efc3b8d667d95afe8e416b86f2ec/pkg/os/darwin/release_info.go#L24 we'll get the required info if @reestr shares the o/p for crc setup --log-level debug or $ sysctl kern.osproductversion

gbraad commented 8 months ago

@anjannath does the check INFO Checking if running macOS version >= 13.x have a skip setting?

reestr commented 8 months ago

@anjannath - please see the following:

➜  ~ crc setup --log-level debug
DEBU CRC version: 2.33.0+c43b17
DEBU OpenShift version: 4.14.12
DEBU Podman version: 4.4.4
DEBU Running 'crc setup'
INFO Using bundle path /Users/trees/.crc/cache/crc_vfkit_4.14.12_amd64.crcbundle
INFO Checking if running macOS version >= 13.x
DEBU kern.osproductversion is: 10.16
WARN This version of macOS is going to be unsupported for CRC, Please update to macOS 13 or newer
INFO Checking if running as non-root
INFO Checking if crc-admin-helper executable is cached
INFO Checking if running on a supported CPU architecture
DEBU GOARCH is amd64 GOOS is darwin
INFO Checking if crc executable symlink exists
INFO Checking minimum RAM requirements
DEBU Total memory of system is 412316860416 bytes
INFO Checking if running emulated on Apple silicon
INFO Checking if vfkit is installed
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
INFO Checking if /Users/trees/.crc/cache/crc_vfkit_4.14.12_amd64.crcbundle exists
DEBU /Users/trees/.crc/cache/crc_vfkit_4.14.12_amd64.crcbundle exists
INFO Checking if old launchd config for tray and/or daemon exists
INFO Checking if crc daemon plist file is present and loaded
DEBU Running 'bash -c launchctl list | grep com.redhat.crc.daemon | awk '{print $1}''
INFO Checking SSH port availability
anjannath commented 8 months ago

@reestr so there's a difference in the o/p of command sw_vers vs sysctl kern.osproductversion on your machine? on the M1 macbook pro i am testing (and just updated to the latest 14.x) i get the following o/p

[anath@anath-mac] ~ % sw_vers
ProductName:        macOS
ProductVersion:     14.4.1
BuildVersion:       23E224

[anath@anath-mac] ~ % sysctl kern.osproductversion
kern.osproductversion: 14.4.1
anjannath commented 8 months ago

@anjannath does the check INFO Checking if running macOS version >= 13.x have a skip setting?

yes, there's a skip-check-* config for this check..

* skip-check-mac-version               Skip preflight check (true/false, default: false)
reestr commented 8 months ago

@reestr so there's a difference in the o/p of command sw_vers vs sysctl kern.osproductversion on your machine? on the M1 macbook pro i am testing (and just updated to the latest 14.x) i get the following o/p

[anath@anath-mac] ~ % sw_vers
ProductName:      macOS
ProductVersion:       14.4.1
BuildVersion:     23E224

[anath@anath-mac] ~ % sysctl kern.osproductversion
kern.osproductversion: 14.4.1

Running those commands explicitly, I get the same output:

➜  ~ sw_vers
ProductName:        macOS
ProductVersion:     14.4.1
BuildVersion:       23E224
➜  ~ sysctl kern.osproductversion
kern.osproductversion: 14.4.1
cfergeau commented 8 months ago

Not really useful, but on my macos 12.7.4 intel macbook, crc debug log matches the sysctl kern.osproductversion call:

INFO Checking if running macOS version >= 13.x    
DEBU kern.osproductversion is: 12.7.4  
$ sysctl kern.osproductversion
kern.osproductversion: 12.7.4

$ sw_vers 
ProductName:    macOS
ProductVersion: 12.7.4
BuildVersion:   21H1123
gbraad commented 8 months ago

@reestr This was an updated system, from 10.x all the way to 14.x ?

What does echo $SYSTEM_VERSION_COMPAT return ?

Note: reference here https://opensource.apple.com/source/xnu/xnu-7195.141.2/tests/system_version_compat.c.auto.html for system version retrieve

reestr commented 8 months ago

@reestr This was an updated system, from 10.x all the way to 14.x ?

Its been updated from 10.15 I think. CRC was reporting the version as 10.16, but I don't believe that is a verion which was ever released. MacOS went from 10.15 -> 11

What does echo $SYSTEM_VERSION_COMPAT return ?

It doesn't return anything.

Note: reference here https://opensource.apple.com/source/xnu/xnu-7195.141.2/tests/system_version_compat.c.auto.html for system version retrieve