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

Differential period param columns can't hold large version names

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.5.7, 5.6.1, 6.0
    • Fix Version/s: 6.7
    • Component/s: Database
    • Labels:

      Description

      As reported by Olivier Korach based on customer feedback, analysis can fail when SQ user defines a long version name on an analysis.

      In such case, size limit in DB for the version name is 500.

      When configuring a differential period to 'last_version' (and by default, the leak period is configured as such), the version of the analysis is copied in into the param column of that period, which is too small (100) to old the version name and causes a SQL error which fails the analysis, eg.;

      2016.08.17 11:14:10 ERROR ce[AVaXx3qXaFAj68e6p4aA][o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVaXx3qXaFAj68e6p4aA
      org.sonar.server.computation.task.projectanalysis.component.VisitException: Visit failed for Component {key=org.sonarqube:example-java-maven,type=PROJECT} 
      	at org.sonar.server.computation.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44) ~[sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.task.projectanalysis.component.PathAwareCrawler.visit(PathAwareCrawler.java:52) ~[sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.task.projectanalysis.step.PersistAnalysisStep.execute(PersistAnalysisStep.java:64) ~[sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:67) ~[sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:55) ~[sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75) ~[sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:84) [sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:57) [sonar-server-6.1-SNAPSHOT.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-6.1-SNAPSHOT.jar:na]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_101]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_101]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_101]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
      	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
      Caused by: org.apache.ibatis.exceptions.PersistenceException: 
      ### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Value too long for column "PERIOD1_PARAM VARCHAR(100)": "'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae elit vel dolor convallis ultrices eu sit amet nulla. Donec ... (200)"; SQL statement:
      insert into snapshots (
          uuid,
          component_uuid,
          created_at,
          build_date,
          status,
          purge_status,
          islast,
          version,
          period1_mode,
          period2_mode,
          period3_mode,
          period4_mode,
          period5_mode,
          period1_param,
          period2_param,
          period3_param,
          period4_param,
          period5_param,
          period1_date,
          period2_date,
          period3_date,
          period4_date,
          period5_date)
          values (
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?,
          ?) [22001-176]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
      	at org.h2.message.DbException.get(DbException.java:178)
      	at org.h2.table.Column.validateConvertUpdateSequence(Column.java:332)
      	at org.h2.table.Table.validateConvertUpdateSequence(Table.java:726)
      	at org.h2.command.dml.Insert.insertRows(Insert.java:152)
      	at org.h2.command.dml.Insert.update(Insert.java:115)
      	at org.h2.command.CommandContainer.update(CommandContainer.java:79)
      	at org.h2.command.Command.executeUpdate(Command.java:254)
      	at org.h2.server.TcpServerThread.process(TcpServerThread.java:346)
      	at org.h2.server.TcpServerThread.run(TcpServerThread.java:160)
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                daniel.schwarz Daniel Schwarz (Inactive)
                Reporter:
                sebastien.lesaint Sebastien Lesaint
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: