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

Keycloak 26.2.0 can't authenticate to the H2 database after the upgrade [GHI#39046]

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

      core

      Describe the bug

      After upgrading Keycloak from 26.1.4 to 26.2.0 in Kubernetes, Keycloak can't connect to the internal H2 database. This results in a Keycloak Pod crash with the following error:

      {"timestamp":"2025-04-17T08:21:47.788621506Z","sequence":13159,"loggerClassName":"org.jboss.logging.Logger","loggerName":"org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler","level":"ERROR","message":"ERROR: Failed to start server in (development) mode","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"keycloak-0","processName":"/usr/lib/jvm/java-21-openjdk-21.0.6.0.7-1.el9.aarch64/bin/java","processId":1}
      {"timestamp":"2025-04-17T08:21:47.788686923Z","sequence":13160,"loggerClassName":"org.jboss.logging.Logger","loggerName":"org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler","level":"ERROR","message":"ERROR: Failed to obtain JDBC connection","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"keycloak-0","processName":"/usr/lib/jvm/java-21-openjdk-21.0.6.0.7-1.el9.aarch64/bin/java","processId":1}
      {"timestamp":"2025-04-17T08:21:47.788710673Z","sequence":13161,"loggerClassName":"org.jboss.logging.Logger","loggerName":"org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler","level":"ERROR","message":"ERROR: Wrong user name or password [28000-230]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"keycloak-0","processName":"/usr/lib/jvm/java-21-openjdk-21.0.6.0.7-1.el9.aarch64/bin/java","processId":1}
      

      The error has been noticed during a regular UDS Platform component upgrade: https://github.com/defenseunicorns/uds-core/pull/1452

      In our testing setup, Keycloak is bootstrapped with the following parameters (that are relevant to this case):

      - start-dev
      - --spi-theme-static-max-age=-1
      - --spi-theme-cache-themes=false                                                                                                                                                                                                                                                                                                                                   - --spi-theme-cache-templates=false                                                                                                                                                                                                                                                                                                                                - --import-realm                                                                                                                                                                                                                                                                                                                                                   - --features=preview
      

      Here are some other links that you may find useful:

      • Unpack and find Keycloak Pod Logs

      Version

      26.2.0

      Regression

      [x] The issue is a regression

      Expected behavior

      The upgraded Keycloak should boot up without any problems

      Actual behavior

      The upgraded Keycloak instances crashes

      How to Reproduce?

      The stable reproducer might be found in the UDS Platform. In order to run it, please follow:

      1. Follow https://uds.defenseunicorns.com/getting-started/basic-requirements/
      2. Follow https://uds.defenseunicorns.com/getting-started/install-and-deploy-uds/
      3. Clone the https://github.com/defenseunicorns/uds-core/pull/1452
      4. Run uds run test-uds-core-upgrade --set FLAVOR=upstream --no-progress

      Alternatively, you may try to spin up a container with - start-dev and version 26.1.. Once it's running, just upgrade it to 26.2.0.

      Anything else?

      No response

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

                Created:
                Updated:
                Resolved: