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

import does not seem to run db migration [GHI#43793]

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

      import-export

      Describe the bug

      We are using keycloak container, and what we do is to always run import to initalise master realm with some settings.

      opt/keycloak/bin/kc.sh import --override=false

      Then we do start using the start command

      With latest version, we encountered this :

      2025-10-28 18:29:10,327 INFO  [org.keycloak.url.HostnameV2ProviderFactory] (main) If hostname is specified, hostname-strict is effectively ignored
      2025-10-28 18:29:35,018 INFO  [org.hibernate.orm.jdbc.batch] (JPA Startup Thread) HHH100501: Automatic JDBC statement batching enabled (maximum batch size 32)
      2025-10-28 18:29:46,299 INFO  [com.arjuna.ats.jbossatx] (main) ARJUNA032014: Stopping transaction recovery manager
      2025-10-28 18:29:46,620 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (nonserver) mode
      2025-10-28 18:29:46,620 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Database not up-to-date, please enable database migration
      2025-10-28 18:29:46,624 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.
      

      Version

      26.4.2

      Regression

      [x] The issue is a regression

      Expected behavior

      I would expect the import command to run database migration before doing the import.

      Actual behavior

      Database migration is not done when launching import, even with {{ --spi-connections-jpa-quarkus-migration-strategy=update}}

      How to Reproduce?

      1- Setup keycloak on a previous version
      2- Keep the database
      3- Change the version and run import, before starting the server

      Anything else?

      I'm pretty sure this was working before, we are using keycloak since version 24.0.5, and I don't think we ever had any issues with db upgrade.

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

                Created:
                Updated:
                Resolved: