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

Compute Engine analysis fails if project description is too long

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.1
    • Fix Version/s: 7.2
    • Component/s: Compute Engine, Database
    • Labels:
      None

      Description

      Problem

      Compute Engine analysis fails when project description is too long.

      Example when analyzing http://git-wip-us.apache.org/repos/asf/commons-crypto.git:

      2018.04.09 14:27:43 INFO  ce[AWKqYFF2o-4kJLXn2N38][o.s.c.t.CeWorkerImpl] Execute task | project=org.apache.commons:commons-crypto | type=REPORT | id=AWKqYFF2o-4kJLXn2N38 | submitter=Cruentatum@github
      2018.04.09 14:27:43 ERROR ce[AWKqYFF2o-4kJLXn2N38][o.s.c.t.CeWorkerImpl] Failed to execute task AWKqYFF2o-4kJLXn2N38
      org.sonar.server.computation.task.projectanalysis.component.VisitException: Visit failed for Component {key=org.apache.commons:commons-crypto,type=PROJECT} 
              at org.sonar.server.computation.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
              at org.sonar.server.computation.task.projectanalysis.component.PathAwareCrawler.visit(PathAwareCrawler.java:52)
              at org.sonar.server.computation.task.projectanalysis.step.PersistComponentsStep.execute(PersistComponentsStep.java:111)
              at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)
              at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
              at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:73)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.ibatis.exceptions.PersistenceException: 
      ### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(2000)
      ### The error may involve org.sonar.db.component.ComponentMapper.update-Inline
      ### The error occurred while setting parameters
      ### SQL: update projects set     b_changed = ?,     b_copy_component_uuid = ?,     b_description = ?,     b_enabled = ?,     b_uuid_path = ?,     b_language = ?,     b_long_name = ?,     b_module_uuid = ?,     b_module_uuid_path = ?,     b_name = ?,     b_path = ?,     b_qualifier = ?     where     uuid = ?
      ### Cause: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(2000)
              at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
              at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
              at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
              at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
              at com.sun.proxy.$Proxy35.update(Unknown Source)
              at org.sonar.db.component.ComponentDao.update(ComponentDao.java:357)
              at org.sonar.server.computation.task.projectanalysis.step.PersistComponentsStep$PersistComponentStepsVisitor.persistComponent(PersistComponentsStep.java:258)
              at org.sonar.server.computation.task.projectanalysis.step.PersistComponentsStep$PersistComponentStepsVisitor.persistAndPopulateCache(PersistComponentsStep.java:244)
              at org.sonar.server.computation.task.projectanalysis.step.PersistComponentsStep$PersistComponentStepsVisitor.visitProject(PersistComponentsStep.java:204)
              at org.sonar.server.computation.task.projectanalysis.component.PathAwareCrawler.visitNode(PathAwareCrawler.java:96)
              at org.sonar.server.computation.task.projectanalysis.component.PathAwareCrawler.visitImpl(PathAwareCrawler.java:67)
              at org.sonar.server.computation.task.projectanalysis.component.PathAwareCrawler.visit(PathAwareCrawler.java:50)
              ... 17 common frames omitted
      Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(2000)
              at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
              at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
              at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
              at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
              at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
              at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
              at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:144)
              at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
              at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
              at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46)
              at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
              at org.apache.ibatis.executor.ReuseExecutor.doUpdate(ReuseExecutor.java:52)
              at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
              at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
              at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
              ... 27 common frames omitted
      2018.04.09 14:27:43 INFO  ce[AWKqYFF2o-4kJLXn2N38][o.s.c.t.CeWorkerImpl] Executed task | project=org.apache.commons:commons-crypto | type=REPORT | id=AWKqYFF2o-4kJLXn2N38 | submitter=Cruentatum@github | status=FAILED | time=508ms
      

      Solution

      • Truncate project information provided by the user with “…” at the end to indicate it's truncated
        • name – max 500 characters
        • description – max 2000 characters

        Attachments

          Activity

            People

            • Assignee:
              teryk.bellahsene Teryk Bellahsene (Inactive)
              Reporter:
              simon.brandhof Simon Brandhof
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: