Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shaidar opened this issue Jul 26, 2024 · 7 comments
Labels
bug Something isn't working product:mit-open Issues related to the MIT Open product

Comments

@shaidar
Copy link
Contributor

shaidar commented Jul 26, 2024

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 shaidar added the bug Something isn't working label Jul 26, 2024
@shaidar
Copy link
Contributor Author

shaidar commented Aug 1, 2024

We have tried the following:

  • Duplicate this issue on a clean, local install of Keycloak v25.0.2 and that docker container does NOT exhibit this behavior
  • Created a new realm on CI and that realm does NOT exhibit this behavior

@steffenmllr
Copy link

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

@shaidar
Copy link
Contributor Author

shaidar commented Aug 20, 2024

@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
Copy link

So here is what I know:

  • update from 24.x to 25.x (24.x works without an issue)
  • isolated to a single real where we use specific custom RequiredActionProvider
  • The issue persists even when i remove the RequiredActionProvider from the SPI
  • The RequiredActionProviders are quite simple (eg. lookup terms date and if not set, render a template)

@shaidar
Copy link
Contributor Author

shaidar commented Aug 29, 2024

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
Copy link
Contributor Author

shaidar commented Aug 30, 2024

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

@pdpinch pdpinch added the product:mit-open Issues related to the MIT Open product label Sep 3, 2024
@shaidar
Copy link
Contributor Author

shaidar commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product:mit-open Issues related to the MIT Open product
Projects
None yet
Development

No branches or pull requests

3 participants