Description of problem: When a "main" status (status descriptor with displayName "Status" or path "status") points to a value that cannot be rendered as a React child, it causes a runtime exception on the details page. Version-Release number of selected component (if applicable): 4.7 How reproducible: Always Steps to Reproduce: 1. Create resources in this gist: https://gist.github.com/TheRealJon/3680c8a573bde88a974588e269230562 2. Navigate to the details page of the MockResource instance that was just created. Actual results: A runtime exception occurs. Expected results: The edge case should be handled and the page should render normally. Additional info: A status descriptor with displayName "Status" or path "status" is considered the "main" status descriptor. The "main" status is the field labeled "Status" that is always rendered at the top of the details page. The data this descriptor points to is arbitrary (we don't do any validation), and we pass it directly on to the Status component through the "status" prop. The Status component then attempts to render the status prop directly as a child of a React.Fragment. This causes an exception if the status prop is not renderable as a React.child. The bug surfaced because one of ACM's custom resource's "main" status descriptor points to an object, which caused an exception (Object is not a valid React child). The problem is two-fold. The Status component should handle the edge case where the status prop is not a valid React child, and the status descriptor API should also handle the case where the main status descriptor points to something other than a primitive value.
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