Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] We should instruct the user how he could possibly resolve the issue when the bundle does not exist #3640

Closed
gbraad opened this issue May 9, 2023 · 7 comments

Comments

@gbraad
Copy link
Contributor

gbraad commented May 9, 2023

The following issue can occur when the user changes the preset. He was previously able to use crc, but since the flow might have been guided (extension/tray) he is unaware of what to do:

PS> crc config set preset podman
Changes to configuration property 'preset' are only applied when the CRC instance is created.
If you already have a running CRC instance with different preset, then for this configuration change to take effect, delete the CRC instance with 'crc delete', setup it with `crc setup` and start it with 'crc start'.
PS>  crc delete
Machine does not exist. Use 'crc start' to create it
PS> crc start
file 'C:\Users\gbraad\.crc\cache\crc_podman_hyperv_4.4.1_amd64.crcbundle' does not exist
PS> 

We should instruct the user to run crc setup.

Note: I am aware, as shown, this already happens for the preset change itself. But when this is performed from a UI, this message is not shown. We should repeat this again just in case.

@gbraad
Copy link
Contributor Author

gbraad commented Aug 8, 2023

As reported by Florent, this is even more confusing when the user is told to run start after a stop.

$ crc stop
Machine does not exist. Use 'crc start' to create it
$ crc start
file '/Users/benoitf/.crc/cache/crc_microshift_vfkit_4.13.6_arm64.crcbundle' does not exist

Repeating the message seems the better approach

@rohanKanojia
Copy link
Contributor

I would like to work on this. Could someone please assign this issue to me?

@rohanKanojia
Copy link
Contributor

rohanKanojia commented Nov 14, 2024

I'm checking this but wondering if it's fixed already in #3826 . Could anyone please confirm?

I see hint to use crc setup when we specify non existent bundle:

 $ crc start -b /foobar
/foobar is invalid or missing, run 'crc setup' to download the default bundle

@rohanKanojia
Copy link
Contributor

I'm trying to reproduce this issue. I'm trying to follow steps provided in #3640 (comment) but I see slightly different behavior:

  • When I run crc config set preset podman I get error that Value 'podman' for configuration property 'preset' is invalid, reason: Unknown preset. Only [openshift okd microshift] are valid.
  • If I use some other value from preset, let's say microshift and make sure that the bundle doesn't exist by deleting it from .crc/cache directory. I see that in absence of bundle crc starts downloading the bundle:
    • crc config set preset microshift
    • crc delete
    • crc start
 crc : $ crc start
WARN A new version (2.43.0) has been published on https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.43.0/crc-linux-amd64.tar.xz 
INFO Using bundle path /home/rokumar/.crc/cache/crc_microshift_libvirt_4.16.14_amd64.crcbundle 
INFO Checking if running as non-root              
INFO Checking if running inside WSL2              
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: /home/rokumar/.crc/bin/oc 
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 active user/process is currently part of the libvirt group 
INFO Checking if libvirt daemon is running        
INFO Checking if a supported libvirt version is installed 
INFO Checking if crc-driver-libvirt is installed  
INFO Checking crc daemon systemd socket units     
INFO Checking if vsock is correctly configured    
INFO Downloading bundle: crc_microshift_libvirt_4.16.14_amd64... 
166.57 MiB / 1.59 GiB [--------->__________________________________________________________________________________] 10.22% 31.93 MiB/

@gbraad
Copy link
Contributor Author

gbraad commented Nov 15, 2024

Maybe you can try this with OKD and OCP as preset, or moving from OpenShift to Microshift; podman as a preset does not exist anymore.

> crc config preset openshift
> crc start
...  # wait until started
> crc config preset microshift
> crc delete
> crc start

Note: make sure you do not already have a cached bundle, and ensure you switch from a working situation to another preset

that is what I remember and think could repro for other bundles. make sure there is nothing in the cache
as we rely on the setup step to download this; start would trigger this error (but could be it got fixed??? otherwise start should start downloading if there is nothing in the cache???) dont believe we added this

@rohanKanojia
Copy link
Contributor

I’m having difficulty reproducing the issue. I think behavior might have changed since the issue was created. I’ve tried the following scenarios:

Switching from OpenShift to microshift preset

  • crc config set preset openshift
  • crc setup (downloads crc_libvirt bundle)
  • crc config set preset microshift
  • crc delete
  • rm -rf ~/.crc/cache
  • crc start (starts downloading crc_microshift_libvirt bundle)

Switching from OpenShift to okd preset

  • crc config set preset openshift
  • crc setup (downloads crc_libvirt bundle)
  • crc config set preset okd
  • crc delete
  • rm -rf ~/.crc/cache
  • crc start (starts downloading crc_okd_libvirt bundle)

Switching from okd to microshift preset

  • crc config set preset okd
  • crc setup (downloads crc_okd_libvirt bundle)
  • crc config set preset microshift
  • crc delete
  • rm -rf ~/.crc/cache
  • crc start (starts downloading crc_microshift_libvirt bundle)

When I look at code, it seems that we've modified the behavior to download a fresh bundle in case expected one is not found:

bundleInfo, err := bundle.Use(bundleName)
if err == nil {
logging.Infof("Loading bundle: %s...", bundleName)
return bundleInfo, nil
}
logging.Debugf("Failed to load bundle %s: %v", bundleName, err)
logging.Infof("Downloading bundle: %s...", bundleName)
bundlePath, err = bundle.Download(preset, bundlePath, enableBundleQuayFallback)
if err != nil {

@rohanKanojia
Copy link
Contributor

rohanKanojia commented Nov 18, 2024

Duplicate of #3742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants