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

Do not fail when file_sources.line_hashes is null in DB

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.3, 6.1
    • Component/s: Database
    • Labels:

      Description

      As reported by support, several customer have encountered report processing failures in the Compute Engine with an exception such as the following:

      2016.09.26 10:35:30 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVdl1a7G47u4u29Q2ZHd
      org.sonar.server.computation.component.VisitException: Visit of Component {key=PLSQL_bsmart_mg_gas_asset_Hig_QP:SonarQubeUnitTests/pkg_svc_gas_asset_body.sql,type=FILE} failed
      	at org.sonar.server.computation.component.VisitException.rethrowOrWrap(VisitException.java:44) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:64) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:100) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:87) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:100) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:87) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:50) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:75) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-5.6.jar:na]
      	at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_51]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_51]
      	at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_51]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.8.0_51]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_51]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_51]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_51]
      	at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]
      Caused by: java.lang.IllegalStateException: Fail to process issues of component 'PLSQL_bsmart_mg_gas_asset_Hig_QP:SonarQubeUnitTests/pkg_svc_gas_asset_body.sql'
      	at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:74) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:82) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:107) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:90) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.6.jar:na]
      	... 21 common frames omitted
      Caused by: java.lang.NullPointerException: null
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213) ~[guava-17.0.jar:na]
      	at com.google.common.base.Splitter.splitToList(Splitter.java:416) ~[guava-17.0.jar:na]
      	at org.sonar.db.source.FileSourceDao.selectLineHashes(FileSourceDao.java:73) ~[sonar-db-5.6.jar:na]
      	at org.sonar.server.computation.issue.TrackerBaseInputFactory$BaseLazyInput.loadLineHashSequence(TrackerBaseInputFactory.java:66) ~[sonar-server-5.6.jar:na]
      	at org.sonar.core.issue.tracking.LazyInput.getLineHashSequence(LazyInput.java:34) ~[sonar-core-5.6.jar:na]
      	at org.sonar.core.issue.tracking.LazyInput.getBlockHashSequence(LazyInput.java:42) ~[sonar-core-5.6.jar:na]
      	at org.sonar.core.issue.tracking.BlockRecognizer.match(BlockRecognizer.java:40) ~[sonar-core-5.6.jar:na]
      	at org.sonar.core.issue.tracking.Tracker.detectCodeMoves(Tracker.java:60) ~[sonar-core-5.6.jar:na]
      	at org.sonar.core.issue.tracking.Tracker.track(Tracker.java:43) ~[sonar-core-5.6.jar:na]
      	at org.sonar.server.computation.issue.TrackerExecution.track(TrackerExecution.java:41) ~[sonar-server-5.6.jar:na]
      	at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:67) ~[sonar-server-5.6.jar:na]
      	... 26 common frames omitted
      

      This error is caused by the fact that column FILE_SOURCES.LINE_HASHES is null. This can occur when an empty file has been analyzed with SQ running on an Oracle DB. The analysis shouldn't fail in such case.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              sebastien.lesaint Sebastien Lesaint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: