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

App Auth: Server Sent Events EP throws ContextNotActiveException #70

Open
melegiul opened this issue Mar 27, 2024 · 0 comments
Open

App Auth: Server Sent Events EP throws ContextNotActiveException #70

melegiul opened this issue Mar 27, 2024 · 0 comments
Labels
bug Something isn't working component/mfa-app Native app authenticator component

Comments

@melegiul
Copy link
Collaborator

After upgrading from Keycloak 23.0.7 to 24.0.2, the Resource Provider for server sent events throws exception below. During my tests this was not critical. The form submission, which is triggered by the server sent event, still works as expected.

const source = new EventSource("${appAuthStatusUrl?no_esc}");

Nonetheless we should check the current quarkus version and changelog for hints.

2024-03-27 07:54:34,304 ERROR [io.quarkus.vertx.http.runtime.QuarkusErrorHandler] (executor-thread-10) HTTP Request to
/realms/realm/app-auth-status?session_code=sfa7st4CvMBni23bpkTBIrtKeUJf5zV41sIARpz6BQ0&execution=app-register&client_id=account-console&tab_id=bNhbEzFwlrw failed,
error id: 2ec0baaa-0557-4ac2-8aa6-ecf2a6882d62-2:
jakarta.enterprise.context.ContextNotActiveException:
RequestScoped context was not active when trying to obtain a bean instance for a client proxy of CLASS bean
[class=io.quarkus.vertx.http.runtime.CurrentVertxRequest, id=0_6n6EmChCiiDdd8HelptG_A0AE]
	- you can activate the request context for a specific method using the @ActivateRequestContext interceptor binding
	at io.quarkus.arc.impl.ClientProxies.notActive(ClientProxies.java:70)
	at io.quarkus.arc.impl.ClientProxies.getSingleContextDelegate(ClientProxies.java:30)
	at io.quarkus.vertx.http.runtime.CurrentVertxRequest_ClientProxy.arc$delegate(Unknown Source)
	at io.quarkus.vertx.http.runtime.CurrentVertxRequest_ClientProxy.getCurrent(Unknown Source)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.keycloak.quarkus.runtime.integration.resteasy.ResteasyVertxProvider.getContextData(ResteasyVertxProvider.java:44)
	at org.keycloak.common.util.Resteasy.getContextData(Resteasy.java:62)
	at org.keycloak.services.error.KeycloakErrorHandler.toResponse(KeycloakErrorHandler.java:54)
	at org.jboss.resteasy.reactive.server.core.RuntimeExceptionMapper.mapException(RuntimeExceptionMapper.java:100)
	at org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext.mapExceptionIfPresent(ResteasyReactiveRequestContext.java:346)
	at org.jboss.resteasy.reactive.server.handlers.ExceptionHandler.handle(ExceptionHandler.java:15)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:150)
	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:840)
@melegiul melegiul added the bug Something isn't working label Mar 27, 2024
@svenseeberg svenseeberg added the component/mfa-app Native app authenticator component label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/mfa-app Native app authenticator component
Projects
None yet
Development

No branches or pull requests

2 participants