Problem BuildWrapper SonarQube 8.7 and 8.9

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 8.7 and 8.9 with the associated BuildWrapper
  • what are you trying to achieve
    We want to manage to use the newest version of the SonarQube Scanner and Buildwrapper dependent of the sonarqube server and not on what is registered on our build agent.
  • what have you tried so far to achieve this
    We are using the SonarQube tasks in Azure DevOps and we created a powershell script that downloads the buildwrapper from our sonarqube scanner ( * Download Build Wrapper for Linux from {SonarQube URL}/static/cpp/build-wrapper-linux-x86.zip) unzip the scanner and set it as a build variable

So far we get the following errors:

2021-06-13T15:33:31.2413358Z 17:33:31.226 INFO: EXECUTION FAILURE
2021-06-13T15:33:31.2414330Z 17:33:31.226 INFO: ------------------------------------------------------------------------
2021-06-13T15:33:31.2415233Z 17:33:31.226 INFO: Total time: 4:24.658s
2021-06-13T15:33:31.4233639Z 17:33:31.414 INFO: Final Memory: 33M/154M
2021-06-13T15:33:31.4243655Z ##[error]17:33:31.414 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: D:\aCN\w\712\s****.h 48:24 48:36 S4963
2021-06-13T15:33:31.4246047Z 17:33:31.414 ERROR: Error during SonarScanner execution
2021-06-13T15:33:31.4247160Z java.lang.IllegalStateException: D:\aCN\w\712\s****.h 48:24 48:36 S4963
2021-06-13T15:33:31.4248369Z 17:33:31.414 INFO: ------------------------------------------------------------------------
2021-06-13T15:33:31.4260437Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:821)
2021-06-13T15:33:31.4264371Z at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:821)
2021-06-13T15:33:31.4267926Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:781)
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:644)
2021-06-13T15:33:31.4271097Z at com.sonar.cpp.plugin.CFamilySensor.save(CFamilySensor.java:781)
2021-06-13T15:33:31.4272594Z at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:644)
2021-06-13T15:33:31.4275379Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:540)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:358)
2021-06-13T15:33:31.4277752Z at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:540)
2021-06-13T15:33:31.4278779Z at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:358)
2021-06-13T15:33:31.4280685Z ##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
2021-06-13T15:33:31.4282753Z at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
2021-06-13T15:33:31.4284651Z ##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
2021-06-13T15:33:31.4286821Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
2021-06-13T15:33:31.4288723Z ##[error]at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
2021-06-13T15:33:31.4291395Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
2021-06-13T15:33:31.4293513Z ##[error]at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
2021-06-13T15:33:31.4295404Z at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
2021-06-13T15:33:31.4297998Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-06-13T15:33:31.4302404Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-06-13T15:33:31.4310504Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:389)
2021-06-13T15:33:31.4317626Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-06-13T15:33:31.4320403Z at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:389)
2021-06-13T15:33:31.4324713Z ##[error]at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:354)
2021-06-13T15:33:31.4328446Z at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
2021-06-13T15:33:31.4330322Z at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:354)
2021-06-13T15:33:31.4333343Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-06-13T15:33:31.4335626Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-06-13T15:33:31.4336750Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-06-13T15:33:31.4338512Z ##[error]at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
2021-06-13T15:33:31.4340365Z at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
2021-06-13T15:33:31.4342923Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-06-13T15:33:31.4345170Z at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
2021-06-13T15:33:31.4346309Z at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
2021-06-13T15:33:31.4350574Z ##[error]at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-06-13T15:33:31.4353607Z at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
2021-06-13T15:33:31.4354550Z at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
2021-06-13T15:33:31.4355650Z at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2021-06-13T15:33:31.4356771Z at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-06-13T15:33:31.4357868Z at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-06-13T15:33:31.4361106Z ##[error]at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-06-13T15:33:31.4363795Z at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-06-13T15:33:31.4365202Z at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-06-13T15:33:31.4366260Z at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-06-13T15:33:31.4367688Z ##[error]at com.sun.proxy.$Proxy0.execute(Unknown Source)
2021-06-13T15:33:31.4369161Z at com.sun.proxy.$Proxy0.execute(Unknown Source)
2021-06-13T15:33:31.4371366Z ##[error]at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-06-13T15:33:31.4373561Z at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-06-13T15:33:31.4374661Z at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-06-13T15:33:31.4376662Z ##[error]at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
2021-06-13T15:33:31.4378575Z at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
2021-06-13T15:33:31.4379475Z at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
2021-06-13T15:33:31.4380849Z ##[error]at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-06-13T15:33:31.4382466Z at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2021-06-13T15:33:31.4385052Z ##[error]Caused by: java.lang.IllegalArgumentException: 250 is not a valid line for pointer. File ///.h has 61 line(s)
at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
2021-06-13T15:33:31.4387857Z Caused by: java.lang.IllegalArgumentException: 250 is not a valid line for pointer. File ///.h has 61 line(s)
2021-06-13T15:33:31.4389104Z at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
2021-06-13T15:33:31.4392324Z ##[error]at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:336)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:272)
at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultInputFile.java:295)
2021-06-13T15:33:31.4394964Z at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:336)
2021-06-13T15:33:31.4396125Z at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:272)
2021-06-13T15:33:31.4397284Z at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultInputFile.java:295)
2021-06-13T15:33:31.4399689Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.rangeOrLine(CFamilySensor.java:917)
at com.sonar.cpp.plugin.CFamilySensor.lambda$reportIssueImpl$13(CFamilySensor.java:859)
2021-06-13T15:33:31.4401808Z at com.sonar.cpp.plugin.CFamilySensor.rangeOrLine(CFamilySensor.java:917)
2021-06-13T15:33:31.4402895Z at com.sonar.cpp.plugin.CFamilySensor.lambda$reportIssueImpl$13(CFamilySensor.java:859)
2021-06-13T15:33:31.4404623Z ##[error]at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
2021-06-13T15:33:31.4406464Z at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
2021-06-13T15:33:31.4408203Z ##[error]at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
2021-06-13T15:33:31.4410085Z at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
2021-06-13T15:33:31.4411769Z ##[error]at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2021-06-13T15:33:31.4413590Z at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2021-06-13T15:33:31.4416023Z ##[error]at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2021-06-13T15:33:31.4418238Z at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
2021-06-13T15:33:31.4420508Z at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2021-06-13T15:33:31.4422349Z ##[error]at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2021-06-13T15:33:31.4424326Z at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2021-06-13T15:33:31.4426716Z ##[error]at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
2021-06-13T15:33:31.4428887Z at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2021-06-13T15:33:31.4429970Z at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
2021-06-13T15:33:31.4431626Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.reportIssueImpl(CFamilySensor.java:865)
2021-06-13T15:33:31.4433437Z at com.sonar.cpp.plugin.CFamilySensor.reportIssueImpl(CFamilySensor.java:865)
2021-06-13T15:33:31.4435040Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:819)
2021-06-13T15:33:31.4436807Z at com.sonar.cpp.plugin.CFamilySensor.reportIssue(CFamilySensor.java:819)
2021-06-13T15:33:31.4437862Z ##[error]… 32 more
2021-06-13T15:33:31.4439099Z … 32 more

