Error upgrading to Keycloak 22.0.0 but 21.1.2 works fine

352 Views Asked by At

I am trying to upgrade to Keycloak 22.0.0 from version 20.0.0 using the Quay.io image and I get the following error:

Exception in thread "main" java.lang.reflect.InvocationTargetException...Caused by: java.lang.NoSuchFieldError: FIPS

My assumption is that Keycloak 22.0.0 added/removed/changed some FIPS settings and now it's breaking. My Dockerfile looks like this:

FROM quay.io/keycloak/keycloak:22.0.0
COPY ./event-listener-http-jar-with-dependencies.jar /opt/keycloak/providers/
RUN /opt/keycloak/bin/kc.sh build --db=mysql
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start --proxy=edge --hostname-strict=false --db-username=${DB_USERNAME} --db-password=${DB_PASSWORD} --spi-events-listener-http-server-uri=https://authserver.com/api/endpoint"]

That custom event listener jar is from this Repo here (https://github.com/darrensapalo/keycloak-event-listener-http/blob/master/pom.xml) and hasn't been updated in a while, but even updating the pom.xml there to the latest Keycloak version doesn't help. What else can I try?

1

There are 1 best solutions below

0
Hatokirai On

Having exact same problem. In my case I tried to fix by modifying pom file like this (adding provided scope):

        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-core</artifactId>
            <scope>provided</scope>
            <version>${version.keycloak}</version>
        </dependency>

And for okhttp added compile scope:

        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <scope>compile</scope>
            <version>4.3.1</version>
        </dependency>

And then it result in about 2.7MB jar file with dependencies. Final result event sent (image)