SonarQube is failing without any meaningful error message for a .NET C# project.
I tried running the end command with the -X option but the -X format is unrecognized.
SonarScanner.MSBuild.exe end -X /d:sonar.login="87195"
Any ideas on what could be wrong ? I ran a simpler project with 2 - 3 cs files and that succeeds.
:
:
INFO: Sensor Python Squid Sensor [python] (done) | time=1880ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=529ms
INFO: Sensor SonarCSS Metrics [cssfamily]
INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=9835ms
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 9:31.651s
ERROR: Error during SonarQube Scanner execution
ERROR: null
ERROR:
INFO: Final Memory: 26M/1008M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner did not complete successfully
14:53:45.844 Creating a summary markdown file...
14:53:45.847 Post-processing failed. Exit code: 1
Anybody landing on this page in search of a solution: OP has posted it on sonarqube forum as well and the solution is to disable css analysis. For larger projects sonarqube when installed as a server (instead of using cloud) is unable to handle the code analysis for css files resulting the error while it works fine on smaller projects.
You can disable css analysis either in the script; by telling Sonar that the css files have a different extension like .foo, or from the Administration
From script when SonarScanner.MSBuild.exe is run, add the following; /d:sonar.css.file.suffixes=.foo, like:
"C:\sonar-scanner-msbuild-4.3.1.1372-net46\SonarScanner.MSBuild.exe" begin /k:"MyApp" /d:sonar.css.file.suffixes=.foo /d:sonar.host.url="http://localhost:9000" /d:sonar.login="200dc9294n6bg4d4cc9bed30mj76fcb10d25ee17"
From SonarQube Adminstration, remove the .css suffix from the list:
The problem is still investigated by the Sonar team; https://community.sonarsource.com/t/sonarqube-post-processing-fails-with-unknown-reason/1798/6
The current answer excludes all .css files, but I started to look for a way to just exclude the offending .css files.
I encountered this issue on one project, but not on other projects. The difference between this one particular project was that it was using Kendo.UI and the library has relatively massive .css files. However, when I tried to exclude these files through the script, it would still fail. What worked the best in the end was adding SonarQube setting in the .csproj itself to exclude the many .css libraries that we had.
You would need to add the following to your .csproj to exclude these files:
<ItemGroup>
<SonarQubeSetting Include="sonar.exclusions">
<Value>**/LibraryNameHere/**</Value>
</SonarQubeSetting>
</ItemGroup>