SonarQube error

Good day,
I am running SonarQube in azure environment for analyze C++ project and I got the error. Would you please help and explain how to fix it.

Starting: SonarQubeAnalyze
==============================================================================
Task         : Run Code Analysis
Description  : Run scanner and upload the results to the SonarQube server.
Version      : 5.20.0
Author       : sonarsource
Help         : Version: 5.20.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
openssl config failed: error:25078067:DSO support routines:win32_load:could not load the shared library
C:\Windows\system32\cmd.exe /D /S /C "C:\agent\_work\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\5.20.0\sonar-scanner\bin\sonar-scanner.bat"
##[error]NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED
INFO: Scanner configuration file: C:\agent\_work\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\5.20.0\sonar-scanner\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\agent\_work\4\s\sonar-project.properties
INFO: SonarScanner 4.8.1.3023
INFO: Java 17.0.10 Microsoft (64-bit)





	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
##[error]Caused by: java.nio.file.NoSuchFileException: C:\agent\_work\4\s\bw_output\build-wrapper-dump.json
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
	at java.base/java.nio.file.Files.newInputStream(Files.java:160)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2922)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2955)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.getReader(BuildWrapperJsonReader.java:95)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.readCaptures(BuildWrapperJsonReader.java:56)
	... 34 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Caused by: java.nio.file.NoSuchFileException: C:\agent\_work\4\s\bw_output\build-wrapper-dump.json
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
	at java.base/java.nio.file.Files.newInputStream(Files.java:160)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2922)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2955)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.getReader(BuildWrapperJsonReader.java:95)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.readCaptures(BuildWrapperJsonReader.java:56)
	... 34 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
##[error]The process 'C:\agent\_work\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\5.20.0\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
Finishing: SonarQubeAnalyze

Hey there.

As mentioned in the template post, what version of SonarQube are you using?

Hi Colin,

We are using Developer Edition Version 10.3 (build 82913)

Thank you

Thanks!

In any case it looks like you’ve set sonar.cfamily.build-wrapper-output to a path that doesn’t exist.

Caused by: java.nio.file.NoSuchFileException: C:\agent\_work\4\s\bw_output\build-wrapper-dump.json

Are you actually running the build wrapper in your pipeline? Can you share your Azure Pipelines YML file?

Hi Colin,

Thank you very much for your answer.

this is part of my yml file.

      - task: SonarQubePrepare@5
        env:
          SONAR_SCANNER_OPTS: --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -Xmx512m
          JDK_JAVA_OPTIONS: --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -Xmx512m
          JAVA_OPTS: --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -Xmx512m
          CATALINA_OPTS = -Xms512M -Xmx1024M -server -XX: + UseParallelGC
        inputs:
          SonarQube: 'SonarQube Development Server'
          scannerMode: 'CLI'
          configMode: 'file'
          cliProjectKey: 'Nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-qm'
          cliSources: '.'
          extraProperties: "sonar.cfamily.build-wrapper-output=bw_output"
          projectName: 'Nxxx III Client App'
          projectVersion: '0.0.1'        
          ProjectKey: 'Nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-qm'


      - task: SonarQubeAnalyze@5
        inputs:
          jdkversion: 'JAVA_HOME_17_X64'

      - task: SonarQubePublish@5
        inputs:
          pollingTimeoutSec: '300'          


	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: java.nio.file.NoSuchFileException: C:\agent\_work\15\s\bw_output\build-wrapper-dump.json
##[error]at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
	at java.base/java.nio.file.Files.newInputStream(Files.java:160)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2922)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2955)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.getReader(BuildWrapperJsonReader.java:95)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.readCaptures(BuildWrapperJsonReader.java:56)
	... 34 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)
	at java.base/java.nio.file.Files.newInputStream(Files.java:160)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2922)
	at java.base/java.nio.file.Files.newBufferedReader(Files.java:2955)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.getReader(BuildWrapperJsonReader.java:95)
	at com.sonar.cpp.plugin.BuildWrapperJsonReader.readCaptures(BuildWrapperJsonReader.java:56)
	... 34 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
##[error]The process 'C:\agent\_work\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\5.20.0\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
Finishing: SonarQubeAnalyze

So it looks like the answer to this is No.

You may want to look at some other posts in this forum, like this one!

Hello Colin,

Thank you for your help.

Are you actually running the build wrapper in your pipeline?

not yet because I would like to make pipeline works first and add build wrapper after this.
I did try to add build wrapper and I saw it is using unzip and curl, windows 10 doesn’t have unzip, let me know please must I install cygwin ?

Can you share your Azure Pipelines YML file?
Yes, I would like to send it by PM or email.

Thank you

Expand-Archive also works, as in the post I referenced.

In order for analysis to succeed, you’ll need to add in the build wrapper as documented.