SonarCloudAnalyse started to fail constantly

Our sonarcloud yaml build has started to fail constantly on the SonarCloudAnalyze step with the only error shown below

We’re using the following yaml to build :

# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

name: $(majorVersion).$(minorVersion).$(Year:yy)$(DayOfYear).$(rev:r)

pool:
   vmImage: 'windows-2022'

variables:
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  majorVersion: '1'
  minorVersion: '8'
  targetStagingDirectory: '$(Build.ArtifactStagingDirectory)/develop'
  solution: '**/Solution.sln'
  NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
  sourceDirectory: $(Build.SourcesDirectory)

stages:
  - stage: Build
    displayName: 'Build and Test the API Projects' 
    jobs:
    - job: BuildJob
      displayName: 'Build API'
      steps:  

        - task: DotNetCoreCLI@2
          displayName: 'Restore'
          inputs:
              command: 'restore'
              projects: $(solution)
              feedsToUse: 'config'
              nugetConfigPath: 'nuget.config'
              verbosityRestore: 'Normal'
            
        - task: SonarCloudPrepare@1
          inputs:
              SonarCloud: '***)'
              organization: '***'
              scannerMode: 'MSBuild'
              projectKey: '***'
              projectName: '***'
              extraProperties: |
                sonar.exclusions=**/obj/**,**/*.dll
        
        - task: DotNetCoreCLI@2
          displayName: 'Build the project - $(buildConfiguration)'
          inputs:
            projects: '$(solution)'
            arguments: '--configuration $(BuildConfiguration) --no-restore /p:Version=$(Build.BuildNumber) /p:SolutionDir=$(sourceDirectory)'

        - task: DotNetCoreCLI@2
          displayName: 'Run unit tests - $(buildConfiguration)'
          inputs:
              command: test
              projects: '$(solution)'
              arguments: '--configuration $(BuildConfiguration) --no-build /p:SolutionDir=$(sourceDirectory)'

        - task: SonarCloudAnalyze@1
              
        - task: SonarCloudPublish@1
          inputs:
           pollingTimeoutSec: '300'

Any help would be greatly appreciated

Hey there.

Screenshots of lots are tough to decipher, and we can’t see where in the scanning process the error occurs. Can you provider a broader scope of text-based logs?

Here’s the full raw log, but there’s no mention of any error until the 3 lines screenshotted previously

rawlog.txt (881.4 KB)

You’re right – that’s not too revealing (and based on the little bit of logs I see in your screenshot, failing at a different place!)

Can you add sonar.verbose=true to the extraProperties of SonarCloudPrepare@1 and see if we find more details? This enables DEBUG logging.