Bug 2051558

Summary: RoleBinding in project without subject is causing "Project access" page to fail
Product: OpenShift Container Platform Reporter: Simon Reber <sreber>
Component: Dev ConsoleAssignee: Debsmita Santra <dsantra>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: dsantra, nmukherj, viraj
Target Milestone: ---Flags: dsantra: needinfo-
Target Release: 4.11.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The subject name is considered mandatory while creating a rolebinding using the create role binding form, but seems like the user can create one without the above property through yaml. Consequence: The Project Access page fails to load Fix: Since the value displayed under the Name column in the project access page is the subject name mentioned in the role binding CR so the role binding without this property is not listed on the project access page. Result: The role binding without the subject name property is not listed on the project access page.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:47:50 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:
Bug Depends On:    
Bug Blocks: 2054154    

Description Simon Reber 2022-02-07 13:46:47 UTC
Description of problem:

When creating a RoleBinding without a Subject in a OpenShift Container Platform 4 - Project, the "Project access" page (project-details/ns/<project>/access) in the Developer Console is failing to load.

Error reported as following:

TypeError

Description:
Cannot read properties of undefined (reading 'user')

Component trace:

at t.a (https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:5176)
    at M (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:16702)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:1498)
    at m.memo.t.children.e.children.t.reduxes.e.reduxes.t.reduxes.every.reduxID (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:539896)
    at O (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:118:78241)
    at <anonymous> (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:541565)
    at O (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:118:78241)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:152)
    at o (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:215915)
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:255755)
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:257798)
    at Suspense
    at div
    at O (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:157316)
    at _ (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:157764)
    at div
    at https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:863078
    at m.memo.t.children.e.children.t.reduxes.e.reduxes.t.reduxes.every.reduxID (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:539896)
    at O (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:118:78241)
    at <anonymous> (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:541565)
    at O (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:118:78241)
    at https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1031743
    at o (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:215915)
    at DetailsPage
    at h (https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:15679)
    at https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:454842
    at O (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:118:78241)
    at div
    at div
    at t.b (https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:38551)
    at y (https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:16747)
    at c (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:260021)
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:255755)
    at w
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:257798)
    at Suspense
    at div
    at div
    at section
    at p (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:226:173166)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1490681)
    at div
    at div
    at c (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:221:349494)
    at u (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:178:113496)
    at div
    at u (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:78:22923)
    at l (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1191549)
    at https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:514595
    at O (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:118:78241)
    at main
    at div
    at y (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:117:39676)
    at div
    at div
    at c (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:226:169644)
    at div
    at div
    at c (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:221:349494)
    at u (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:178:113496)
    at div
    at u (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:78:22923)
    at fn (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:164502)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1016445)
    at t.default (https://console-openshift-console.apps.ocp.example.com/static/quick-start-chunk-04ba246cbf4014337b2e.min.js:1:1214)
    at c (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:260021)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1569838)
    at z (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1571301)
    at Qe (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:128411)
    at z (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1571301)
    at z (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1571301)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1566834)
    at l (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1564188)
    at Q (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1571431)
    at https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1574147
    at r (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:179:423511)
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:255755)
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:257798)
    at t (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:42:252362)
    at Z (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1574428)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:837510)
    at t.a (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:179:413864)
    at Suspense

Stack trace:

TypeError: Cannot read properties of undefined (reading 'user')
    at https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1030293
    at Array.map (<anonymous>)
    at d (https://console-openshift-console.apps.ocp.example.com/static/main-chunk-1f54cb223a8d2a70b2c4.min.js:1:1030277)
    at https://console-openshift-console.apps.ocp.example.com/static/dev-console-projectDetails-chunk-749403755285da9bc7e2.min.js:1:5377
    at Ic (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:249:104463)
    at t.unstable_runWithPriority (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:257:3766)
    at zi (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:249:44553)
    at Oc (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:249:103930)
    at lc (https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:249:95232)
    at https://console-openshift-console.apps.ocp.example.com/static/vendors~main-chunk-06305bb3ecd0f117e7d6.min.js:249:44775

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

 - OpenShift Container Platform 4.9.15

How reproducible:

 - Always

Steps to Reproduce:
1. Create a project using `oc new-project test`
2. Create `RoleBinding` like below using `oc create ...`:

$ cat /tmp/rb.yaml 
{
    "apiVersion": "rbac.authorization.k8s.io/v1",
    "kind": "RoleBinding",
    "metadata": {
        "name": "admin-test",
        "namespace": "test"
    },
    "roleRef": {
        "apiGroup": "rbac.authorization.k8s.io",
        "kind": "ClusterRole",
        "name": "admin"
    }
}

3. Access "project-details/ns/<project>/access" Page in Developer View with Project admin

Actual results:

Error reported as shown above

Expected results:

No error reported or at least loading the page and showing the `Rolebinding` as sort of being problematic because there is no subject

Additional info:

Comment 5 Vikram Raj 2022-02-17 13:46:38 UTC
Verified it on 4.11.0-0.nightly-2022-02-16-131355. And it's working fine.

Comment 8 errata-xmlrpc 2022-08-10 10:47:50 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.

https://access.redhat.com/errata/RHSA-2022:5069