Hello Team,We are currently in the process of upgrading the version in one of our test environments from Keycloak V19.0.3 to V21.1.2. However, during the server startup, we are encountering the following error repeatedly, causing the pods to enter into an error crash mode. Could you please suggest a solution to resolve this issue?
024-01-29 14:50:04,471 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000094: Received new cluster view for channel ISPN: [auth-provider-service-sandbox-keycloakx-0-123|0] (1) [auth-provider-service-sandbox-keycloakx-0-123]
2024-01-29 14:50:04,674 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000079: Channel `ISPN` local address is `auth-provider-service-sandbox-keycloakx-0-123`, physical addresses are `[172.21.44.123:7800]`
2024-01-29 14:50:14,669 INFO [org.keycloak.quarkus.runtime.storage.legacy.liquibase.QuarkusJpaUpdaterProvider] (main) Updating database. Using changelog META-INF/jpa-changelog-master.xml
2024-01-29 14:50:18,867 INFO [org.infinispan.CLUSTER] (main) ISPN000080: Disconnecting JGroups channel `ISPN`
2024-01-29 14:50:19,275 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2024-01-29 14:50:19,276 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to update database
2024-01-29 14:50:19,277 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: liquibase.exception.MigrationFailedException: Migration failed for changeset META-INF/jpa-changelog-21.1.0.xml::21.1.0-19404::keycloak:
Reason: liquibase.exception.DatabaseException: ERROR: default for column "decision_strategy" cannot be cast automatically to type smallint [Failed SQL: (0) ALTER TABLE public.RESOURCE_SERVER_POLICY ALTER COLUMN DECISION_STRATEGY TYPE SMALLINT USING (DECISION_STRATEGY::SMALLINT)]
2024-01-29 14:50:19,278 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Migration failed for changeset META-INF/jpa-changelog-21.1.0.xml::21.1.0-19404::keycloak:
Reason: liquibase.exception.DatabaseException: ERROR: default for column "decision_strategy" cannot be cast automatically to type smallint [Failed SQL: (0) ALTER TABLE public.RESOURCE_SERVER_POLICY ALTER COLUMN DECISION_STRATEGY TYPE SMALLINT USING (DECISION_STRATEGY::SMALLINT)]
2024-01-29 14:50:19,278 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: ERROR: default for column "decision_strategy" cannot be cast automatically to type smallint [Failed SQL: (0) ALTER TABLE public.RESOURCE_SERVER_POLICY ALTER COLUMN DECISION_STRATEGY TYPE SMALLINT USING (DECISION_STRATEGY::SMALLINT)]
2024-01-29 14:50:19,279 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: ERROR: default for column "decision_strategy" cannot be cast automatically to type smallint
2024-01-29 14:50:19,365 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.