I have updated Keycloak to v26.0.5 and I am getting this error when Keycloak is try to bootstrap realms:
java.lang.IllegalArgumentException: Session not bound to a realm
Look like realm is imported but then I am getting the error in this class:
InfinispanIdentityProviderStorageProvider
private RealmModel getRealm() {
**RealmModel realm = this.session.getContext().getRealm();**
if (realm == null) {
**throw new IllegalArgumentException("Session not bound to a realm");**
} else {
return realm;
}
}
my Dockerfile:
FROM quay.io/keycloak/keycloak:26.0.5 AS builder
WORKDIR /opt/keycloak
COPY /build/libs/platserv-keycloak*.jar /opt/keycloak/providers
COPY /config/realms /opt/keycloak/data/import
FROM quay.io/keycloak/keycloak:26.0.5
COPY --from=builder --chown=keycloak:root /opt/keycloak/ /opt/keycloak/
... other ENV vars ...
ENV JAVA_OPTS_APPEND="-Dkeycloak.migration.replace-placeholders=true -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=/opt/keycloak/data/import -Dkeycloak.migration.strategy=OVERWRITE_EXISTING"
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
CMD ["start", "--verbose"]
Any idea?