Uploaded image for project: 'RH-SSO'
  1. RH-SSO
  2. RHSSO-2889

RH SSO should verify whether a Realm Group already exists before attempting to insert it in the Database

XMLWordPrintable

    • 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.

              pskopek@redhat.com Peter Skopek
              rhn-support-ekonecsn Estevao Konecsni
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: