Bug 1927941
| Summary: | StatusDescriptor detail item and Status component can cause runtime error when the status is an object or array | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Jon Jackson <jonjacks> |
| Component: | Management Console | Assignee: | Jon Jackson <jonjacks> |
| Status: | CLOSED ERRATA | QA Contact: | Yadan Pei <yapei> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.7 | CC: | aos-bugs, jokerman, yapei |
| Target Milestone: | --- | ||
| Target Release: | 4.8.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: OLM descriptors were not validated against the data type of the field they applied to.
Consequence: A descriptor could be applied to a field with an incorrect data type, which could cause runtime errors in some cases.
Fix: Update descriptor logic to validate all descriptors against the schema before attempting to render them, and log warnings for incompatible descriptors.
Result: Invalid descriptors are not rendered and won't cause runtime errors or unexpected behavior.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-07-27 22:44:18 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
Jon Jackson
2021-02-11 21:54:05 UTC
Working through PR CI failures. Jon, I can still reproduce the issue following steps in `Steps to Reproduce` even on a cluster which includes fix PR
=== Cluster 4.8.0-0.nightly-2021-03-08-133419 includes fix PR
# oc get clusterversion
NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
version 4.8.0-0.nightly-2021-03-08-133419 True False 3h23m Cluster version is 4.8.0-0.nightly-2021-03-08-133419
# oc get pod console-7b7647c799-zrpn2 -n openshift-console -o yaml | grep image
.....
image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:170424fa84ff1c18d4c784f8cf207414de9697696e1f88f931c0d9c3415fa716
# oc image info quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:170424fa84ff1c18d4c784f8cf207414de9697696e1f88f931c0d9c3415fa716 | grep commit
io.openshift.build.commit.id=f4a98b081a6cded689c4b3126a59599a9a917a76
io.openshift.build.commit.url=https://github.com/openshift/console/commit/f4a98b081a6cded689c4b3126a59599a9a917a76
# [root@preserved-qe-ui-rhel-1 console]# git log f4a98b081a6cded689c4b3126a59599a9a917a76 | grep '#8145'
Merge pull request #8145 from TheRealJon/1927941
I can see following error:
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bstatus1%2C%20status2%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
$i vendors~main-chunk-b8279920a8a40fbe70f4.min.js:170861
Ki vendors~main-chunk-b8279920a8a40fbe70f4.min.js:170861
la vendors~main-chunk-b8279920a8a40fbe70f4.min.js:170861
Ys vendors~main-chunk-b8279920a8a40fbe70f4.min.js:170861
Bs vendors~main-chunk-b8279920a8a40fbe70f4.min.js:170861
Fs vendors~main-chunk-b8279920a8a40fbe70f4.min.js:170861
Assigning back for further debugging
Ah, yes. So, we changed directions a bit with this bug. Instead of handling the exception in the Status component, we let it throw, catch it in the error boundary around the descriptor component, log a warning in the console, and don't render the related item on the details page. So you will still see the exception in the browser console, but we also added a warning: "`[Invalid StatusDescriptor] Descriptor is incompatible with non-primitive value." which is the only new behavior added by this fix. This way we allow the incorrect configuration to fail as it should, and give the operator author/user more info for troubleshooting. Thank you Jon for your explanation.
Yes, I tried again and everything is working as intended.
We can see a warning message : [Invalid StatusDescriptor] Descriptor is incompatible with non-primitive value. {description: "Invalid main status", displayName: "Status", path: "statuses"} along with the error message in browser console
Verified on 4.8.0-0.nightly-2021-03-14-134919
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 (Moderate: OpenShift Container Platform 4.8.2 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. https://access.redhat.com/errata/RHSA-2021:2438 |