SonarQube in Azure DevOps Pipeline leads to error MSB6006: "csc.dll" exited with code 137

We are trying to use the SonarQube v5.5 extension in our Azure DevOps pipelines. The build runs fine as long as we do not include the pipeline task SonarQubePrepare in our azure-pipelines.yml file. As soon as we include the mentioned task, the MSBuild seems to end in a loop with the error error MSB6006: "csc.dll" exited with code 137 and then keeps trying to build the same project.

We did a little research and found that this could be related to a memory issue. We have allocated 16gb of ram to the build AgentPool. The only effect seems to be that the loop runs faster than before.

Has anyone encountered a similar problem?

Pipeline:

jobs:
    - job: 'BackendBuild'

    pool:
       name: 'xyz'

    workspace:
       clean: all

    steps:
       - checkout: git://$(repository) # Variable for repository name to checkout
         persistCredentials: true
         clean: true
       
       # Build runs fine without this task
       - task: SonarQubePrepare@5
         displayName: Prepare analysis with SonarQube (MSBuild)
         inputs:
            SonarQube: 'Sonarqube' # Service connection name
            scannerMode: 'MSBuild'
            projectKey: $(repository)
            projectName: $(repository)

       - task: DotNetCoreCLI@2
            displayName: 'Build projects'
            inputs:
               projects: '**/*.csproj'
               arguments: '--configuration Release'

Log:

##[warning]myproj.Domain.Email/Services/ViewRenderingService.cs(31,35): Warning S4457: Split this method into two, one handling parameters
check and the other handling the asynchronous code.
Services/ViewRenderingService.cs(31,35): warning S4457: Split this
method into two, one handling parameters check and the other handling
the asynchronous code.
[/azp/agent/_work/1/s/myproj.Domain.Email/myproj.Domain.Email.csproj]
Sonar: (myproj.Domain.Email.csproj) Project processed successfully
Sonar: Preparing for Razor compilation, moved files
(/azp/agent/_work/1/.sonarqube/out/9/Issues.json;/azp/agent/_work/1/.sonarqube/out/9/output-cs/encoding.pb;/azp/agent/_work/1/.sonarqube/out/9/output-cs/file-metadata.pb;/azp/agent/_work/1/.sonarqube/out/9/output-cs/metrics.pb;/azp/agent/_work/1/.sonarqube/out/9/output-cs/symrefs.pb;/azp/agent/_work/1/.sonarqube/out/9/output-cs/token-cpd.pb;/azp/agent/_work/1/.sonarqube/out/9/output-cs/token-type.pb;/azp/agent/_work/1/.sonarqube/out/9/ProjectInfo.xml) to /azp/agent/_work/1/.sonarqube/out/9.tmp. Sonar: After Razor
compilation, moved files
(/azp/agent/_work/1/.sonarqube/out/9/Issues.Views.json;/azp/agent/_work/1/.sonarqube/out/9/output-cs/file-metadata.pb)
to /azp/agent/_work/1/.sonarqube/out/9.Razor. Sonar: After Razor
compilation, moved files
(/azp/agent/_work/1/.sonarqube/out/9.tmp/Issues.json;/azp/agent/_work/1/.sonarqube/out/9.tmp/output-cs/encoding.pb;/azp/agent/_work/1/.sonarqube/out/9.tmp/output-cs/file-metadata.pb;/azp/agent/_work/1/.sonarqube/out/9.tmp/output-cs/metrics.pb;/azp/agent/_work/1/.sonarqube/out/9.tmp/output-cs/symrefs.pb;/azp/agent/_work/1/.sonarqube/out/9.tmp/output-cs/token-cpd.pb;/azp/agent/_work/1/.sonarqube/out/9.tmp/output-cs/token-type.pb;/azp/agent/_work/1/.sonarqube/out/9.tmp/ProjectInfo.xml)
to /azp/agent/_work/1/.sonarqube/out/9 and will remove the temporary
folder.
##[error]/usr/share/dotnet/sdk/3.1.420/Roslyn/Microsoft.CSharp.Core.targets(70,5): Error MSB6006: “csc.dll” exited with code 137.
/usr/share/dotnet/sdk/3.1.420/Roslyn/Microsoft.CSharp.Core.targets(70,5):
error MSB6006: “csc.dll” exited with code 137.
[/azp/agent/_work/1/s/myproj.Data/myproj.Data.csproj]
myproj.Domain.Messages →
/azp/agent/_work/1/s/myproj.Domain.Messages/bin/Release/netstandard2.1/myproj.Domain.Messages.dll
myproj.Domain.Email →
/azp/agent/_work/1/s/myproj.Domain.Email/bin/Release/netcoreapp3.1/myproj.Domain.Email.dll
Sonar: (myproj.Domain.Messages.csproj) Project processed successfully
myproj.Domain.Email →
/azp/agent/_work/1/s/myproj.Domain.Email/bin/Release/netcoreapp3.1/myproj.Domain.Email.Views.dll
myproj.backoffice.sts →
/azp/agent/_work/1/s/myproj.backoffice.sts/bin/Release/netcoreapp3.1/myproj.backoffice.sts.dll
Sonar: (myproj.backoffice.sts.csproj) Project processed successfully

Build FAILED.

Hey there.

What version of SonarQube (the server, not the scanner) are you using?

Hi Colin, Thanks for your reply. We are using (for our current product evaluation purpose) SonarQube 7.7 community in an Azure coud hosted environment.

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.7 → 7.9.6 → 8.9.8 → 9.5 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.