Closed
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
infinispan
Describe the bug
If we haven't a default role configured, we get NullPointerException
at [1] like:
ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-3) Uncaught server error: java.lang.NullPointerException
at [[email protected]](mailto:[email protected])//org.keycloak.models.cache.infinispan.entities.CachedRealm.<init>(CachedRealm.java:266)
at [[email protected]](mailto:[email protected])//org.keycloak.models.cache.infinispan.RealmCacheSession.getRealm(RealmCacheSession.java:414)
(...)
Version
26.0.0
Regression
- The issue is a regression
Expected behavior
We need to prevent NullPointerException
and log in [1] and log some information, like Realm name etc.
Actual behavior
We get the following message when the default role is null:
ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-3) Uncaught server error: java.lang.NullPointerException
at [[email protected]](mailto:[email protected])//org.keycloak.models.cache.infinispan.entities.CachedRealm.<init>(CachedRealm.java:266)
at [[email protected]](mailto:[email protected])//org.keycloak.models.cache.infinispan.RealmCacheSession.getRealm(RealmCacheSession.java:414)
(...)
How to Reproduce?
For example, remove the default role from the database.
Anything else?
Maybe we need to review the CachedRealm.java
class and check for possible other points that could throw NPW