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.23k stars 231 forks source link

Improve instructions on what to do when the image bundle has expired #631

Closed ghost closed 4 years ago

ghost commented 4 years ago

General information

CRC version

version: 1.0.0-beta.3-4.1.11+e97bf65

CRC status

version: 1.0.0-beta.3-4.1.11+e97bf65

CRC config

- bundle                             : /home/roto/.crc/crc_libvirt_4.1.11.crcbundle
- cpus                               : 4
- memory                             : 8192
- nameserver                         : 
- pull-secret-file                   : 
- skip-check-user-in-libvirt-group   : true
- vm-driver                          : libvirt
- warn-check-bundle-cached           : true

Host Operating System

# PRETTY_NAME="Fedora 30 (Workstation Edition)"

Steps to reproduce

  1. crc stop
    CodeReady Containers instance stopped
  2. crc setup
    INFO Checking if NetworkManager is installed      
    INFO Checking if NetworkManager service is running 
    INFO Caching oc binary                            
    INFO Setting up virtualization                    
    INFO Setting up KVM                               
    INFO Installing libvirt service and dependencies  
    INFO Adding user to libvirt group                 
    WARN Skipping above check ...                     
    INFO Enabling libvirt                             
    INFO Starting libvirt service                     
    INFO Installing crc-driver-libvirt                
    INFO Removing older system-wide crc-driver-libvirt 
    INFO Setting up libvirt 'crc' network             
    INFO Starting libvirt 'crc' network               
    INFO Writing Network Manager config for crc       
    INFO Writing dnsmasq config for crc               
    INFO Unpacking bundle from the CRC binary    
  3. crc start
    INFO Checking if NetworkManager is installed      
    INFO Checking if NetworkManager service is running 
    INFO Checking if oc binary is cached              
    INFO Checking if Virtualization is enabled        
    INFO Checking if KVM is enabled                   
    INFO Checking if libvirt is installed             
    INFO Checking if user is part of libvirt group    
    WARN Skipping above check ...                     
    INFO Checking if libvirt is enabled               
    INFO Checking if libvirt daemon is running        
    INFO Checking if crc-driver-libvirt is installed  
    INFO Checking if libvirt 'crc' network is available 
    INFO Checking if libvirt 'crc' network is active  
    INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists 
    INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists 
    INFO Checking if CRC bundle is cached in '$HOME/.crc' 
    INFO Loading bundle: crc_libvirt_4.1.11.crcbundle ... 
    INFO Creating VM ...                              
    INFO Verifying validity of the cluster certificates ... 
    ERRO Error occurred: Certs have expired, they were valid till: 23 Sep 19 12:25 +0000
  4. crc start
    INFO Checking if NetworkManager is installed      
    INFO Checking if NetworkManager service is running 
    INFO Checking if oc binary is cached              
    INFO Checking if Virtualization is enabled        
    INFO Checking if KVM is enabled                   
    INFO Checking if libvirt is installed             
    INFO Checking if user is part of libvirt group    
    WARN Skipping above check ...                     
    INFO Checking if libvirt is enabled               
    INFO Checking if libvirt daemon is running        
    INFO Checking if crc-driver-libvirt is installed  
    INFO Checking if libvirt 'crc' network is available 
    INFO Checking if libvirt 'crc' network is active  
    INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists 
    INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists 
    INFO Checking if CRC bundle is cached in '$HOME/.crc' 
    INFO Loading bundle: crc_libvirt_4.1.11.crcbundle ... 
    INFO Creating VM ...                              
    INFO Verifying validity of the cluster certificates ... 
    ERRO Error occurred: Certs have expired, they were valid till: 23 Sep 19 12:25 +0000

Expected

CRC VM: Running

Actual

ERRO Error occurred: Certs have expired, they were valid till: 23 Sep 19 12:25 +0000

Logs

INFO Verifying validity of the cluster certificates ... 
(crc) Calling .GetSSHHostname
(crc) DBG | GetIP called for crc
(crc) DBG | Getting current state...
(crc) DBG | IP address: 192.168.130.11
(crc) Calling .GetSSHPort
(crc) Calling .GetSSHKeyPath
(crc) Calling .GetSSHKeyPath
(crc) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/roto/.crc/cache/crc_libvirt_4.1.11/id_rsa_crc (-r--------)
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null core@192.168.130.11 -o IdentitiesOnly=yes -i /home/roto/.crc/cache/crc_libvirt_4.1.11/id_rsa_crc -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
date --date="$(sudo openssl x509 -in /var/lib/kubelet/pki/kubelet-client-current.pem -noout -enddate | cut -d= -f 2)" --iso-8601=seconds
SSH cmd err, output: <nil>: 2019-09-23T12:25:56+00:00

ERRO Error occurred: Certs have expired, they were valid till: 23 Sep 19 12:25 +0000 
Making call to close driver server
adrielparedes commented 4 years ago

I tried to delete the whole .crc directory and same result (osx version: 1.0.0-beta.5)

niboj commented 4 years ago

I had the same problem on Fedora 30. Here's what I did to make it work again...

