-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
RH-SSO-7.6.6
-
False
-
None
-
False
-
-
When attempting to add a Realm Group that already exists, the following Exception is displayed in the logs when using an Oracle Database:
"@timestamp": "<TIMESTAMP>", "sequence": <SEQUENCE>, "loggerClassName": "org.jboss.logging.DelegatingBasicLogger", "loggerName": "org.hibernate.engine.jdbc.spi.SqlExceptionHelper", "level": "ERROR", "message": "ORA-00001: unique constraint (KEYCLOAK.SIBLING_NAMES) violated\n", "threadName": "default task-XYZ", "threadId": <ID>, "mdc": {}, "ndc": "", "hostName": "<HOSTNAME>", "processName": "jboss-modules.jar", "processId": <ID>, "@version": "1"
The same could be reproduced in PostgreSQL:
WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-2) SQL Error: 0, SQLState: 23505 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-2) ERROR: duplicate key value violates unique constraint "sibling_names" Detail: Key (realm_id, parent_group, name)=(<REALM ID>, , <NAME>) already exists.
Current behavior: Attempt to insert the Realm Group. If a Database level Exception happens, state that the Group already exists.
Expected behavior: Check whether the Realm Group exists before attempting to insert it in order to prevent Exceptions in the logs.