Bug 2096350 - Web console doesn't display webhook errors for upgrades
Summary: Web console doesn't display webhook errors for upgrades
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.9
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.12.0
Assignee: Robb Hamilton
QA Contact: Yadan Pei
Olivia Payne
Depends On:
Blocks: 2104951
TreeView+ depends on / blocked
Reported: 2022-06-13 15:17 UTC by Will Gordon
Modified: 2023-01-10 00:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
* Previously, the *Cluster update* modal was not displaying errors properly. As a result, the *Cluster update* modal did not display or explain errors when they occurred. With this update, the *Cluster update* modal was updated to correctly display errors. (link:https://bugzilla.redhat.com/show_bug.cgi?id=2096350[*BZ#2096350*])
Clone Of:
Last Closed: 2022-08-10 11:17:47 UTC
Target Upstream Version:

Attachments (Terms of Use)
Screenshot of expected webhook error message (147.92 KB, image/png)
2022-06-24 13:41 UTC, Will Gordon
no flags Details
screenshot of error (386.44 KB, image/png)
2022-07-06 06:07 UTC, Yadan Pei
no flags Details

System ID Private Priority Status Summary Last Updated
Github openshift console pull 11762 0 None open Bug 2096350: fix bug where Cluster update modal errors weren't displa… 2022-06-24 15:26:48 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:18:04 UTC

Description Will Gordon 2022-06-13 15:17:37 UTC
Description of problem:
The web console does not display the reported error messages from a webhook denial when trying to update the cluster version using the modal interface.

Version-Release number of selected component (if applicable): 
4.9.23 (first noticed, possibly earlier versions)

How reproducible: 

Steps to Reproduce:
1. Create webhook to block changes the "clusterversions" (https://github.com/openshift/managed-cluster-validating-webhooks/blob/master/build/selectorsyncset.yaml#L307-L318)
2. Attempt to update cluster from web console update modal (/settings/cluster)

Actual results:
No visual indication of failure; only a 403 error message in the browser's Developer Console

Expected results:
Report and show an error message in the web console update modal

Additional info:
This is a big UX issue for managed OSD/ROSA clusters. This is a regression from previous functionality (the update cluster UI used to show the webhook failure message)

Comment 2 Robb Hamilton 2022-06-22 12:28:43 UTC
> This is a regression from previous functionality (the update cluster UI used to show the webhook failure message).

To my knowledge and review of the code, the Cluster Settings page has never displayed a webhook failure message.  The alerts for 4.9 are visible at https://github.com/openshift/console/blob/42f3a0ca9d6e1a33a7e86b09ead80483b9b631e2/frontend/public/components/cluster-settings/cluster-settings.tsx#L885-L906.  Can you provide more detail on this previous functionality?

If this is not a regression, this should be converted to an RFE by 

* creating an issue of Feature Request Type and User Interface Component in https://issues.redhat.com/projects/RFE
* closing this bug with the link to the new Jira RFE issue


Comment 3 Will Gordon 2022-06-24 13:40:07 UTC
On a 4.5.11 cluster, I was able to get the expected webhook error message. On more recent versions (as recent as 4.7) this no longer seems to be the case. This is a huge usability regression. I don't have the time to validate the number of expected things on each OCP version, so clearly this is something that was lost along the way, but needs to be restored.

Please refer to my attached screenshot

Comment 4 Will Gordon 2022-06-24 13:41:00 UTC
Created attachment 1892465 [details]
Screenshot of expected webhook error message

Comment 5 Robb Hamilton 2022-06-24 14:11:44 UTC
Thanks for the screenshot!  That is very helpful to know where the error was displaying (in the modal and not at the top of the Cluster Settings page).

Comment 8 Robb Hamilton 2022-07-05 12:07:15 UTC
Ya Dan, given the severity and need to back port all the way to 4.7, can you please prioritize this bug for verification?  Thanks!

Comment 11 Yadan Pei 2022-07-06 06:07:18 UTC
Created attachment 1894837 [details]
screenshot of error

1. build a local console, hard code `desiredRecommendedUpdate` variable in /frontend/public/components/modals/cluster-update-modal.tsx to some string(invalid type)

const desiredRecommendedUpdate = "teststring";

2. in 'Update cluster' modal, when we choose one recommended version and hit 'Update' button, we can see inline errors

Danger alert:An error occurred
Error "Invalid value: "string": spec.desiredUpdate in body must be of type object: "string"" for field "spec.desiredUpdate".

in javascript console, we can also see errors
handlePromise failed in component : HttpError: Error "Invalid value: "string": spec.desiredUpdate in body must be of type object: "string"" for field "spec.desiredUpdate".

the issue is fixed, however the bug can not be moved to VERIFIED since no nightly build contains the fix PR yet

Comment 12 Robb Hamilton 2022-07-07 14:29:49 UTC
Changing the release target to 4.11.z since this fix was merged to master but did yet make it to release-4.11.

Comment 13 Robb Hamilton 2022-07-07 14:46:17 UTC
Whoops.  Should have changed the release target to 4.12.0.  Fixed.

Comment 14 Robb Hamilton 2022-07-07 14:57:39 UTC
Ya Dan, you should be able to verify against a 4.12 build since the fix snuck in right after 4.11 code freeze.  I've opened a https://bugzilla.redhat.com/show_bug.cgi?id=2104951 to cover back porting to 4.11.z.

Comment 15 Yadan Pei 2022-07-08 01:27:05 UTC
$ oc adm release info registry.ci.openshift.org/ocp/release:4.12.0-0.nightly-2022-07-07-144231 --pullspecs | grep console
  console                                        quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:f7892259292b0a490dd62684befdda835695720cdadb203f440cf357d700120a
  console-operator                               quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:9aa22923ef9693c614e9ab4c87594628d10af8cdbd7b90490b26dfe63a1a196b
$ oc image info quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:f7892259292b0a490dd62684befdda835695720cdadb203f440cf357d700120a | grep commit
$ git log 3cdfe94d26cac8345eab1b9a24f77a8c4ad90a8c | grep '#11762'
    Merge pull request #11762 from rhamilto/bz2096350

fix PR is included in 4.12.0-0.nightly-2022-07-07-144231

Comment 16 errata-xmlrpc 2022-08-10 11:17:47 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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.


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