Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-3325

Default jdbc-ping cluster setup for distributed caches fails in Oracle [GHI#40784]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

      Area

      infinispan

      Describe the bug

      Running Keycloak using default jdbc-ping cluster setup for distributed caches fails in Oracle.

      Version

      26.2.5

      Regression

      [ ] The issue is a regression

      Expected behavior

      Default jdbc-ping cluster setup works. No errors shown on logs.

      Actual behavior

      Logs keep printing error reading table JDBC_PING.
      ERROR [org.keycloak.quarkus.runtime.storage.infinispan.jgroups.impl.KEYCLOAK_JDBC_PING2] (main) 0f387c618b43-48282: failed reading from the DB: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

      How to Reproduce?

      Download drivers:

      mkdir drivers
      curl https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc17/23.6.0.24.10/ojdbc17-23.6.0.24.10.jar --output drivers/ojdbc17.jar
      curl https://repo1.maven.org/maven2/com/oracle/database/nls/orai18n/23.6.0.24.10/orai18n-23.6.0.24.10.jar --output $SCRIPTPATH/../drivers/orai18n.jar
      

      Create Dockerfile:

      FROM quay.io/keycloak/keycloak:26.2.5
      ENV KC_DB=oracle
      COPY --chown=keycloak:keycloak --chmod=644 drivers/*.jar /opt/keycloak/providers/
      WORKDIR /opt/keycloak
      RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "CN=server" -alias server -ext "SAN:c=DNS:localhost,IP:127.0.0.1" -keystore conf/server.keystore
      RUN /opt/keycloak/bin/kc.sh build
      ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]
      

      Build image:

      docker build . --tag my-keycloak
      

      Run Keycloak

      docker run -it --rm -p 8080:8080 -p 8443:8443 \
      -e KC_BOOTSTRAP_ADMIN_USERNAME=admin  \
      -e KC_BOOTSTRAP_ADMIN_PASSWORD=123 \
      -e KC_DB_URL_DATABASE=<db-name> \
      -e KC_DB_SCHEMA=<db-schema> \
      -e KC_DB_USERNAME=<db-username> \
      -e KC_DB_PASSWORD=<db-password> \
      -e KC_HOSTNAME_STRICT=false \
      -e KC_DB_URL_HOST=<db-host> \
      --name MyKeycloak \
      my-keycloak
      

      Anything else?

      Oracle server: AWS RDS Engine version 19.0.0.0.ru-2024-01.rur-2024-01.r1

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak SRE
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: