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.26k stars 239 forks source link

[BUG] ERROR - Failed not connect to the CRC VM with SSH #1310

Closed GrooveCS closed 4 years ago

GrooveCS commented 4 years ago

General information

CRC version

crc version: 1.11.0+883ca49
OpenShift version: 4.4.5 (embedded in binary)0

CRC status

# Put `crc status --log-level debug` output here

CRC config

N/A

Host Operating System

ProductName:    Mac OS X
ProductVersion: 10.15.4
BuildVersion:   19E287

Steps to reproduce

  1. crc setup
  2. crc start -p pull-secret.txt
  3. Error Message
  4. crc delete -f
  5. crc cleanup
  6. crc setup
  7. crc start -p pull-secret.txt --log-level debug

Expected

Actual

ERRO Error creating host: Error creating the VM: Error creating machine: Error in driver during machine creation: getting MAC address from UUID: vmnet: error from vmnet.framework: -1 Making call to close driver server (crc) Calling .Close (crc) DBG | Closing plugin on server side Successfully made call to close driver server Making call to close connection to plugin binary

Logs

https://gist.github.com/GrooveCS/667d95b4e806c2cc26fa76fbd6dc148c

Before gathering the logs try following if that fixes your issue

$ crc delete -f
$ crc cleanup
$ crc setup
$ crc start --log-level debug
GrooveCS commented 4 years ago

Status

Once Docker was enabled, started and after reboot macOS Laptop the CRC Start process completed.

Since I had was able to get CRC to work once Docker was enabled and started, I took the time to try a similar change to see if it would address some of the challenges.

CRC status

# Put `crc status --log-level debug` output here

crc status --log-level debug
DEBU Running '/Users/parrislucas/.crc/bin/oc/oc get co -ojson --kubeconfig /Users/parrislucas/.crc/machines/crc/kubeconfig --context admin --cluster crc' 
DEBU About to run SSH command:
df -B1 --output=size,used,target /sysroot | tail -1 
DEBU SSH cmd err, output: <nil>: 32719437824 12035317760 /sysroot 
CRC VM:          Running
OpenShift:       Running (v4.4.5)
Disk Usage:      12.04GB of 32.72GB (Inside the CRC VM)
Cache Usage:     12.12GB
Cache Directory: /Users/parrislucas/.crc/cache

CRC config

N/A

Host Operating System

ProductName:    Mac OS X
ProductVersion: 10.15.4
BuildVersion:   19E287

Steps to reproduce

  1. crc delete -f
  2. crc cleanup
  3. Enable Docker
  4. Restart laptop
  5. rm -fr ~/.crc
  6. crc setup
  7. crc start -p pull-secret.txt --log-level debug

Expected

INFO Starting OpenShift cluster ... [waiting 3m]  
INFO                                              
INFO To access the cluster, first set up your environment by following 'crc oc-env' instructions 
INFO Then you can access it by running 'oc login -u developer -p developer https://api.crc.testing:6443' 
INFO To login as an admin, run 'oc login -u kubeadmin -p 8rynV-SeYLc-h8Ij7-YPYcz https://api.crc.testing:6443' 
INFO                                              
INFO You can now run 'crc console' and use these credentials to access the OpenShift web console 
Started the OpenShift cluster
WARN The cluster might report a degraded or error state. This is expected since several operators have been disabled to lower the resource usage. For more information, please consult the documentation

Actual

INFO Starting OpenShift cluster ... [waiting 3m]  
INFO                                              
INFO To access the cluster, first set up your environment by following 'crc oc-env' instructions 
INFO Then you can access it by running 'oc login -u developer -p developer https://api.crc.testing:6443' 
INFO To login as an admin, run 'oc login -u kubeadmin -p 8rynV-SeYLc-h8Ij7-YPYcz https://api.crc.testing:6443' 
INFO                                              
INFO You can now run 'crc console' and use these credentials to access the OpenShift web console 
Started the OpenShift cluster
WARN The cluster might report a degraded or error state. This is expected since several operators have been disabled to lower the resource usage. For more information, please consult the documentation

Logs

gbraad commented 4 years ago

Once Docker was enabled, started and after reboot macOS Laptop the CRC Start process completed.

I don't think Docker for mac magically fixed it. But rather the reboot caused network settings to default again.

Were you at any point connected to a VPN?

praveenkumar commented 4 years ago

ERRO Error creating host: Error creating the VM: Error creating machine: Error in driver during machine creation: getting MAC address from UUID: vmnet: error from vmnet.framework: -1

@GrooveCS this is well known error and happen because a existing hyperkit process is running which belong to CRC so it is not able to create another network with same uuid. something like https://github.com/code-ready/crc/issues/1134 one

GrooveCS commented 4 years ago

Were you at any point connected to a VPN?

VPN? Early last week on Monday or Tuesday, yet not for the balance.

GrooveCS commented 4 years ago

@GrooveCS this is well known error and happen because a existing hyperkit process is running which belong to CRC so it is not able to create another network with same uuid. something like #1134 one

{Question] What are the preparation tasks to perform to avoid this issue?

praveenkumar commented 4 years ago

What are the preparation tasks to perform to avoid this issue?

@GrooveCS as of now we have to add it to known issues with a manual workaround till we have some time to automate it as part of setup/start.

gbraad commented 4 years ago

But rather the reboot caused network settings to default again.

The reboot caused the stray process to disappear.

We could have a similar check with an existing process name. Our name is unique anyway. I did something similar for the xhyve driver at that time: https://github.com/machine-drivers/docker-machine-driver-xhyve/commit/1c761001ced7a21b904e54d147e4c5d1d285b286

GrooveCS commented 4 years ago

Good morning @praveenkumar & @gbraad,

It's a challenge to circle back on macOS, and presently have a fan dilemma with the device. Let me know if this issue should be closed until the loaner arrives in my hand.

Observe we produce a list of checks that run during ./crc setupand ./crc start.

It appears networking should be considered. We have minimum requirements for CRC, yet do we have recommended requirements around using different functionality, scenarios, or built-in services?

Thinking how on Windows you can configure General Purpose, Performance Foreground or Performance Background,

Developer Configuration Examples

# Compute Examples
# ./crc config set cpus 6  = 12 x 50%  # General (CPUs * 50%)  
# ./crc config set cpus 9 = 12 x 75%   # Compute (CPUs * 75%)
# ./crc config set cpus 20 = 24 - 4    # High Compute (CPUs * - 4 CPUs)
# Memory Examples
# ./crc config set memory 6  = 12 x 50%  # General (CPUs * 50%)  
# ./crc config set memory 9 = 12 x 75%   # Compute (CPUs * 75%)
# ./crc config set memory 20 = 24 - 4    # High Compute (CPUs * - 4 CPUs)

# Minimum Configuration
./crc config set cpus 4
./crc config set memory 9216         # (4 cpus * 2048) ) + 1024

# Compute Configuration
./crc config set cpus 12
./crc config set memory 14336        # (12 cpus *  1024) + 2048

# Memory Configuration
# ./crc config set cpus 6
# ./crc config set memory 16384      # (6 cpus *  2048) + 4096 

# Balanced Configuration
# ./crc config set cpus 8
# ./crc config set memory 18432      #  (8 cpus *  2048) + 2048

# Hi Performance Configuration
# ./crc config set cpus 20           # High Compute (CPUs * - 4 CPUs)
# ./crc config set memory 49156      #  (20 cpus *  40960) + 8196

# If having DNS Challenges consider using external DNS
#./crc config set nameserver 8.8.8.8

# What are the default recommendation for 'http-proxy, https-proxy & noproxy?
#./crc config set http-proxy
#./crc config set https-proxy
#./crc config set no-proxy

# Consider setting the pull-secret.txt location if not in the same directory with `./crc`
./crc config set pull-secret-file ~/crc/pull-secret.txt

What are your thoughts?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.