Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2009670

Summary: Calling 'supported-platforms' just after the cluster creation causes a panic.
Product: OpenShift Container Platform Reporter: Miguel Martin <mmartinv>
Component: assisted-installerAssignee: Elior Erez <eerez>
assisted-installer sub component: assisted-service QA Contact: Yuri Obshansky <yobshans>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs, eerez, mfilanov
Version: 4.8Keywords: Triaged
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AI-Team-Core
Fixed In Version: OCP-Metal-v1.0.27.0 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-10 21:01:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miguel Martin 2021-10-01 08:38:59 UTC
Description of problem:

Assisted service panics after creating a cluster and call the 'supported-platforms' endpoint 

Version-Release number of selected component (if applicable):
All since API version 2 was introduced.

How reproducible:
Always


Steps to Reproduce:
1. Create a cluster
2. Register a host with no inventory
3. Call '/v2/clusters/{cluster_id}/supported-platforms' endpoint

Actual results:
The assisted service panics because 'cluster.HighAvailabilityMode' field has not been correctly initialized at cluster creation time even when the specification describes it should be initialized to 'Full' by default.


Expected results:
The actual response with the supported platforms list.


Additional info:

Comment 1 Michael Filanov 2021-10-05 07:50:06 UTC
if it's related to https://github.com/openshift/assisted-service/blob/042afb35e346cb0c35ac942fd79871bbd2a98f5a/internal/bminventory/inventory.go#L1967  
Them it may happen if the pointer is nil, so probably need top check if pointer is nil before accessing it.

Comment 8 Yuri Obshansky 2021-11-04 11:59:25 UTC
@eerez Please specify which version of Assisted Service contains that fix.

Comment 9 Yuri Obshansky 2021-11-05 17:42:31 UTC
Verified on Staging v1.0.27.0
Request:
GET https://api.stage.openshift.com/api/assisted-install/v2/clusters/4dafb0a1-da44-431d-8e38-fffb9e9c96f7/supported-platforms
Response:
[
    "baremetal"
]

Comment 11 errata-xmlrpc 2021-11-10 21:01:58 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.6 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:4119