In another build we get this error:

##[error]16:51:38.969 ERROR:
##[debug]Processed: ##vso[task.logissue type=error;]16:51:38.969 ERROR:
16:51:38.969 ERROR:
##[error]An error occurred while analyzing the following compilation unit:
##[debug]Processed: ##vso[task.logissue type=error;]An error occurred while analyzing the following compilation unit:
An error occurred while analyzing the following compilation unit:
##[error]N:/aCR/w/975/s/////.cpp
##[debug]Processed: ##vso[task.logissue type=error;]N:/aCR/w/975/s/
////.cpp
N:/aCR/w/975/s/////**.cpp
##[error]A file named “sonar-cfamily-reproducer.zip” has been generated to help the problem investigation.
##[debug]Processed: ##vso[task.logissue type=error;]A file named “sonar-cfamily-reproducer.zip” has been generated to help the problem investigation.
A file named “sonar-cfamily-reproducer.zip” has been generated to help the problem investigation.
##[error]Please contact SonarSource support providing the following file to help improving the analyzer:
##[debug]Processed: ##vso[task.logissue type=error;]Please contact SonarSource support providing the following file to help improving the analyzer:
Please contact SonarSource support providing the following file to help improving the analyzer:
##[error]N:\aCR\w\975\sonar-cfamily-reproducer.zip
##[debug]Processed: ##vso[task.logissue type=error;]N:\aCR\w\975\sonar-cfamily-reproducer.zip
N:\aCR\w\975\sonar-cfamily-reproducer.zip

I could provide the SonarQube Support with the created zip file.

Thanks in advance.

Hello @Henning-R ,

I would need more information to understand the problem:

We want to manage to use the newest version of the SonarQube Scanner and Buildwrapper

Do you mean that it was working fine until you upgraded to version 8.9?

In which steps of your Azure DevOps pipelines do the errors occur?

In another build we get this error:

What do you do differently in comparison to the first error you get?

(and just in case: Azure DevOps Integration | SonarQube Docs)

Hello Amelie,

thank your for your response.

Do you mean that it was working fine until you upgraded to version 8.9?

No, we have the problem with SonarQube 8.7 and 8.9 on our local agents.

In which steps of your Azure DevOps pipelines do the errors occur?

The errors occure in the Run Code Analysis step.

In our previous configuration we “installed” the SonarScanner and BuildWrapper on our local agents. This means we created a folder and unzipped the build-wrapper-x86.exe and sonarscanner.exe to the folder and the system path variable. During our builds we were calling those path variables in powershell scripts instead of using the SonarQube tasks.

From now on we are using the SonarQube tasks and wrote a script that downloads the newest version of the buildwrapper from our SonarQube server and sets it as a build variable.

This seems to be a problem with our local agents. We managed to run the tests succesfully with SonarQube 8.9 on one of our cloud agents. But we still dont understand why we get those different results.

How can I send you the “sonar-cfamily-reproducer.zip” file in a private message?

Ok, so if I understood correctly, when you did everything manually, it worked. But now that you are using SonarQube tasks, you have these errors.

I sent you a PM for the reproducer