java:S6437 rule made sonar jobs failed after upgrade to 10.6

Must-share information (formatted with Markdown):

  • which versions are you using: SonarQube 10.6
  • how is SonarQube deployed: Helm
  • what are you trying to achieve: Analysis

After upgrading to 10.6, some SonarQube jobs started to fail. The logs showed the following:

org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=com.XXX:XXX:src/main/resources/application-local.yaml,type=FILE} failed
    at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:71)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:107)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:94)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:69)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:107)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:94)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:69)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:107)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:94)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:69)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:107)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:94)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:69)
    at org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51)
    at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:79)
    at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:70)
    at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:57)
    at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
    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:131)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Fail to process issues of component 'com.XXX:XXX:src/main/resources/application-local.yaml'
    at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:107)
    at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:77)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:114)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
    at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:69)
    ... 32 more
Caused by: java.lang.IllegalStateException: The rule java:S6437 is declared to come from plugin java, but this plugin was not used by scanner.
    at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.lambda$illegalStateException$3(IssueCreationDateCalculator.java:177)
    at java.base/java.util.Optional.orElseThrow(Unknown Source)
    at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.ruleImplementationChanged(IssueCreationDateCalculator.java:121)
    at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.onIssue(IssueCreationDateCalculator.java:96)
    at org.sonar.ce.task.projectanalysis.issue.IssueVisitors.onIssue(IssueVisitors.java:43)
    at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.processIssue(IntegrateIssuesVisitor.java:211)
    at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.lambda$processIssues$1(IntegrateIssuesVisitor.java:165)
    at java.base/java.lang.Iterable.forEach(Unknown Source)
    at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:165)
    at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:101)
    ... 36 more

The jobs affected did not belong to projects with any .java code (in fact, they were spring Kotlin projects), but this rule seemed to be trying to analyze the code and actually found an issue in a .yaml file. Due to the error below, the analysis didn’t finished and the task failed.

Then we performed a few steps:

  • First, we disabled java:S6437 from the default java quality profile and then rerun an analysis
    • Analysis went through and passed
  • Then, we enabled again java:S6437 in the default java quality profile and then rerun the analysis
1 Like

Hi @JesusPajares,

It is a known issue on our side, but we are still trying to determine what is causing it.
Could you send us your scanner debug logs and maybe some way to reproduce it please?

Hi Antoine.

Unfortunately we do not have a way to reproduce it anymore as disabling and enabling the rule fixed it as stated in the OP.

Besides the scanner error logs (from Sonar UI) that I shared before, we have this one from https://oursonarinstance.xxx/api/ce/task?id=51071210-de93-427f-9b80-c91b6884b8b1.

{"task":{"id":"51071210-de93-427f-9b80-c91b6884b8b1","type":"REPORT","componentId":"bef0d874-fabc-448f-8bec-ff257e0516f4","componentKey":"com.bestsecret:cart-2-order","componentName":"cart-2-order","componentQualifier":"TRK","status":"FAILED","submittedAt":"2024-06-27T22:27:44+0000","submitterLogin":"admin","startedAt":"2024-06-27T22:27:45+0000","executedAt":"2024-06-27T22:27:50+0000","executionTimeMs":4657,"errorMessage":"Fail to process issues of component \u0027xxx:src/main/resources/application-local.yaml\u0027 (Visit of Component {key\u003dxxx:src/main/resources/application-local.yaml,type\u003dFILE} failed)","hasScannerContext":true,"branch":"main","branchType":"BRANCH","warningCount":0,"warnings":[],"infoMessages":[]}}

Hope this helps.

Hi Antonie, we just faced the problem again. Any update from your side?

Cheers,
Jesús

Hi @JesusPajares,

Sorry for giving no update on this.

We still have an open issue on our side to prevent the analysis from failing when this happens.

In the meantime, please keep using the workaround you described in your first post.

Cheers,

1 Like