keycloak icon indicating copy to clipboard operation
keycloak copied to clipboard

Clear expired events errors

Open darius-m opened this issue 2 years ago • 4 comments

Describe the bug

After upgrading to Keycloak 19.0.0, the following errors are logged in the server log:

ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-2) Failed to run scheduled task ClearExpiredEvents: java.lang.IllegalAccessError: class org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1 tried to access protected field org.keycloak.services.scheduled.ScheduledTaskRunner.task (org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1 is in unnamed module of loader '[email protected]' @1c229870; org.keycloak.services.scheduled.ScheduledTaskRunner is in unnamed module of loader '[email protected]' @558b25b9)
        at [email protected]//org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1.call(ClusterAwareScheduledTaskRunner.java:56)
        at [email protected]//org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1.call(ClusterAwareScheduledTaskRunner.java:52)
        at [email protected]//org.keycloak.cluster.infinispan.InfinispanClusterProvider.executeIfNotExecuted(InfinispanClusterProvider.java:78)
        at [email protected]//org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner.runTask(ClusterAwareScheduledTaskRunner.java:52)
        at [email protected]//org.keycloak.services.scheduled.ScheduledTaskRunner.run(ScheduledTaskRunner.java:54)
        at [email protected]//org.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:53)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)

Version

19.0.0-legacy

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Anything else?

The issue may be caused by the fact that this class was moved in cb81a17.

darius-m avatar Jul 28 '22 13:07 darius-m

Same here, for 19.0.0-legacy. I can reproduce simply by running: docker run --rm -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:19.0.0-legacy

and waiting for 5-15 minutes. I also tried the non-docker version and it has the same issue. I didn't try Quarkus / keycloak X.

savv avatar Jul 29 '22 11:07 savv

Just for any others finding this issue - keycloak 19.0.1 still has this issue.

savv avatar Jul 31 '22 18:07 savv

I have made a mistake - I was also referring to the legacy version. I have fixed the description.

darius-m avatar Jul 31 '22 20:07 darius-m

Same issue here with version 19.0.1-legacy. What's the potential impact of this error and can it be fixed on installation side (e.g. via configuration / scripts)?

oteichmann avatar Aug 09 '22 15:08 oteichmann

This seems to not be included in 19.0.2 despite the milestone set to 19.0.2.

olivierboudet avatar Sep 15 '22 12:09 olivierboudet

Indeed. I guess this warrants a 19.0.3...

sschu avatar Sep 15 '22 14:09 sschu

@ahus1, @abstractj issue #13396 is mentioned in the 19.0.2 release notes as fixed, but there have been a few messages saying that this is not the case - there have also been other issues mentioning this.

darius-m avatar Sep 20 '22 15:09 darius-m

The problem is still present in 19.0.2-legacy (see https://github.com/keycloak/keycloak/issues/14476) Unfortunately, the commit has not been shipped in the 19.0.2.

etchepar avatar Sep 23 '22 13:09 etchepar

@ahus1 do you know if the fix was shipped on 19.0.2? We got some reports from people mentioning the opposite, please see the comments above.

abstractj avatar Sep 23 '22 15:09 abstractj

I confirm that this has sadly not shipped as part of 19.0.2. I'll prepare a PR for the 19.x branch to backport this.

ahus1 avatar Sep 26 '22 08:09 ahus1

Milestone and project assignment updated; @abstractj please review.

PR #14574 created, builds are still running.

ahus1 avatar Sep 26 '22 11:09 ahus1

This error still occurs in our KeyCloak-Instance. In this feed i couldnt quite read out if the error is fixed now and if so what steps i have to take to solve it in our instance

Juhi214-j avatar Oct 27 '22 09:10 Juhi214-j

You have to update to KC 19.0.3, it is fixed there.

sschu avatar Oct 27 '22 10:10 sschu

Faced the same problem and solved by below workaround.

In our case, somehow the username "admin" under master realm changed to some other username. Issue resolved after creating username "admin" under master realm and assigned with admin roles.

hrbt11 avatar May 15 '23 16:05 hrbt11