`[phil@localhost bin]$ crc start INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running INFO Checking if oc binary is cached
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if libvirt is enabled
INFO Checking if libvirt daemon is running
INFO Checking if crc-driver-libvirt is installed
INFO Checking if libvirt 'crc' network is available INFO Checking if libvirt 'crc' network is active
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists INFO Checking if CRC bundle is cached in '$HOME/.crc' INFO Starting stopped VM ...
INFO Verifying validity of the cluster certificates ... ERRO Error occurred: Certs have expired, they were valid till: 23 Sep 19 12:25 +0000 [phil@localhost bin]$ cd .. [phil@localhost ~]$ cd .crc [phil@localhost .crc]$ cd cache [phil@localhost cache]$ dir crc_libvirt_4.1.11 pullsecret.json [phil@localhost cache]$ rm -rf [phil@localhost cache]$ crc stop Stopping CodeReady Containers instance... this may take a few minutes CodeReady Containers instance stopped [phil@localhost cache]$ crc start ERRO Error occurred: File /home/phil/.crc/crc_libvirt_4.1.14.crcbundle does not exist ERRO Error occurred: Run 'crc setup' to unpack the bundle to disk [phil@localhost cache]$ crc setup INFO Checking if running as non-root
INFO Caching oc binary
INFO Setting up virtualization
INFO Setting up KVM
INFO Installing libvirt service and dependencies
INFO Adding user to libvirt group
INFO Enabling libvirt
INFO Starting libvirt service
INFO Installing crc-driver-libvirt
INFO Removing older system-wide crc-driver-libvirt INFO Setting up libvirt 'crc' network
INFO Starting libvirt 'crc' network
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running INFO Writing Network Manager config for crc
INFO Writing dnsmasq config for crc
INFO Will use root access: write dnsmasq configuration in /etc/NetworkManager/dnsmasq.d/crc.conf [sudo] Mot de passe de phil :  INFO Will use root access: execute systemctl daemon-reload command INFO Will use root access: execute systemctl stop/start command INFO Unpacking bundle from the CRC binary
Setup is complete, you can now run 'crc start' to start a CodeReady Containers instance [phil@localhost cache]$ crc start INFO Checking if running as non-root
INFO Checking if oc binary is cached
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if libvirt is enabled
INFO Checking if libvirt daemon is running
INFO Checking if crc-driver-libvirt is installed
INFO Checking if libvirt 'crc' network is available INFO Checking if libvirt 'crc' network is active
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists ERRO Error occurred: Could not find cached bundle info [phil@localhost cache]$ crc delete CodeReady Containers instance deleted [phil@localhost cache]$ crc start INFO Checking if running as non-root
INFO Checking if oc binary is cached
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if libvirt is enabled
INFO Checking if libvirt daemon is running
INFO Checking if crc-driver-libvirt is installed
INFO Checking if libvirt 'crc' network is available INFO Checking if libvirt 'crc' network is active
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists ? Image pull secret [? for help]

ERRO Error occurred: invalid pull secret: invalid character 'y' looking for beginning of value ERRO Error occurred: Failed to get pull secret: invalid pull secret: invalid character 'y' looking for beginning of value [phil@localhost cache]$ crc start INFO Checking if running as non-root
INFO Checking if oc binary is cached
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if libvirt is enabled
INFO Checking if libvirt daemon is running
INFO Checking if crc-driver-libvirt is installed
INFO Checking if libvirt 'crc' network is available INFO Checking if libvirt 'crc' network is active
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists ? Image pull secret [? for help] **

INFO Extracting bundle: crc_libvirt_4.1.14.crcbundle ... INFO Creating VM ...
INFO Verifying validity of the cluster certificates ... INFO Check internal and public dns query ...
INFO Copying kubeconfig file to instance dir ...
INFO Adding user's pull secret and cluster ID ...

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, username is 'kubeadmin' and password is BMLkR-NjA28-v7exC-8bwAk INFO
INFO These credentials can also be used to access the OpenShift web console at https://console-openshift-console.apps-crc.testing CodeReady Containers instance is running [phil@localhost cache]$ [phil@localhost cache]$ crc console Opening the OpenShift Web console in the default browser... [phil@localhost cache]$ `

anjannath commented 4 years ago

This is not a bug in crc, the included system bundle has certs which are valid only for 30 days, and the error message says the same thing, At the moment you'll have to download a newer version of crc.

The original issue is tracked in #11

gbraad commented 4 years ago
ERRO Error occurred: Certs have expired, they were valid till: 23 Sep 19 12:25 +0000

This might sound better when we also provide a solution to the user on how to progress from here/solve this; like Update your cluster image bundle by downloading a new version from http://mirror.openshift.com/...

gbraad commented 4 years ago

Adding the invalid tag for the original issue; as I believe we have an issue for the updated message.

ghost commented 4 years ago

After delete $HOME/.crc dir, and setup/start again, the error it's the same.

cfergeau commented 4 years ago

Have you downloaded an updated crc version?

ghost commented 4 years ago

Am on it, based in your doc/README enhance, And yes, after update crc version, life is beautiful again. Thanks.

gbraad commented 4 years ago

Duplicate of #593