Unable to get analysis in sonarqube

Hello Team,

Now i am facing a new thing. My analysis is not going to SonarQube after the build is successful.

Push event to branch sonarqube-scanning-changes
10:10:15 Connecting to https://github.ibm.com/api/v3 using wlcdevus@us.ibm.com/****** (github-creds-for-wlcdevus-user)
Obtained Jenkinsfile from 7dd6e6172bedd461a670ee1b9712b292a77f2b48
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in C:\Jenkins\workspace\r-job_sonarqube-scanning-changes
[Pipeline] {
[Pipeline] stage
[Pipeline] { (SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential github-creds-for-wlcdevus-user
 > git.exe rev-parse --resolve-git-dir C:\Jenkins\workspace\r-job_sonarqube-scanning-changes\.git # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url https://github.ibm.com/watsonmedia-wlc/wlc-client-gbs.git # timeout=10
Fetching without tags
Fetching upstream changes from https://github.ibm.com/watsonmedia-wlc/wlc-client-gbs.git
 > git.exe --version # timeout=10
 > git --version # 'git version 2.29.2.windows.3'
using GIT_ASKPASS to set credentials github-creds-for-wlcdevus-user
 > git.exe fetch --no-tags --force --progress -- https://github.ibm.com/watsonmedia-wlc/wlc-client-gbs.git +refs/heads/sonarqube-scanning-changes:refs/remotes/origin/sonarqube-scanning-changes +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision 7dd6e6172bedd461a670ee1b9712b292a77f2b48 (sonarqube-scanning-changes)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f 7dd6e6172bedd461a670ee1b9712b292a77f2b48 # timeout=10
Commit message: "updated"
 > git.exe rev-list --no-walk 3ad7c5d9fe10703b86dcececfecd7c79e1472cdd # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Download Build Wrapper)
[Pipeline] powershell
Folder Exists
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] powershell
Microsoft (R) Build Engine version 12.0.40629.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2/23/2023 10:10:21 AM.
Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.sln" (1) is building "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Creating "C:\Jenkins\workspace\client-gbs-sonar-job_master\\build\LiveCaptioning\x64\Release\LiveCaptioning.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  All outputs are up-to-date.
ResourceCompile:
  All outputs are up-to-date.
Link:
  All outputs are up-to-date.
  LiveCaptioning.vcxproj -> C:\Jenkins\workspace\client-gbs-sonar-job_master\\target\Max\x64\Release\LiveCaptioning.exe
PostBuildEvent:
  xcopy /D /R /Y C:\Jenkins\workspace\client-gbs-sonar-job_master\install\runtime\x64\* C:\Jenkins\workspace\client-gbs-sonar-job_master\target\Max\x64\Release\
  
  :VCEnd
  0 File(s) copied
FinalizeBuildStatus:
  Deleting file "C:\Jenkins\workspace\client-gbs-sonar-job_master\\build\LiveCaptioning\x64\Release\LiveCaptioning.tlog\unsuccessfulbuild".
  Touching "C:\Jenkins\workspace\client-gbs-sonar-job_master\\build\LiveCaptioning\x64\Release\LiveCaptioning.tlog\LiveCaptioning.lastbuildstate".
Done Building Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.vcxproj" (default targets).
Done Building Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.00
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube Analysis)
[Pipeline] tool
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: SonarQubeServer
[Pipeline] {
[Pipeline] powershell
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline

GitHub has been notified of this commit’s build result

Finished: SUCCESS

Hey there.

How is your Jenkins pipeline configured? Feel free to paste the configuration here. It doesn’t look like any SonarQube analysis is actually run.

Hello Collin,

Below is the jenkinsfile

node {
  stage('SCM') {
    checkout scm
  }
  stage('Download Build Wrapper') {
    powershell '''
      $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
      rm build-wrapper-win-x86 -Recurse -Force -ErrorAction SilentlyContinue
      rm $path -Force -ErrorAction SilentlyContinue
      $FolderName = "$HOME/.sonar"
      if (Test-Path $FolderName) {
         Write-Host "Folder Exists"    
         }
      else
      {
        New-Item $FolderName -ItemType Directory
        Write-Host "Folder Created successfully"
        }  
      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
      (New-Object System.Net.WebClient).DownloadFile("https://sonar-travis.watsonmedia.ibm.com/static/cpp/build-wrapper-win-x86.zip", $path)
      Add-Type -AssemblyName System.IO.Compression.FileSystem
      [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
    '''
  }
  stage('Build') {
    powershell '''
      $env:Path += ";$HOME/.sonar/build-wrapper-win-x86"
      build-wrapper-win-x86-64.exe --out-dir bw-output "C:\\Program Files (x86)\\MSBuild\\12.0\\Bin\\MSBuild.exe" "C:\\Jenkins\\workspace\\client-gbs-sonar-job_master\\LiveCaptioning.sln" -p:Configuration=Release
    '''
  }
  stage('SonarQube Analysis') {
    def scannerHome = tool 'sonarScanner';
    withSonarQubeEnv('SonarQubeServer') {
      powershell "${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
    }
  }
}

Collin,
the console out is very long so pasting from last after it build the code/project.

43\target\Max\x64\Release\lib.pdb'; linking object as if no debug info [C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.vcxproj]
  ssleay32.lib(t1_reneg.obj) : warning LNK4099: PDB 'lib.pdb' was not found with 'ssleay32.lib(t1_reneg.obj)' or at 'C:\Jenkins\workspace\client-gbs-sonar-job_master\target\Max\x64\Release\lib.pdb'; linking object as if no debug info [C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.vcxproj]

    867 Warning(s)
    0 Error(s)

Time Elapsed 00:03:14.10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube Analysis)
[Pipeline] tool
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: SonarQubeServer
[Pipeline] {
[Pipeline] powershell
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline

GitHub has been notified of this commit’s build result

Finished: SUCCESS

It appears nothing is happening here. What happens if you try and use bat instead of powershell?

so you mean by adding the powershell command as

sonar-scanner.bat -D"sonar.projectKey=test-gbs" -D"sonar.sources=." -D"sonar.cfamily.build-wrapper-output=bw-output" -D"sonar.host.url=https://sonar-travis.watsonmedia.ibm.com" -D"sonar.login=xxxxxxxx"
Push event to branch sonarqube-scanning-changes
07:18:29 Connecting to https://github.ibm.com/api/v3 using wlcdevus@us.ibm.com/****** (github-creds-for-wlcdevus-user)
Obtained Jenkinsfile from 2fcc35b975c15b022d0520cfd90f6ae8224103e5
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in C:\Jenkins\workspace\r-job_sonarqube-scanning-changes
[Pipeline] {
[Pipeline] stage
[Pipeline] { (SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential github-creds-for-wlcdevus-user
 > git.exe rev-parse --resolve-git-dir C:\Jenkins\workspace\r-job_sonarqube-scanning-changes\.git # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url https://github.ibm.com/watsonmedia-wlc/wlc-client-gbs.git # timeout=10
Fetching without tags
Fetching upstream changes from https://github.ibm.com/watsonmedia-wlc/wlc-client-gbs.git
 > git.exe --version # timeout=10
 > git --version # 'git version 2.29.2.windows.3'
using GIT_ASKPASS to set credentials github-creds-for-wlcdevus-user
 > git.exe fetch --no-tags --force --progress -- https://github.ibm.com/watsonmedia-wlc/wlc-client-gbs.git +refs/heads/sonarqube-scanning-changes:refs/remotes/origin/sonarqube-scanning-changes +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision 2fcc35b975c15b022d0520cfd90f6ae8224103e5 (sonarqube-scanning-changes)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f 2fcc35b975c15b022d0520cfd90f6ae8224103e5 # timeout=10
Commit message: "updated changes"
 > git.exe rev-list --no-walk 9553169319ff353257a4ae42af943139cdc83b1c # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Download Build Wrapper)
[Pipeline] powershell
Folder Exists
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] powershell
Microsoft (R) Build Engine version 12.0.40629.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2/27/2023 7:18:35 AM.
Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".

Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.sln" (1) is building "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Creating "C:\Jenkins\workspace\client-gbs-sonar-job_master\\build\LiveCaptioning\x64\Release\LiveCaptioning.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  All outputs are up-to-date.
ResourceCompile:
  All outputs are up-to-date.
Link:
  All outputs are up-to-date.
  LiveCaptioning.vcxproj -> C:\Jenkins\workspace\client-gbs-sonar-job_master\\target\Max\x64\Release\LiveCaptioning.exe
PostBuildEvent:
  xcopy /D /R /Y C:\Jenkins\workspace\client-gbs-sonar-job_master\install\runtime\x64\* C:\Jenkins\workspace\client-gbs-sonar-job_master\target\Max\x64\Release\
  
  :VCEnd
  0 File(s) copied
FinalizeBuildStatus:
  Deleting file "C:\Jenkins\workspace\client-gbs-sonar-job_master\\build\LiveCaptioning\x64\Release\LiveCaptioning.tlog\unsuccessfulbuild".
  Touching "C:\Jenkins\workspace\client-gbs-sonar-job_master\\build\LiveCaptioning\x64\Release\LiveCaptioning.tlog\LiveCaptioning.lastbuildstate".
Done Building Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.vcxproj" (default targets).
Done Building Project "C:\Jenkins\workspace\client-gbs-sonar-job_master\LiveCaptioning.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.03
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube Analysis)
[Pipeline] bat

C:\Jenkins\workspace\r-job_sonarqube-scanning-changes>C:\Users\jenkins-user\sonar-scanner-cli-4.8.0.2856-windows\sonar-scanner-4.8.0.2856-windows\bin\sonar-scanner.bat -D sonar.projectKey=wlc-client-gbs -D sonar.sources=. -D sonar.cfamily.build-wrapper-output=bw-output -D sonar.host.url=https://sonar-travis.watsonmedia.ibm.com -D sonar.login=e155ee313364b08bc819219a50c39461e602822a 
INFO: Scanner configuration file: C:\Users\jenkins-user\sonar-scanner-cli-4.8.0.2856-windows\sonar-scanner-4.8.0.2856-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Jenkins\workspace\r-job_sonarqube-scanning-changes\sonar-project.properties
INFO: SonarScanner 4.8.0.2856
INFO: Java 11.0.17 Eclipse Adoptium (64-bit)
INFO: Windows Server 2019 10.0 amd64

INFO: User cache: C:\Users\jenkins-user\.sonar\cache

INFO: Analyzing on SonarQube server 9.3.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"

INFO: Load global settings
INFO: Load global settings (done) | time=263ms
INFO: Server id: 02F7F878-AX9k5iOh_87oPZdznDUY
INFO: User cache: C:\Users\jenkins-user\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=122ms
INFO: Load/download plugins (done) | time=386ms
INFO: Loaded core extensions: developer-scanner

INFO: Process project properties
INFO: Process project properties (done) | time=15ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=16ms
INFO: Project key: wlc-client-gbs
INFO: Base dir: C:\Jenkins\workspace\r-job_sonarqube-scanning-changes
INFO: Working dir: C:\Jenkins\workspace\r-job_sonarqube-scanning-changes\.scannerwork
INFO: Load project settings for component key: 'wlc-client-gbs'
INFO: Load project settings for component key: 'wlc-client-gbs' (done) | time=47ms
INFO: Load project branches
INFO: Load project branches (done) | time=32ms
INFO: Load project pull requests

INFO: Load project pull requests (done) | time=31ms
INFO: Load branch configuration
INFO: Detected branch/PR in 'Jenkins'
INFO: Auto-configuring branch 'sonarqube-scanning-changes'
INFO: Load branch configuration (done) | time=6ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=138ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load active rules

INFO: Load active rules (done) | time=1507ms
INFO: Branch name: sonarqube-scanning-changes
INFO: Indexing files...
INFO: Project configuration:

INFO: 3942 files indexed
INFO: 228 files ignored because of scm ignore settings
INFO: Quality profile for c: Sonar way
INFO: Quality profile for cpp: Sonar way
INFO: Quality profile for py: Sonar way
INFO: ------------- Run sensors on module wlc-client-gbs
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=46ms

INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=0ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=101ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=22ms
INFO: Sensor Text Sensor [text]
INFO: 3855 source files to be analyzed
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxRegistryKey.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Load project repositories
INFO: Load project repositories (done) | time=53ms

WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxStringList.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxRefCounter.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Logging/WxLogContentId.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxSerializationParams.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Logging/WxLog.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxAssert.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxErrorManager.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/ThirdParty/boost/format/alt_sstream_impl.hpp at line 176 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxHttpServer.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.

WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/Http/WxLiveCaptionsHttp.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/Http/ServiceInfo.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxClassFactory.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/Http/Dashboard.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxTimeSpecification.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxClassInfo.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxPixelFormat.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxVersion.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.

WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxSysUtils.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Logging/WxLogMessage.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxSerializable.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxStreamNode.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxBitmap.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/File/WxFileUtilities.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxTime.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Logging/WxLogSimpleFilter.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxHttpResourceHandler.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Basic/WxTimeFormatterRule.h at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.

WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxHttpServer.cpp at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file C:/Jenkins/workspace/r-job_sonarqube-scanning-changes/WxKernel/Shared/Utility/WxHttpResourceHandler.cpp at line 2 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 3855/3855 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=5286ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=32ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor Python Sensor [python]
WARN: Your code is analyzed as compatible with python 2 and 3 by default. This will prevent the detection of issues specific to python 2 or python 3. You can get a more precise analysis by setting a python version in your configuration via the parameter "sonar.python.version"
INFO: Starting global symbols computation
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Starting rules execution
INFO: 1 source file to be analyzed

INFO: 1/1 source file has been analyzed
INFO: Sensor Python Sensor [python] (done) | time=2445ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=399ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=311ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=19ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=10ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=16ms
INFO: Sensor Python HTML templates processing [securitypythonfrontend]
INFO: Sensor Python HTML templates processing [securitypythonfrontend] (done) | time=47ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=15ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=16ms
INFO: Sensor CFamily [cpp]
INFO: CFamily plugin version: 6.30.0.42324
INFO: Using build-wrapper output: C:\Jenkins\workspace\r-job_sonarqube-scanning-changes\bw-output\build-wrapper-dump.json
INFO: Available processors: 8
WARN: 
CFamily plugin supports multithreaded analysis:

* to enable multithreaded analysis
  please specify the number of threads to use
  by setting the following property to your analysis:
  sonar.cfamily.threads=number_of_threads

* if you do not want to enable multithreading
  please explicitly disable it
  by setting the following property to your analysis:
  sonar.cfamily.threads=1

* visit the documentation page for more information
  https://sonar-travis.watsonmedia.ibm.com/documentation/analysis/languages/cfamily/

INFO: Using 1 thread for analysis according to value of "sonar.cfamily.threads" property.

WARN: 
CFamily plugin supports incremental analysis with the use of a cache:

* if you do not want to enable cache
  please explicitly disable it
  by setting the following property to your analysis:
  sonar.cfamily.cache.enabled=false

* to enable cache please specify the following 2 options:
  sonar.cfamily.cache.enabled=true
  sonar.cfamily.cache.path=relative_or_absolute_path_to_cache_location

* visit the documentation page for more information
  https://sonar-travis.watsonmedia.ibm.com/documentation/analysis/languages/cfamily/

INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
INFO: SE: 0 out of 0
INFO: Z3 refutation rate: 0 out of 0
INFO: Subprocess(es) done in 23ms
INFO: 0 compilation units analyzed

INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 49.121s
INFO: Final Memory: 71M/250M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
  * you are using the latest version of the build-wrapper and the CFamily analyzer
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:479)
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:183)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:79)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:384)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:380)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:349)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	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(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$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: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1

GitHub has been notified of this commit’s build result

Finished: FAILURE

Well, at least the SonarQube scan is actually executing now.

Are you sure you’re executing a clean build of your project? Looking all the logs you shared, not much is happening when you compile.

A clean build is required.

:warning: Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported. :smiley:

Hey Collin,

The code hasn’t been changed and it has build the project once and after that if nothing changed in code then it will show you the above output.
I tried to build the code locally as well and its still not able to send the analysis to Sonarqube.
The error i am getting is

05:56:53.313 INFO: CPD Executor CPD calculation finished (done) | time=4886ms
05:57:02.091 INFO: Analysis report generated in 6550ms, dir size=55.5 MB
05:59:13.103 INFO: Analysis report compressed in 131012ms, zip size=16.7 MB
05:59:13.103 INFO: Analysis report generated in C:\Users\Administrator\Documents\wlc-client-gbs\.scannerwork\scanner-report
05:59:13.111 DEBUG: Upload report
05:59:13.263 INFO: ------------------------------------------------------------------------
05:59:13.263 INFO: EXECUTION FAILURE
05:59:13.263 INFO: ------------------------------------------------------------------------
05:59:13.263 INFO: Total time: 47:21.438s
05:59:13.348 INFO: Final Memory: 73M/260M
05:59:13.348 INFO: ------------------------------------------------------------------------
05:59:13.348 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to upload report: Fail to request url: https://sonar-travis.watsonmedia.ibm.com/api/ce/submit?projectKey=test-gbs
        at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:207)
        at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:142)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
        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(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$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.lang.IllegalStateException: Fail to request url: https://sonar-travis.watsonmedia.ibm.com/api/ce/submit?projectKey=test-gbs
        at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:205)
        at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:155)
        at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:114)
        at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call(DefaultScannerWsClient.java:73)
        at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:205)
        ... 21 more
