Cache with name [ldap.groups] already exist

I’ve done a test upgrade of my XWiki from 10.11.1 to 11.10.2 (via the debian packages). I notice this message happening in the logs, seemingly after a user’s session has been idle for a while. What causes the below traceback?

o.x.c.l.XWikiLDAPUtils - Unknown error with cache
org.xwiki.cache.CacheException: Cache with name [ldap.groups] already exist
at org.xwiki.cache.infinispan.internal.InfinispanCacheFactory.newCache(InfinispanCacheFactory.java:152)
at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:112)
at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:85)
at org.xwiki.contrib.ldap.internal.LDAPGroupsCache.getGroupCache(LDAPGroupsCache.java:90)
at org.xwiki.contrib.ldap.XWikiLDAPUtils.getGroupMembers(XWikiLDAPUtils.java:814)
at org.xwiki.contrib.ldap.XWikiLDAPUtils.isMemberOfGroup(XWikiLDAPUtils.java:854)
at org.xwiki.contrib.ldap.XWikiLDAPUtils.isMemberOfGroups(XWikiLDAPUtils.java:880)
at org.xwiki.contrib.ldap.XWikiLDAPUtils.syncGroupsMembership(XWikiLDAPUtils.java:1180)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.syncGroupsMembership(XWikiLDAPAuthServiceImpl.java:765)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.syncGroupsMembership(XWikiLDAPAuthServiceImpl.java:747)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.ldapAuthenticateInContext(XWikiLDAPAuthServiceImpl.java:693)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:366)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.authenticate(XWikiLDAPAuthServiceImpl.java:300)
at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.authenticate(MyFormAuthenticator.java:280)
at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.processLogin(MyFormAuthenticator.java:146)
at com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl.checkAuth(XWikiAuthServiceImpl.java:239)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.checkAuth(XWikiLDAPAuthServiceImpl.java:167)
at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:4295)
at org.xwiki.security.authorization.internal.XWikiCachingRightService.authenticateUser(XWikiCachingRightService.java:241)
at org.xwiki.security.authorization.internal.XWikiCachingRightService.checkAccess(XWikiCachingRightService.java:271)
at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:4313)
at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:5503)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:404)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:218)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

Looks like you have a version of the LDAP authenticator which does not like much reloads, this is supposed to be fixed in the latest version. You should probably check if you have it.

I’ve checked the extensions list for this, and it shows version 9.4.1 installed, which appears to be the latest from https://extensions.xwiki.org/

That’s very weird then. In any case the workaround when something like this happen is to restart XWiki.

Restart did seem to help, thanks.

I have the same problem with Version 9.4.4 (XWiki 12.2.1)
I have a configuration with more than one ldaps with

  • xwiki.authentication.ldap.remoteUserMapping.*
  • xwiki.authentication.ldap.user_group

If I login from one domain, then the other users of this domain could also login, if a user of an other domain would login it failed.

I can’t restart the XWiki each time …

My configuration:

In the frontend I have defined a default domain (MyDomain1)

In the backend I have defined some additional domains:
(MyDomain1 could be accessed with the domain [backend configuration] and without [frontend configuration])

xwiki.authentication.ldap.remoteUserParser=(.+)\\\\(.+)
xwiki.authentication.ldap.remoteUserMapping.1=domain,ldap_server,ldap_port,ldap_base_DN,ldap_bind_DN,ldap_bind_pass
xwiki.authentication.ldap.remoteUserMapping.2=uid

xwiki.authentication.ldap.remoteUserMapping.ldap_server=MyDomain1=...|MyDomain2=...|MyDomain3=...
xwiki.authentication.ldap.remoteUserMapping.ldap_port=MyDomain1=...|MyDomain2=...|MyDomain3=...
xwiki.authentication.ldap.remoteUserMapping.ldap_base_DN=MyDomain1=...|MyDomain2=...|MyDomain3=...
xwiki.authentication.ldap.remoteUserMapping.ldap_bind_DN=MyDomain1=...|MyDomain2=...|MyDomain3=...
xwiki.authentication.ldap.remoteUserMapping.ldap_bind_pass=MyDomain1=...|MyDomain2=...|MyDomain3=...

I need for each domain a different group filter like:
(memberof=CN=internal,...,DC=MyDomain1)
(memberof=CN=internal,...,DC=MyDomain2)
(memberof=CN=internal,...,DC=MyDomain3)
and not like my current filter in the frontend:
(|(memberof=CN=internal,...,DC=MyDomain1)(memberof=CN=internal,...,DC=MyDomain2)(memberof=CN=internal,...,DC=MyDomain3))

So I have added the filter in the frontend because there isn’t a xwiki.authentication.ldap.remoteUserMapping.ldap_user_group
definition.

I suppose that my user_group definition in the frontend is the problem for the caching error.