Fail to process issues of X - Visit of Component X failed

which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  • Self hosted SonarQube Community Edition: v7.9.2 (build 30863)
  • I am realizing my automatic Build using Cake, these are the relevant versions for Sonar:
    • Cake (including Cake.Tool, Cake.Common, Cake.Core, …): v1.1.0 (latest)
    • Cake.Sonar: v1.1.25 (latest)
    • MSBuild.SonarQube.Runner.Tool: v4.8.0 (latest)

what are you trying to achieve

I want to analyze our larger (~2000 C#-Files) WPF .NET Framework 4.7.2 Project (uses the new SDK-Style csproj Format)

what have you tried to achieve this

Set up my automatic build in a way that this order is respected:

  • resharper inspect
  • Convert Inspect-Report to SonarQube-Format using Dotnet-Reqube
  • sonar start {arguments}
  • Build (dotnet build)
  • Coverage (dotCover) and Tests (dotnet test)
  • sonar end {arguments}

I tested this in a fork of that Repository before and it worked fine. This also works for many other Repositories that we have in our Codebase.

But with the main-project I get errors when the Report from the Scanner was uploaded all the time. This is the most recent report of a task with the error in it:

{
  "task": {
    "id": "AXoTCKVcwmfKvLQPQm77",
    "type": "REPORT",
    "componentId": "AWEdoxXjOpetE69mk7y_",
    "componentKey": "***",
    "componentName": "***",
    "componentQualifier": "TRK",
    "status": "FAILED",
    "submittedAt": "2021-06-16T04:16:11+0000",
    "startedAt": "2021-06-16T04:16:12+0000",
    "executedAt": "2021-06-16T04:16:15+0000",
    "executionTimeMs": 3580,
    "logs": false,
    "errorMessage": "Fail to process issues of component '***:path/to/my/class.cs' (Visit of Component {key=***:path/to/my/class.cs,type=FILE} failed)",
    "errorStacktrace": "org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=***:path/to/my/class.cs,type=FILE} failed\n\tat org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:74)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)\n\tat org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51)\n\tat org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)\n\tat org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)\n\tat org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)\n\tat org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)\n\tat org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)\n\tat org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)\n\tat org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)\n\tat org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)\n\tat org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)\n\tat org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)\n\tat java.base/java.util.concurrent.FutureTask.run(Unknown Source)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n\tat java.base/java.util.concurrent.FutureTask.run(Unknown Source)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base/java.lang.Thread.run(Unknown Source)\nCaused by: java.lang.IllegalStateException: Fail to process issues of component '***:path/to/my/class.cs'\n\tat org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:66)\n\tat org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:77)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:117)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:100)\n\tat org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)\n\t... 30 more\nCaused by: java.lang.NullPointerException\n\tat org.sonar.core.issue.tracking.AbstractTracker$LineAndLineHashAndMessage.equals(AbstractTracker.java:116)\n\tat java.base/java.util.HashMap.getNode(Unknown Source)\n\tat java.base/java.util.HashMap.get(Unknown Source)\n\tat com.google.common.collect.AbstractMapBasedMultimap.put(AbstractMapBasedMultimap.java:192)\n\tat com.google.common.collect.AbstractListMultimap.put(AbstractListMultimap.java:100)\n\tat com.google.common.collect.ArrayListMultimap.put(ArrayListMultimap.java:66)\n\tat org.sonar.core.issue.tracking.AbstractTracker.lambda$match$0(AbstractTracker.java:43)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)\n\tat java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)\n\tat java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(Unknown Source)\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)\n\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)\n\tat java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)\n\tat org.sonar.core.issue.tracking.AbstractTracker.match(AbstractTracker.java:43)\n\tat org.sonar.core.issue.tracking.Tracker.trackClosed(Tracker.java:60)\n\tat org.sonar.ce.task.projectanalysis.issue.TrackerExecution.track(TrackerExecution.java:62)\n\tat org.sonar.ce.task.projectanalysis.issue.IssueTrackingDelegator.track(IssueTrackingDelegator.java:53)\n\tat org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59)\n\t... 34 more\n",
    "hasScannerContext": true,
    "organization": "default-organization",
    "warningCount": 0,
    "warnings": []
  }
}

(had to censor parts out, because of our company-policy)

Because error message states something like “Fail to process issues of component X”, I thought it might have to do with the additional ReSharper-Inspect-Issues. But to test this, I disabled that temporarly and I get the same error.

I’m pretty confused why this error comes up, especially because it worked and works in other scenarios (I cannot see any differences tho).

Thanks for your help and let me know, if you need additional Information!

Hi,
It looks like there is an issue in the database that is missing a required field, causing the error.

I tested this in a fork of that Repository before and it worked fine. This also works for many other Repositories that we have in our Codebase.

Just to understand how you got to this situation, did you analyze the fork of the same repo (that succeeded) using the same instance of SonarQube? And when you switched to the failing repo, did you reuse the same project in SonarQube that you had created before with the fork?

Hi,

Thanks for your answer.

did you analyze the fork of the same repo (that succeeded) using the same instance of SonarQube?

Yes. Any SonarQube analyzing has been done on the same SonarQube Instance (the self-hosted Community-Edition v7.9.2).

And when you switched to the failing repo, did you reuse the same project in SonarQube that you had created before with the fork?

No. There are two separate SonarQube-Projects for each Repository.

  • One for the failing Repo (origin). This Project has been around for at least 2 years (I’m not entirely sure and I don’t know if there’s a way to see this - but as far as I understand, this project was one of the first projects that adopted SonarQube when it was introduced in our company)
  • One for the succeeding Repo (fork). This project was newly created just for the sake of testing the analysis on this fork (so the project is maybe 2-3 weeks old by now)

It looks like there is an issue in the database that is missing a required field, causing the error.

So if I understand you correctly, the original project might have some error? How am I able to check this? And is there an easy way to fix this (apart from deleting the current project and setting up a new one).
But this could be the case, yeah. Because the Repo we’re talking about changed a lot in the last 1-2 years, with partly drastic refactorings.

Thanks for the detailed information.
I was able to reproduce the issue. The problem is that there are issues imported from an external rule engine (I’m guessing ReSharper-Inspect-Issues) with an empty message, and this causes SonarQube to fail due to a bug in the Compute Engine.

I created a bug ticket: https://jira.sonarsource.com/browse/SONAR-15091

As for a workaround, disabling the rule that is creating issues with an empty message (or fixing the report) won’t fix the problem by itself because the problematic issue is already in the DB.

If you have access to the DB, you can fix it by running:

UPDATE issues SET message = 'no message' WHERE message IS NULL

You’ll have to make sure that issues without message aren’t created again until you upgrade to a SonarQube version where the bug is fixed.

2 Likes

Yeah we’re importing ReSharper-Inspect-Issues.

Thanks for the information! I now know how I can try to fix the issue on our end. I’m pretty sure I’ll be able to find a way.

Thanks and stay healthy.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.