mitodl / ol-keycloak

Custom theme and extensions for Keycloak SSO
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Cannot invoke "org.keycloak.authentication.RequiredActionFactory.isConfigurable()" because "factory" is null #80

Open shaidar opened 1 month ago

shaidar commented 1 month ago

Expected Behavior

In Keycloak UI, under any realm, clicking on the Authentication tab should provide a list of workflows

Current Behavior

Call to required-actions throws a 400 error and the error in the UI is "Network response was not OK"

Steps to Reproduce

  1. Login to Keycloak CI UI
  2. Click on Authentication

Possible Solution

Additional Details

This happens with the new (version 25) of Keycloak which is what's running on CI. Running the containers in debug mode, reveals the following error: 2024-07-26 18:26:34,016 DEBUG [org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext] (executor-thread-7) Restarting handler chain for exception exception: com.fasterxml.jackson.databind.JsonMappingException: Cannot invoke "org.keycloak.authentication.RequiredActionFactory.isConfigurable()" because "factory" is null at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._wrapAsIOE(DefaultSerializerProvider.java:531) at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:504) at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341) at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1574) at com.fasterxml.jackson.databind.ObjectWriter._writeValueAndClose(ObjectWriter.java:1275) at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1098) at io.quarkus.resteasy.reactive.jackson.runtime.serialisers.FullyFeaturedServerJacksonMessageBodyWriter.writeResponse(FullyFeaturedServerJacksonMessageBodyWriter.java:79) at org.jboss.resteasy.reactive.server.core.ServerSerialisers.invokeWriter(ServerSerialisers.java:216) at org.jboss.resteasy.reactive.server.core.ServerSerialisers.invokeWriter(ServerSerialisers.java:184) at org.jboss.resteasy.reactive.server.core.serialization.FixedEntityWriter.write(FixedEntityWriter.java:28) at org.jboss.resteasy.reactive.server.handlers.ResponseWriterHandler.handle(ResponseWriterHandler.java:34) at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:147) at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147) at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29) at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.NullPointerException: Cannot invoke "org.keycloak.authentication.RequiredActionFactory.isConfigurable()" because "factory" is null at org.keycloak.admin.ui.rest.AuthenticationManagementResource.toRepresentation(AuthenticationManagementResource.java:148) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:601) at com.fasterxml.jackson.datatype.jdk8.StreamSerializer.serialize(StreamSerializer.java:71) at com.fasterxml.jackson.datatype.jdk8.StreamSerializer.serialize(StreamSerializer.java:15) at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502) ... 18 more

Looking at the changes introduced in the new version as it relates to the above error message, this snippet appears to be relevant. I built the CI instances without any other SPI's except for the current one and thus suspect that the error message is caused by this SPI.

shaidar commented 1 month ago

We have tried the following:

steffenmllr commented 2 weeks ago

@shaidar I ran into the same issue while updating keycloak - did you solve this?

shaidar commented 2 weeks ago

@steffenmllr Unfortunately I have not been able to resolve it. I will probably be spending more time on this closer to the end of the week and will update the issue accordingly. Somewhat glad that someone else ran into this as I was starting to think it was isolated to us, but apparently not. Please let me know if you come across any hints or answers to this issue.

steffenmllr commented 2 weeks ago

So here is what I know:

shaidar commented 1 week ago

Upgraded to v25.0.4 and ran trace logging hoping to possibly capture more information about the error, however was unable to collect any additional logs. It's still the same traceback initially logged.

shaidar commented 1 week ago

Posted a discussions post in google groups about this and opened an issue on the Keycloak repo

shaidar commented 3 days ago

Tried running the Keycloak nightly build to test out the merged fix however the build fails to load the console login page (error below) and didn't see anything in the logs.

Screenshot 2024-09-05 at 12 56 47 PM