Suddenly started failing with Post-processing failed. Exit code: 1

  • ALM used - Bitbucket Cloud
  • CI system used - Jenkins
  • Scanner command used - see below
  • Languages of the repository - C#, JavaScript, T-SQL
  • Error observed - see below
  • Steps to reproduce - Unclear. Every build seems to have this issue suddenly.
  • Potential workaround - Unclear.

We have a number of repositories - all of which use SonarCloud as part of their Jenkins pipelines. They are all various versions of .NET (framework, core, standard, etc). Yesterday, we noticed an error with one of the builds. I thought it might have been a fluke, or something specific to that repository. This morning, more builds are failing with the same error on sonarscanner end:

E:\jenkins_build_nodes\build01\workspace\PR-12336bd916f>dotnet sonarscanner end /d:sonar.login="****" 
SonarScanner for MSBuild 5.7.2
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarScanner CLI...
The SonarScanner did not complete successfully
10:58:43.341  Post-processing failed. Exit code: 1
script returned exit code 1

This started happening randomly at some point yesterday. Looks like last successful build was at 11:00am or so. All builds run on the same box. I am continuing to investigate internally but as this totally prevents us from proceeding with any builds or merging any PRs, I figured I’d ask for help from the experts.

How can I troubleshoot this?

I’ve tried adding /d:sonar.verbose to the command for more info but not getting much:


E:\jenkins_build_nodes\build01\workspace\main172fbb05>dotnet sonarscanner end /d:sonar.login="****" /d:sonar.verbose=true 
SonarScanner for MSBuild 5.7.2
Using the .NET Core version of the Scanner for MSBuild
Default properties file was found at C:\Tools\.store\dotnet-sonarscanner\5.7.2\dotnet-sonarscanner\5.7.2\tools\net5.0\any\SonarQube.Analysis.xml
Loading analysis properties from C:\Tools\.store\dotnet-sonarscanner\5.7.2\dotnet-sonarscanner\5.7.2\tools\net5.0\any\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Post-processing started.
13:26:47.162  Using environment variables to determine the download directory...
13:26:47.195  13:26:47.193  Uninstalling target: E:\jenkins_build_nodes\build01\workspace\main172fbb05\.sonarqube\bin\targets\SonarQube.Integration.targets
13:26:47.196  13:26:47.195  This setting is not valid in the "end" phase in this version of the C# plugin: sonar.verbose
13:26:47.196  Post-processing failed. Exit code: 1

Just sharing the sonarscanner begin command below, for reference:

        stage('SonarScanner Start Branch Scan') {
            when { not { changeRequest() } }
            steps {
                bat "dotnet sonarscanner begin /k:\"${SONAR_PROJECT}\" /o:\"myowner\" /s:\"${WORKSPACE}\\SonarQube.Analysis.xml\" \
                        /d:sonar.host.url=https://sonarcloud.io \
                        /d:sonar.login=\"${SONAR_TOKEN}\" \
                        /d:sonar.branch.name=\"${GIT_BRANCH}\" \
                        /d:sonar.cs.dotcover.reportsPaths=${CVG_OUT_FILE}"
            }
        }
        stage('SonarScanner Start PR Scan') {
            when { changeRequest() }
            steps {
                bat "dotnet sonarscanner begin /k:\"${SONAR_PROJECT}\" /o:\"myowner\" /s:\"${WORKSPACE}\\SonarQube.Analysis.xml\" \
                        /d:sonar.host.url=https://sonarcloud.io \
                        /d:sonar.login=\"${SONAR_TOKEN}\" \
                        /d:sonar.pullrequest.key=${CHANGE_ID} \
                        /d:sonar.pullrequest.branch=${CHANGE_BRANCH} \
                        /d:sonar.pullrequest.base=${CHANGE_TARGET} \
                        /d:sonar.pullrequest.provider=bitbucketcloud \
                        /d:sonar.pullrequest.bitbucketcloud.owner=${REPO_OWNER} \
                        /d:sonar.pullrequest.bitbucketcloud.repository=${REPO_NAME} \
                        /d:sonar.cs.dotcover.reportsPaths=${CVG_OUT_FILE}"
            }
        }

Hi @bdzevel - welcome to the community!

You need to set /d:sonar.verbose=true in the begin step. The begin and end steps will then both produce verbose logs.

Trying now. Stay tuned.

So I enabled verbose logging but I also realized there was an elastic agent deployed to the box two days back around the time our builds started failing. Perhaps it messed with a dependency or something. We uninstalled it and things started working. I’m going to dig deeper to try to ascertain the root cause… for now I’m still confused.

Ok, thanks for the update.

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