Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-11544

Searching for certain users or groups in a directory while a sync is in progress can result in a 500 error

    XMLWordPrintable

    Details

      Description

      Under certain circumstances when a directory sync is in progress and at the same time a search is performed for certain users or groups in the directory (for example, when searching for users to add Repository Permissions), a 500 response code can be returned and the following error appears in the application logs:

      java.lang.IllegalArgumentException: Multiple entries with same key: <user details>. To index multiple values under a key, use Multimaps.index.
              at com.google.common.collect.Maps.uniqueIndex(Maps.java:1341)
              at com.google.common.collect.Maps.uniqueIndex(Maps.java:1296)
              at com.atlassian.stash.internal.user.HibernateApplicationUserDao.loadUsers(HibernateApplicationUserDao.java:304)
              at com.atlassian.stash.internal.user.DefaultUserHelper.transformOrCreate(DefaultUserHelper.java:48)
              at com.atlassian.stash.internal.user.DefaultUserService.findUsersByName(DefaultUserService.java:242)
              at com.atlassian.stash.internal.user.DefaultPermissionAdminService.lambda$createUserProvider$3(DefaultPermissionAdminService.java:649)
              at com.atlassian.bitbucket.util.PageUtils.filterPages(PageUtils.java:116)
              at com.atlassian.stash.internal.user.DefaultPermissionAdminService.getUsersWithoutPermission(DefaultPermissionAdminService.java:1385)
              at com.atlassian.stash.internal.user.DefaultPermissionAdminService.searchUsersLacking(DefaultPermissionAdminService.java:228)
              at com.atlassian.stash.internal.user.DefaultPermissionAdminService.lambda$findLicensedUsersWithoutRepositoryPermission$2(DefaultPermissionAdminService.java:363)
              at com.atlassian.bitbucket.util.PageUtils.filterPages(PageUtils.java:116)
              at com.atlassian.stash.internal.user.DefaultPermissionAdminService.findLicensedUsersWithoutRepositoryPermission(DefaultPermissionAdminService.java:370)
              at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
              at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
              at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
              at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
              at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
              at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
              at com.atlassian.stash.internal.rest.user.RepositoryPermissionResource.getUsersWithoutPermission(RepositoryPermissionResource.java:177)
      

      Workaround

      Retry the search after the directory sync has completed

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fdoherty@atlassian.com Frank Doherty
              Reporter:
              fdoherty@atlassian.com Frank Doherty
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: