Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15828

Error computing portfolio with >1000 references

    XMLWordPrintable

    Details

    • Edition:
      Community
    • Production Notes:
      None

      Description

      If a portfolio has more than 1000 references to applications, the computation fails, at least with Oracle.

      Implementation details: Looks like the ProjectDao#selectApplicationsByKeys needs to use executeLargeInputs to handle large datasets as input.

      ### Cause: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      
      	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
      	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
      	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
      	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)
      	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
      	at com.sun.proxy.$Proxy39.selectApplicationsByKeys(Unknown Source)
      	at org.sonar.db.project.ProjectDao.selectApplicationsByKeys(ProjectDao.java:68)
      	at com.sonarsource.H.D.B.A(Unknown Source)
      	at com.sonarsource.H.D.B.A(Unknown Source)
      	at com.sonarsource.H.D.E.A(Unknown Source)
      	at com.sonar.governance.H.D.G.B(Unknown Source)
      	at com.sonar.governance.H.D.G.C(Unknown Source)
      	at com.sonar.governance.H.D.G.A(Unknown Source)
      	at com.sonar.governance.ce.A.A.triggerFrom(Unknown Source)
      	at org.sonar.ce.task.projectanalysis.step.TriggerViewRefreshStep.execute(TriggerViewRefreshStep.java:60)
      	at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
      	at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
      	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
      	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:212)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:194)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:160)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:135)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:87)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
      	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
      	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
      	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      
      	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:628)
      	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:562)
      	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1207)
      	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:727)
      	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:291)
      	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:498)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:155)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:987)
      	at oracle.jdbc.driver.OracleStatement.prepareDefineBufferAndExecute(OracleStatement.java:1245)
      	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1132)
      	at oracle.jdbc.driver.OracleStatement.executeSQLSelect(OracleStatement.java:1589)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1430)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3743)
      	at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4080)
      	at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1014)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
      	at jdk.internal.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.sonar.db.profiling.InvocationUtils.invokeQuietly(InvocationUtils.java:34)
      	at org.sonar.db.profiling.ProfilingPreparedStatementHandler.invoke(ProfilingPreparedStatementHandler.java:45)
      	at com.sun.proxy.$Proxy31.execute(Unknown Source)
      	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
      	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
      	at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:60)
      	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
      	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
      	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
      	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
      	... 34 common frames omitted
      Caused by: oracle.jdbc.OracleDatabaseException: ORA-01795: maximum number of expressions in a list is 1000
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              klaudio.sinani Klaudio Sinani
              Reporter:
              duarte.meneses Duarte Meneses
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: