Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-64919

Groups with more than 2000 users will fail to display correctly

    XMLWordPrintable

Details

    Description

      Steps to reproduce
      • Set up JIRA Server with SQL Server as the database type
      • Add second directory which lower priority than existing one, this directory has to have group with more than 2000 members
      • Attempt to display the members of the group.
      Expected Result
      • Users display in a list
      Actual Result
      • An error is displayed. The following is displayed in atlassian-jira.log:
      2017-03-17 15:01:48,390 http-nio-9732-exec-4 ERROR [o.a.c.c.C.[.[localhost].[/jira].[action]] Servlet.service() for servlet [action] in context with path [/jira] threw exception [java.lang.RuntimeException: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT user_name FROM dbo.cwd_user WHERE ((lower_user_name = ? ) <snip> AND (directory_id = ? ) ORDER BY lower_user_name (Prepared or callable statement has more than 2000 parameter markers.)] with root cause
      java.sql.SQLException: Prepared or callable statement has more than 2000 parameter markers.
      at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:1254)
      at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:165)
      at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.<init>(JtdsPreparedStatement.java:111)
      at net.sourceforge.jtds.jdbc.JtdsConnection.prepareStatement(JtdsConnection.java:2492)
      at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:305)
      at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:305)
      at org.ofbiz.core.entity.jdbc.interceptors.connection.DelegatingConnection.prepareStatement(DelegatingConnection.java:137)
      at org.ofbiz.core.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:562)
      at org.ofbiz.core.entity.GenericDAO.createEntityListIterator(GenericDAO.java:960)
      at org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(GenericDAO.java:883)
      at org.ofbiz.core.entity.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:194)
      at org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(GenericDelegator.java:1237)
      at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.findListIteratorByCondition(DefaultOfBizDelegator.java:398)
      at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.findListIteratorByCondition(WrappingOfBizDelegator.java:278)
      at com.atlassian.jira.crowd.embedded.ofbiz.OfBizUserDao.lambda$search$0(OfBizUserDao.java:830)
      at com.atlassian.jira.crowd.embedded.ofbiz.db.DefaultOfBizTransaction.lambda$withTransaction$0(DefaultOfBizTransaction.java:57)
      at com.atlassian.jira.crowd.embedded.ofbiz.db.DefaultOfBizTransaction.withTransaction(DefaultOfBizTransaction.java:37)
      at com.atlassian.jira.crowd.embedded.ofbiz.db.DefaultOfBizTransaction.withTransaction(DefaultOfBizTransaction.java:51)
      at com.atlassian.jira.crowd.embedded.ofbiz.db.DefaultOfBizTransaction.withTransaction(DefaultOfBizTransaction.java:55)
      at com.atlassian.jira.crowd.embedded.ofbiz.db.DefaultOfBizTransactionManager.withTransaction(DefaultOfBizTransactionManager.java:9)
      at com.atlassian.jira.crowd.embedded.ofbiz.OfBizUserDao.search(OfBizUserDao.java:828)
      at com.atlassian.jira.crowd.embedded.ofbiz.DelegatingUserDao.search(DelegatingUserDao.java:128)
      at com.atlassian.jira.crowd.embedded.ofbiz.IndexedUserDao.search(IndexedUserDao.java:368)
      at com.atlassian.jira.crowd.embedded.ofbiz.DelegatingUserDao.search(DelegatingUserDao.java:128)
      at com.atlassian.jira.crowd.embedded.ofbiz.SwitchingUserDao.search(SwitchingUserDao.java:30)
      at com.atlassian.crowd.directory.AbstractInternalDirectory.searchUsers(AbstractInternalDirectory.java:785)
      at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.searchUsers(DirectoryManagerGeneric.java:329)
      at com.atlassian.crowd.manager.application.SingleDirectorySearchStrategy.searchUsers(SingleDirectorySearchStrategy.java:39)
      at com.atlassian.crowd.manager.application.InMemoryNonAggregatingSearchStrategy.findRemainingEntities(InMemoryNonAggregatingSearchStrategy.java:287)
      at com.atlassian.crowd.manager.application.InMemoryNonAggregatingSearchStrategy.removeNonCanonicalEntities(InMemoryNonAggregatingSearchStrategy.java:262)
      at com.atlassian.crowd.manager.application.InMemoryNonAggregatingSearchStrategy.searchNestedGroupRelationships(InMemoryNonAggregatingSearchStrategy.java:184)
      at com.atlassian.crowd.manager.application.ApplicationServiceGeneric.searchNestedGroupRelationships(ApplicationServiceGeneric.java:2280)
      at com.atlassian.crowd.embedded.core.CrowdServiceImpl.searchNestedGroupRelationships(CrowdServiceImpl.java:276)
      at com.atlassian.crowd.embedded.core.CrowdServiceImpl.search(CrowdServiceImpl.java:200)
      at com.atlassian.jira.web.bean.UserBrowserFilter.getUsersFilteredByGroup(UserBrowserFilter.java:162)
      at com.atlassian.jira.web.bean.UserBrowserFilter.getUsersFilteredByGroupAndCriteria(UserBrowserFilter.java:149)
      at com.atlassian.jira.web.bean.UserBrowserFilter.getFilteredUsers(UserBrowserFilter.java:129)
      at com.atlassian.jira.web.action.admin.user.UserBrowser.getBrowsableItems(UserBrowser.java:170)
      at com.atlassian.jira.web.action.admin.user.UserBrowser.doExecute(UserBrowser.java:122)
      ... 1 filtered
      at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
      ... 7 filtered
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      ... 52 filtered
      at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:62)
      ... 7 filtered
      at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      ... 62 filtered
      at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:80)
      ... 1 filtered
      at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:78)
      ... 36 filtered
      at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
      ... 10 filtered
      at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      ... 4 filtered
      at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
      ... 29 filtered
      at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
      ... 28 filtered
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
      Notes

      The bug impacts all databases due to the structure of the query generated by JIRA and not just MSSQL. The query could take up huge amount of time, CPU and even use up all available connections.

      We've also confirmed that this particular bug does not affect 7.2.8 - the same user directory and same group work display correctly.

      Other symptoms
      • Filters that are restricted to groups with more than 2000 users will also fail to display correctly. The message given is "The JIRA server could not be contacted" - and the UI for displaying the controls in the Issue Navigator does not display correctly. It appears as if issues themselves will display correctly.
      • This issue is also reproduced when doing Customer Searches (the share button in portal) or loading the* Agent Workload Report* with JIRA Servicedesk. There could be many more actions that trigger this issue.

      Attachments

        Issue Links

          Activity

            People

              tkanafa Tomasz Kanafa
              dnorton@atlassian.com Dave Norton
              Votes:
              15 Vote for this issue
              Watchers:
              48 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: