SonarCloud.Scanner 9.0.1 newest release 10-25-2024 not working

Since Friday the 25th if October our pipelines failed due to the new version of SonarCloud.Scanner 9.0.1
Release note: Hotfix release to address wrong sonar.projectBaseDir path detection when running on AzureDevOps on Unix-based systems.
=> That’s exactly what is going wrong

If I downgrade to 9.0.0 the SonarCloud.Scanner everything works ok!

Here are a few files not recognized by the Scanner:

2024-10-29T12:49:53.7606670Z 12:49:53.738 WARNING: File '/Users/runner/work/1/src/Source/MWR.MAUI/ViewModels/Tab_Receipts/ReceiptViewModel.cs' is not located under the base directory '/Users/runner/work/1/s' and will not be analyzed.

2024-10-29T12:49:53.7607780Z 12:49:53.739 WARNING: File '/Users/runner/work/1/src/Source/MWR.MAUI/Resources/Raw/AboutAssets.txt' is not located under the base directory '/Users/runner/work/1/s' and will not be analyzed.

2024-10-29T12:49:53.7609580Z 12:49:53.739 WARNING: File '/Users/runner/work/1/src/Source/MWR.MAUI/Resources/Raw/Fallback/ConversionData.json' is not located under the base

2024-10-29T12:49:53.8063760Z 12:49:53.788 WARNING: File '/Users/runner/work/1/src/Source/MWR.MAUI/Resources/Splash/splash.svg' is not located under the base directory '/Users/runner/work/1/s' and will not be analyzed.

2024-10-29T12:49:53.8065030Z 12:49:53.789 No analysable projects were found. SonarCloud analysis will not be performed. Check the build summary report for details.

2024-10-29T12:49:53.8065750Z 12:49:53.79 Generation of the sonar-properties file failed. Unable to complete the analysis.

2024-10-29T12:49:53.8066350Z 12:49:53.8 Post-processing failed. Exit code: 1

2024-10-29T12:49:53.8099580Z ##[error]MCC:ERROR - (mcc-stap-build-apps.lib:sonarcloud-analyse:400) Whoaah, 'dotnet-sonarscanner end' FAILS! Ouchh!

2024-10-29T12:49:53.8590810Z ##[error]Bash exited with code '255'.

2024-10-29T12:49:53.8616430Z ##[error]12:49:53.789 No analysable projects were found. SonarCloud analysis will not be performed. Check the build summary report for details.

2024-10-29T12:49:53.8618300Z ##[error]12:49:53.8 Post-processing failed. Exit code: 1

2024-10-29T12:49:53.8637870Z ##[section]Finishing: Build iOS/Android app

Hi,

Welcome to the community!

Can we have the full analysis log, please?

 
Thx,
Ann

Hi Tino,

As Ann suggested, we would need the full analysis logs, in verbose mode to better understand the problem. You can enable the verbose mode by setting the sonar.verbose parameter to true.

From what I noticed in your logs, the sonar.projectBaseDir is automatically set to the Build.SourcesDirectory Azure DevOps predefined variable (/Users/runner/work/1/s).

At the same time, your sources are stored elsewhere, on: /Users/runner/work/1/src.

Since the sources are not located in the project base directory, they cannot be analyzed.

Would it be possible to clone the project in the Build.SourcesDirectory as documented on Azure?

This would be a temporary solution until we implement SCAN4NET-152 and you will be able to manually set the projectBaseDir to the directory you want.

1 Like