Caused by: okhttp3.internal.http2.StreamResetException: stream was reset: NO_ERROR
        at okhttp3.internal.http2.Http2Stream.checkOutNotClosed$okhttp(Http2Stream.kt:646)
        at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame(Http2Stream.kt:557)
        at okhttp3.internal.http2.Http2Stream$FramingSink.write(Http2Stream.kt:532)
        at okio.ForwardingSink.write(ForwardingSink.kt:29)
        at okhttp3.internal.connection.Exchange$RequestBodySink.write(Exchange.kt:218)
        at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:255)
        at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:194)
        at okhttp3.RequestBody$Companion$asRequestBody$1.writeTo(RequestBody.kt:167)
        at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.kt:157)
        at okhttp3.MultipartBody.writeTo(MultipartBody.kt:93)
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:59)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:222)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:203)
        ... 25 more

I need to get this project into Sonarqube, after this i will be able to estimate the lines of code. We need to take a call for developer edition license whether we should go for 2M or 5M lines.
That License is due on 6th March 2023.

Hey there.

A clean build will ultimately be required for performing SonarQube analysis, regardless of whether something has changed or not.

This looks like a different error, where the reverse proxy sitting in front of your SonarQube server (serving it over HTTPS) is resetting the stream. Is there any information in the logs of your proxy as to why the stream was reset? (Timeout, too large a file being uploaded…)

Colin,
i have added the rebuild parameter in build command and now its building the code everytime but the new error comes into picture.

2:52:53.800 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
  * you are using the latest version of the build-wrapper and the CFamily analyzer
  * you are correctly invoking the scanner with correct configuration
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * you are providing the path to the correct build-wrapper output directory
  * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:482)
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:183)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:79)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:384)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:380)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:349)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	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(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$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)
02:52:53.800 ERROR: 
02:52:53.800 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1

GitHub has been notified of this commit’s build result

Finished: FAILURE