Sonarqube Analyze task failure

Hi Team,
I have upgraded the sonarqube version from 8.5 to 9.9.6 as per the Documentation and when running the task to analyze facing below error.

Error from ado pipeline logs:
2024-06-26T17:10:34.8781533Z WARN: Missing blame information for the following files:
2024-06-26T17:10:34.8792866Z WARN: * services/imp/ManagementControls.ProcessApi.ImportService/Repository/ImportRepository.cs
2024-06-26T17:10:34.8793815Z WARN: * services/imp/Tests/ManagementControls.ProcessApi.ImportService.Tests/ImportProcessorTests.cs
2024-06-26T17:10:34.8794222Z WARN: * services/imp/ManagementControls.ProcessApi.ImportService/Business/ImportProcessor.cs
2024-06-26T17:10:34.8794974Z WARN: * services/imp/Tests/ManagementControls.ProcessApi.ImportService.Tests/Shared/Bootstrap.cs
2024-06-26T17:10:34.8795400Z WARN: * services/imp/Tests/ManagementControls.ProcessApi.ImportService.Tests/Shared/ServiceLocator.cs
2024-06-26T17:10:34.8795758Z WARN: This may lead to missing/broken features in SonarQube
2024-06-26T17:10:34.8916759Z INFO: CPD Executor Calculating CPD for 2 files
2024-06-26T17:10:34.9255766Z INFO: CPD Executor CPD calculation finished (done) | time=31ms
2024-06-26T17:10:35.0167672Z INFO: Load New Code definition
2024-06-26T17:10:35.2317844Z INFO: Load New Code definition (done) | time=218ms
2024-06-26T17:10:35.2389954Z INFO: Analysis report generated in 312ms, dir size=446.6 kB
2024-06-26T17:10:35.5403280Z INFO: Analysis report compressed in 297ms, zip size=96.6 kB
2024-06-26T17:10:35.9861702Z INFO: Analysis report uploaded in 453ms
2024-06-26T17:10:35.9917900Z INFO: ------------- Check Quality Gate status
2024-06-26T17:10:35.9922267Z INFO: Waiting for the analysis report to be processed (max 300s)
2024-06-26T17:10:52.0994669Z INFO: ------------------------------------------------------------------------
2024-06-26T17:10:52.0995012Z INFO: EXECUTION FAILURE
2024-06-26T17:10:52.0995821Z INFO: ------------------------------------------------------------------------
2024-06-26T17:10:52.1000062Z INFO: Total time: 37.667s
2024-06-26T17:10:52.1937839Z INFO: Final Memory: 38M/154M
2024-06-26T17:10:52.1938888Z INFO: ------------------------------------------------------------------------
2024-06-26T17:10:52.1944844Z ##[error]ERROR: Error during SonarScanner execution
2024-06-26T17:10:52.1946004Z ERROR: Error during SonarScanner execution
2024-06-26T17:10:52.1948095Z ##[error]ERROR: QUALITY GATE STATUS: FAILED - View details on https://hostname/dashboard?id=imp-mytrack&branch=users%2Famair%2Fsonarqube10.5-enterprise
ERROR:
2024-06-26T17:10:52.1949172Z ERROR: QUALITY GATE STATUS: FAILED - View details on https://hostname/dashboard?id=imp-mytrack&branch=users%2Famair%2Fsonarqube10.5-enterprise
2024-06-26T17:10:52.1949542Z ERROR:
2024-06-26T17:10:52.7510879Z ##[error]The SonarScanner did not complete successfully
2024-06-26T17:10:52.7511562Z The SonarScanner did not complete successfully
2024-06-26T17:10:52.7514165Z ##[error]17:10:52.749 Post-processing failed. Exit code: 1
2024-06-26T17:10:52.7515024Z 17:10:52.749 Post-processing failed. Exit code: 1
2024-06-26T17:10:52.7607740Z ##[warning]LIB_ResourceFile does not exist
2024-06-26T17:10:52.7609251Z ##[warning]Resource file haven’t been set, can’t find loc string for key: LIB_ProcessExitCode
2024-06-26T17:10:52.7618279Z ##[warning]Error while executing SonarQube:Analyze task: LIB_ProcessExitCode F:\builds\agent2_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.19.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe 1
2024-06-26T17:10:52.7619955Z ##[error]LIB_ProcessExitCode F:\builds\agent2.

The yaml task used :

  • task: SonarQubePrepare@5
    inputs:
    SonarQube: ‘SonarQube-Enterprise9.9’
    scannerMode: ‘MSBuild’ # Default is MSBuild, no change needed here
    projectKey: $(SonarQProjectKey) # Ensure $(SonarQProjectKey) is properly set in your pipeline variables
    projectName: $(SonarQProjectName) # Ensure $(SonarQProjectName) is properly set in your pipeline variables
    configMode: ‘file’ # Default is ‘file’, no change needed unless you use manual mode
    extraProperties: |
    sonar.qualitygate.wait=true
    sonar.qualitygate.timeout=300
    enabled: true

  • task: SonarQubeAnalyze@5
    enabled: true
    inputs:
    extraProperties: |
    sonar.verbose=true
    # Add any other analysis-specific properties here

  • task: SonarQubePublish@5
    inputs:
    pollingTimeoutSec: ‘6000’
    enabled: true.
    what changes need be done on sonarqube side or yaml task no clues but its posting the results of analyze in sonarqube server and redirect url from pipeline result is also working as expected. however task is failing with other error apart from quality gate failure.

Hey there.

The task is expected to exit in failure if this is set (and the Quality Gate fails on the SonarQube server). This is also how it worked in SonarQube v8.9 LTS.

Are you expecting the Quality Gate not to fail? Am I misunderstanding the issue?

The condition to fail the pipeline if quality gate fails and pass could be change. Im more concern about the error below quality gate fail as per the below snip referring does anything else need to fix apart from code?


Sonarscanner did not complete ?
Post processing failed ?
process exit code ?

Hey there.

They should be safe to ignore, unless they are also failing your build when the QG passes.

I’ve flagged this for attention because I’ve seen a few user-proivded logs with these LIB_ not found errors since the latest version of the Extension for Azure DevOps.

I have checked by decrease the condition values to pass QG and it is passing the task. It can be Ignored as said
thanks Colin.

Hello @amair,

I am really sorry for the late response.

In your examples, the scanner was executed successfully.
However, the error messages are misleading.

I have created a ticket to fix this misleading message for this scenario.

Thank you for reporting this issue!