Bug 2027329 - Installer panics on missing flavor
Summary: Installer panics on missing flavor
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.9
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.9.z
Assignee: Stephen Finucane
QA Contact: Jon Uriarte
URL:
Whiteboard:
Depends On: 2027425
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-29 12:22 UTC by Stephen Finucane
Modified: 2021-12-06 11:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2027425 (view as bug list)
Environment:
Last Closed: 2021-12-06 11:22:49 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift installer pull 5424 0 None open Bug 2027329: Handle unset default machine pool 2021-11-29 16:03:41 UTC
Red Hat Product Errata RHBA-2021:4889 0 None None None 2021-12-06 11:22:51 UTC

Description Stephen Finucane 2021-11-29 12:22:59 UTC
Version:

4.9

Platform:

openstack (UPI, IPI)

What happened?

We're seeing failures in OpenStack jobs in CI for the 4.9 branch [1]. This appears to have been triggered by recent changes [2] to openstack/release, which ultimately mean we're no longer setting computeFlavor in the default platform settings CI configuration. Clearly we should be handling this better. Failure to do so results in the following ugliness:

    ...
    INFO[2021-11-26T10:39:53Z] Installing from release registry.build03.ci.openshift.org/ci-op-2bc95lmq/release@sha256:1a536627e6287b2347bb6baaf7b80d81ac644ae3c0cc3d5b0f2c5fb0eba91441
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x3188ca6]
    goroutine 1 [running]:
    github.com/openshift/installer/pkg/types/openstack/validation.validateDefaultMachinePool(0x0, 0xc0009eef90, 0x16, 0x0, 0x0)
        /go/src/github.com/openshift/installer/pkg/types/openstack/validation/machinepool.go:43 +0x26
    github.com/openshift/installer/pkg/types/openstack/validation.ValidatePlatform(0xc000ea3600, 0xc00112a900, 0xc0009eef60, 0xc000737b00, 0x0, 0x0, 0xc0009eef60)
        /go/src/github.com/openshift/installer/pkg/types/openstack/validation/platform.go:37 +0x2a5
    github.com/openshift/installer/pkg/types/validation.validatePlatform.func7(0xc0009eef60, 0x10461d60, 0x9, 0x0)
        /go/src/github.com/openshift/installer/pkg/types/validation/installconfig.go:465 +0x4a
    github.com/openshift/installer/pkg/types/validation.validatePlatform.func1(0x10461d60, 0x9, 0xd890ec0, 0xc000ea3600, 0xc000f92c58)
        /go/src/github.com/openshift/installer/pkg/types/validation/installconfig.go:444 +0x29b
    github.com/openshift/installer/pkg/types/validation.validatePlatform(0xc000737c70, 0xc0009eef30, 0xc00112a900, 0xc000737b00, 0x0, 0xc0009eef30, 0x6)
        /go/src/github.com/openshift/installer/pkg/types/validation/installconfig.go:464 +0x582
    github.com/openshift/installer/pkg/types/validation.ValidateInstallConfig(0xc000737b00, 0x0, 0xc000f93088, 0x40e218)
        /go/src/github.com/openshift/installer/pkg/types/validation/installconfig.go:110 +0x5a5
    github.com/openshift/installer/pkg/asset/installconfig.(*InstallConfig).finish(0xc000236c30, 0x104d1668, 0x13, 0x13ce, 0x1018e980)
        /go/src/github.com/openshift/installer/pkg/asset/installconfig/installconfig.go:155 +0x99
    github.com/openshift/installer/pkg/asset/installconfig.(*InstallConfig).Load(0xc000236c30, 0x11bf8ce0, 0xc000817d50, 0x11cfe258, 0xc000236c30, 0xc000236c30)
        /go/src/github.com/openshift/installer/pkg/asset/installconfig/installconfig.go:136 +0x1f3
    github.com/openshift/installer/pkg/asset/store.(*storeImpl).load(0xc00097ff80, 0x11c25e28, 0xc00014c7e0, 0xc000c94a6c, 0x4, 0xc000c94a6c, 0x4, 0x0)
        /go/src/github.com/openshift/installer/pkg/asset/store/store.go:264 +0x455
    github.com/openshift/installer/pkg/asset/store.(*storeImpl).load(0xc00097ff80, 0x11c25df8, 0xc0009e8d20, 0x1044b240, 0x2, 0x1044b240, 0x2, 0x0)
        /go/src/github.com/openshift/installer/pkg/asset/store/store.go:247 +0x2d7
    github.com/openshift/installer/pkg/asset/store.(*storeImpl).load(0xc00097ff80, 0x11c260c8, 0x19c40f80, 0x0, 0x0, 0x2, 0x2, 0x0)
        /go/src/github.com/openshift/installer/pkg/asset/store/store.go:247 +0x2d7
    github.com/openshift/installer/pkg/asset/store.(*storeImpl).fetch(0xc00097ff80, 0x11c260c8, 0x19c40f80, 0x0, 0x0, 0x40b845, 0xebbc880)
        /go/src/github.com/openshift/installer/pkg/asset/store/store.go:201 +0xa45
    github.com/openshift/installer/pkg/asset/store.(*storeImpl).Fetch(0xc00097ff80, 0x11c260c8, 0x19c40f80, 0x19bec720, 0x4, 0x4, 0xed932b075, 0xea829c25de2c47e1)
        /go/src/github.com/openshift/installer/pkg/asset/store/store.go:77 +0x4b
    main.runTargetCmd.func1(0x7fffe2cfacc4, 0xe, 0xc00000e3d8, 0x0)
        /go/src/github.com/openshift/installer/cmd/openshift-install/create.go:238 +0x12d
    main.runTargetCmd.func2(0x19bfb0e0, 0xc000817b40, 0x0, 0x1)
        /go/src/github.com/openshift/installer/cmd/openshift-install/create.go:265 +0xb5
    github.com/spf13/cobra.(*Command).execute(0x19bfb0e0, 0xc000817b30, 0x1, 0x1, 0x19bfb0e0, 0xc000817b30)
        /go/src/github.com/openshift/installer/vendor/github.com/spf13/cobra/command.go:854 +0x2c2
    github.com/spf13/cobra.(*Command).ExecuteC(0xc0009c98c0, 0xc000f93de8, 0x1, 0x1)
        /go/src/github.com/openshift/installer/vendor/github.com/spf13/cobra/command.go:958 +0x375
    github.com/spf13/cobra.(*Command).Execute(...)
        /go/src/github.com/openshift/installer/vendor/github.com/spf13/cobra/command.go:895
    main.installerMain()
        /go/src/github.com/openshift/installer/cmd/openshift-install/main.go:72 +0x2fe
    main.main()
        /go/src/github.com/openshift/installer/cmd/openshift-install/main.go:50 +0x259
    Setup phase finished, prepare env for next steps 
    ...


