Bug 1883563 - Creating duplicate namespace from create namespace modal breaks the UI
Summary: Creating duplicate namespace from create namespace modal breaks the UI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.7.0
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-29 15:09 UTC by Harish Govindarajulu
Modified: 2021-02-24 15:21 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Create a namespace that already exists on the cluster. Consequence: Unhandled promise rejection error. Fix: Add error handler when creating projects. Result: Creating duplicate project wont cause unhandled promise rejection error.
Clone Of:
Environment:
Last Closed: 2021-02-24 15:21:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
broken UI (24.59 KB, image/png)
2020-09-29 15:09 UTC, Harish Govindarajulu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 6818 0 None closed Bug 1883563: Handle promise rejection error 2021-02-17 21:05:00 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:21:38 UTC

Description Harish Govindarajulu 2020-09-29 15:09:08 UTC
Created attachment 1717569 [details]
broken UI

Created attachment 1717569 [details]
broken UI

Description of problem:
Creating duplicate namespace breaks the UI. The issue only occurs in a dev environment (and not in production env). In both cases, however, the console log shows:
- a 409 conflict for HTTP POST
- Unhandled promise rejection error 

Steps: 
1. Login to the OCP console UI 
2. In Adminitrator perspective, navigate to Administration -> Namespaces page. 
3. Create a namespace that already exists in the system. 

Actual Results:
Shows the error: "namespaces <duplicate namespace> already exists" but the UI breaks with following call stack :

rejectionHandler
  vendors~main-f992bf47c06fae930750.js:230383:21


Version-Release number of selected component (if applicable):
4.6

How reproducible:
Always

Comment 1 Samuel Padgett 2020-09-29 16:37:03 UTC
This is the overlay from the Webpack dev server on an unhandled promise rejection. You'd only ever see this in development mode, but we should probably handled the failed promise. I thought we found all the dialogs in https://github.com/openshift/console/pull/6048, but we might have missed one.

Comment 2 Jon Jackson 2020-09-29 19:33:33 UTC
Yeah, I saw that this was dev mode only. I asked Harish to update the description to add that distinction. We do still get a console error about an uncaught promise rejection, so I thought this might be a good low severity bug for Harish to look into.

Comment 3 Samuel Padgett 2020-09-29 19:42:07 UTC
Yeah, I think it's something we want to address. Better to explicitly handle failed promises even if it's not a user-visible bug.

Comment 5 Yadan Pei 2020-10-26 05:48:05 UTC
Steps: 
1. Pull latest console code, follow steps in https://github.com/openshift/console#build-everything and https://github.com/openshift/console#openshift-no-authentication, bridge to a 4.7 cluster
2. visit OCP console UI at localhost:9000
3. In Adminitrator perspective, navigate to Administration -> Namespaces page. 
4. Create a namespace that already exists in the system, we can see js errors in browser console

POST http://localhost:9000/api/kubernetes/api/v1/namespaces 409 (Conflict)
coFetch @ co-fetch.js:112
(anonymous) @ co-fetch.js:151
(anonymous) @ ui.ts:413
push../public/co-fetch.js.__awaiter @ ui.ts:413
coFetchCommon @ co-fetch.js:147
coFetchJSON @ co-fetch.js:162
coFetchSendJSON @ co-fetch.js:181
push../public/co-fetch.js.coFetchJSON.post @ co-fetch.js:189
k8sCreate @ resource.js:64
createNamespace @ create-namespace-modal.jsx:54
_submit @ create-namespace-modal.jsx:79
callCallback @ react-dom.development.js:347
invokeGuardedCallbackDev @ react-dom.development.js:397
invokeGuardedCallback @ react-dom.development.js:454
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:468
executeDispatch @ react-dom.development.js:600
executeDispatchesInOrder @ react-dom.development.js:622
executeDispatchesAndRelease @ react-dom.development.js:725
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:733
forEachAccumulated @ react-dom.development.js:707
runEventsInBatch @ react-dom.development.js:750
runExtractedPluginEventsInBatch @ react-dom.development.js:881
handleTopLevel @ react-dom.development.js:5901
batchedEventUpdates @ react-dom.development.js:2344
dispatchEventForPluginEventSystem @ react-dom.development.js:5996
dispatchEvent @ react-dom.development.js:6025
unstable_runWithPriority @ scheduler.development.js:643
runWithPriority$2 @ react-dom.development.js:11305
discreteUpdates$1 @ react-dom.development.js:21672
discreteUpdates @ react-dom.development.js:2359
dispatchDiscreteEvent @ react-dom.development.js:5979
react_devtools_backend.js:2450 

Failed to create namespace: namespaces "yapei47" already exists
overrideMethod @ react_devtools_backend.js:2450
(anonymous) @ create-namespace-modal.jsx:102
Promise.catch (async)
_submit @ create-namespace-modal.jsx:98
callCallback @ react-dom.development.js:347
invokeGuardedCallbackDev @ react-dom.development.js:397
invokeGuardedCallback @ react-dom.development.js:454
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:468
executeDispatch @ react-dom.development.js:600
executeDispatchesInOrder @ react-dom.development.js:622
executeDispatchesAndRelease @ react-dom.development.js:725
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:733
forEachAccumulated @ react-dom.development.js:707
runEventsInBatch @ react-dom.development.js:750
runExtractedPluginEventsInBatch @ react-dom.development.js:881
handleTopLevel @ react-dom.development.js:5901
batchedEventUpdates @ react-dom.development.js:2344
dispatchEventForPluginEventSystem @ react-dom.development.js:5996
dispatchEvent @ react-dom.development.js:6025
unstable_runWithPriority @ scheduler.development.js:643
runWithPriority$2 @ react-dom.development.js:11305
discreteUpdates$1 @ react-dom.development.js:21672
discreteUpdates @ react-dom.development.js:2359
dispatchDiscreteEvent @ react-dom.development.js:5979

But console does not crash, moving to VERIFIED

Comment 9 errata-xmlrpc 2021-02-24 15:21:17 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633


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