eclipse-tractusx / portal

Portal - Helm charts
Apache License 2.0
7 stars 16 forks source link

Technical Roles Not Available #410

Open anjuchaurasiya opened 3 months ago

anjuchaurasiya commented 3 months ago

Some of the technical roles are not present to use from the portal. How to remove them from portal:

ERROR:

[10:59:50 ERR] Not Found: https://example.com/auth/admin/realms/CX-Central/clients/6df310ed-500e-43d5-b510-fa4668e939ee/roles/BPDM Management {"Timestamp":"2024-07-18T10:59:50.2931620+00:00","Level":"Error","MessageTemplate":"{Message}","RenderedMessage":"\"Not Found: https://example.com/auth/admin/realms/CX-Central/clients/6df310ed-500e-43d5-b510-fa4668e939ee/roles/BPDM Management\"","TraceId":"677d55072282dda91034f7fbc76074a9","SpanId":"cb0d317a3640440c","Exception":"Flurl.Http.FlurlHttpException: Call failed with status code 404 (Not Found): GET https://example.com/auth/admin/realms/CX-Central/clients/6df310ed-500e-43d5-b510-fa4668e939ee/roles/BPDM%20Management\n at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)","Properties":{"Message":"Not Found: https://example.com/auth/admin/realms/CX-Central/clients/6df310ed-500e-43d5-b510-fa4668e939ee/roles/BPDM Management","SourceContext":"Program","ActionId":"3408e758-3328-4a50-977c-b22d7d1938c8","ActionName":"Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Controllers.ServiceAccountController.ExecuteCompanyUserCreation (Org.Eclipse.TractusX.Portal.Backend.Administration.Service)","RequestId":"0HN51K4IVFB8A:00000001","RequestPath":"/api/administration/serviceaccount/owncompany/serviceaccounts","ConnectionId":"0HN51K4IVFB8A","CorrelationId":"a884cff9238960fae20bc085f2a66b8a","Application":"Org.Eclipse.TractusX.Portal.Backend.Administration.Service"}} [10:59:50 ERR] GeneralErrorHandler caught KeycloakNoSuccessException with errorId: 68965ebf-1869-44bc-abcf-163357978ce5 resulting in response status code 500, message 'inconsistend data. roles were not assigned in keycloak: client: technical_roles_management, roles: [BPDM Management], error: '

Available roles: https://github.com/eclipse-tractusx/portal-iam/blob/centralidp-3.0.0/import/realm-config/generic/catenax-central/CX-Central-realm.json

Current Behavior

Failing to create technical user with some specific roles

Expected Behavior

Portal should not show the invalid roles

Steps To Reproduce

Centralidp: 3.0.0 Portal: 2.0.0 bpdm: 5.0.2

image-2024-7-22_20-32-22
evegufy commented 3 months ago

This role (BPDM Management) has actually been removed in preparation for the 2.0.0 version see https://github.com/eclipse-tractusx/portal-backend/commit/07832c1fbad581200b2d32675c37cba3be08cf87 Could you please check if the portal migrations job was executed when upgrading to 2.0.0 version?

anjuchaurasiya commented 3 months ago

These migration jobs were completed successfully:

k get pods|grep migration portaldev-portal-migrations-lkwhq 0/1 Completed 0 4d1h portaldev-provisioning-migrations-ttpn2 0/1 Completed 0 4d1h

[04:31:18 INF] Found 2 custom seeder {"Timestamp":"2024-08-09T04:31:18.8026412+00:00","Level":"Information","MessageTemplate":"Found {SeederCount} custom seeder","RenderedMessage":"Found 2 custom seeder","Properties":{"SeederCount":2,"SourceContext":"Org.Eclipse.TractusX.Portal.Backend.Framework.Seeding.CustomSeederRunner","MachineName":"portaldev-portal-migrations-lkwhq","ProcessId":1,"ThreadId":7,"Application":"Org.Eclipse.TractusX.Portal.Backend.PortalBackend.Migrations"}} [04:32:45 INF] Custom seeding finished {"Timestamp":"2024-08-09T04:32:45.9538504+00:00","Level":"Information","MessageTemplate":"Custom seeding finished","RenderedMessage":"Custom seeding finished","Properties":{"SourceContext":"Org.Eclipse.TractusX.Portal.Backend.Framework.Seeding.DbSeeder","MachineName":"portaldev-portal-migrations-lkwhq","ProcessId":1,"ThreadId":7,"Application":"Org.Eclipse.TractusX.Portal.Backend.PortalBackend.Migrations"}} [04:32:46 INF] Process Shutting down... {"Timestamp":"2024-08-09T04:32:46.0721849+00:00","Level":"Information","MessageTemplate":"Process Shutting down...","RenderedMessage":"Process Shutting down...","Properties":{"MachineName":"portaldev-portal-migrations-lkwhq","ProcessId":1,"ThreadId":7,"Application":"Org.Eclipse.TractusX.Portal.Backend.PortalBackend.Migrations"}}

evegufy commented 3 months ago

@anjuchaurasiya so the new roles are also available in your environment?

anjuchaurasiya commented 3 months ago

@evegufy yes, all these new roles are also present:

user_option
evegufy commented 3 months ago

thanks for the feedback! @Phil91 do you have an idea, how the roles can be still there when they were removed with https://github.com/eclipse-tractusx/portal-backend/commit/07832c1fbad581200b2d32675c37cba3be08cf87 and the migration ran?

Phil91 commented 2 months ago

@evegufy sorry completely overlooked this issue.

I think since we don't have a delete seeder in place and I don't see a migration where the roles are removed this needs to be done manually.

@anjuchaurasiya fyi