What did you expect to happen?

The installer should correctly handle an unset computeFlavor attribute, or at least fail gracefully.

How to reproduce it (as minimally and precisely as possible)?

This was seen in CI, however, an 'install-config.yaml' that doesn't define a value for the (deprecated) 'platform.openstack.computeFlavor' key, or any other flavor-related key, should see this issue.

Anything else we need to know?

-

Comment 3 ShiftStack Bugwatcher 2021-12-01 07:03:42 UTC
Removing the Triaged keyword because:
{reasons}

Comment 6 Pierre Prinetti 2021-12-01 09:58:24 UTC
Comment #3 was garbled, my bad.
The bugwatcher has removed the Triaged keyword because the qe_test_coverage flag is missing.

Comment 7 Jon Uriarte 2021-12-03 08:52:40 UTC
Verified in OCP 4.9.0-0.nightly-2021-12-01-032316 (4.9.10 candidate) on top of OSP 16.1.6.

(also reproduced in 4.9.9)

1. Remove the computeFlavor from the install-config.yaml:
[...]
platform:
  openstack:
    cloud:            "xx"
    externalNetwork:  "yy"
    region:           "zz"
    #computeFlavor:    "m4.xlarge"
    lbFloatingIP:     "aa"
    ingressFloatingIP:     "bb"
    externalDNS:      ["cc"]
[...]

2. Run the installer:
$ openshift-install create cluster --dir=/home/stack/ostest/ --log-level=debug
DEBUG OpenShift Installer 4.9.0-0.nightly-2021-12-01-032316 
DEBUG Built from commit e2850d67bbbf1a86101f665d39e1ca7f13965487 
DEBUG Fetching Metadata...                         
DEBUG Loading Metadata...                          
DEBUG   Loading Cluster ID...                      
DEBUG     Loading Install Config...                
DEBUG       Loading SSH Key...                     
DEBUG       Loading Base Domain...                 
DEBUG         Loading Platform...                  
DEBUG       Loading Cluster Name...                
DEBUG         Loading Base Domain...               
DEBUG         Loading Platform...                  
DEBUG       Loading Networking...                  
DEBUG         Loading Platform...                  
DEBUG       Loading Pull Secret...                 
DEBUG       Loading Platform...                    
FATAL failed to fetch Metadata: failed to load asset "Install Config": [controlPlane.platform.openstack.type: Required value: Flavor name must be provided, compute[0].platform.openstack.type: Required value: Flavor name must be provided]

The error is correctly handled and printed now.

Comment 9 errata-xmlrpc 2021-12-06 11:22:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.9.10 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4889


Note You need to log in before you can comment on or make changes to this bug.