Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-7194

LDAP sync fails if there is no user cache

    Details

    • Steps to Reproduce:
      • Start a standalone Keycloak
      • Disable the userCache SPI
      • Create an LDAP user federation
      • Sync
      • Sync again (manual or scheduled)
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      LDAP sync fails with a NullPointerException if there is no user cache when trying to evict a user from the cache. The solution is to check if there is a cache, as it is done in other places in LDAPStorageProviderFactory and LDAPStorageProvider.

      2018-04-18 10:57:07,447 ERROR [org.keycloak.services] (Timer-2) KC-SERVICES0062: Error occurred during sync of changed users: java.lang.NullPointerException
      	at org.keycloak.storage.ldap.LDAPStorageProviderFactory$3.run(LDAPStorageProviderFactory.java:543)
      	at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227)
      	at org.keycloak.storage.ldap.LDAPStorageProviderFactory.importLdapUsers(LDAPStorageProviderFactory.java:514)
      	at org.keycloak.storage.ldap.LDAPStorageProviderFactory.syncImpl(LDAPStorageProviderFactory.java:469)
      	at org.keycloak.storage.ldap.LDAPStorageProviderFactory.syncSince(LDAPStorageProviderFactory.java:429)
      	at org.keycloak.services.managers.UserStorageSyncManager$3$1.call(UserStorageSyncManager.java:149)
      	at org.keycloak.services.managers.UserStorageSyncManager$3$1.call(UserStorageSyncManager.java:142)
      	at org.keycloak.cluster.infinispan.InfinispanClusterProvider.executeIfNotExecuted(InfinispanClusterProvider.java:78)
      	at org.keycloak.services.managers.UserStorageSyncManager$3.run(UserStorageSyncManager.java:142)
      	at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227)
      	at org.keycloak.services.managers.UserStorageSyncManager.syncChangedUsers(UserStorageSyncManager.java:132)
      	at org.keycloak.services.managers.UserStorageSyncManager$5.run(UserStorageSyncManager.java:215)
      	at org.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:51)
      	at java.util.TimerThread.mainLoop(Timer.java:555)
      	at java.util.TimerThread.run(Timer.java:505)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  ibauersachs Ingo Bauersachs
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: