Build stuck with an error
Azure build SQ Developer version:
SonarQube ID information
CompilerServer: server failed - server rejected the request due to analyzer / generator issues 'analyzer assembly 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\.sonarqube\resources\2\System.Buffers.dll' has MVID '36e84b0d-9d74-4086-a062-54e1963f24d5' but loaded assembly 'System.Buffers, Version=220.127.116.11, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' has MVID 'f389ca43-32bf-4e24-ad8c-a6ed5efddff3', analyzer assembly 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\.sonarqube\resources\2\System.Numerics.Vectors.dll' has MVID '95de52ab-0179-450a-9f6f-08d224d60b15' but loaded assembly 'System.Numerics.Vectors, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has MVID '34905ed1-db9d-4250-b31b-b80e1ff70ff5', analyzer assembly 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\.sonarqube\resources\2\System.Runtime.CompilerServices.Unsafe.dll' has MVID 'bd600ba8-23b5-4d45-ba63-f24457fa3be3' but loaded assembly 'System.Runtime.CompilerServices.Unsaf...
##[warning]OnlineForms\SeleniumTest.cs(57,33): Warning CS0168: The variable 'ex' is declared but never used
Have successful build at:
Docker Community version:
SonarQube ID information
what is the workaround?
& if i remove SQ tasks from the build, the build is successful
& successful & not are on a diff pc`s
it just blocks us to use what we payed for
We really need the full verbose logs. The log lines you gave tell us nothing about the real problem of the failure.
Please give us the following version information:
And we’ll need the logs:
- please give us the verbose output of the scanner commands (please run
SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the
- please give the output of running MSBuild in verbose mode (
Also, please tell us:
- what are the commands you are running to do the analysis? (sharing the pipeline yaml would help)
#Multi-configuration and multi-agent job options are not exported to YAML. Configure these options using documentation guidance: https://docs.microsoft.com/vsts/pipelines/process/phases
BuildPlatform: 'Mixed Platforms'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet '
- task: NuGetCommand@2
displayName: 'NuGet restore'
- task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare@5
displayName: 'Prepare analysis on SonarQube'
- task: VSBuild@1
displayName: 'Build solution 08Stuff.sln'
- task: SonarSource.sonarqube.6D01813A-9589-4B15-8491-8164AEB38055.SonarQubeAnalyze@5
displayName: 'Run Code Analysis'
- task: SonarSource.sonarqube.291ed61f-1ee4-45d3-b1b0-bf822d9095ef.SonarQubePublish@5
displayName: 'Publish Quality Gate Result'
@Andrei_Epure I also see that the caption of the topic was changed, basically I did not do any migrations, I just used the latest dev edition version on the server & when ran into the issue I installed the latest docker community version on my local pc to test, so as a conclusion - no migrations, just build with the version I could get
Did you cancel/stoped the build? I’ve noticed this in the logs and I would to know if this is to be expected:
warning MSB5021: Terminating the task executable "csc" and its child processes because the build was canceled.
As I’ve noticed that the build was stopped after 10 minutes, can I ask what is the exact problem? How long did the build take when analyzing with SQ 9.1 and how long does it take now?
yes, I cancelled the build, no reason to wait, it will never end (waited about 1 hour), without SQ it takes < 1 min
SQ 9.1 build takes: Time Elapsed 00:02:33.10
@Andrei_Epure @costin.zaharia i have updated my local docker version to sonarqube:9.2.4-community & the build stuck the same as on the server
Unfortunately with an unfinished build we don’t have enough information to figure out where the problem might be.
Visual studio outputs a nice report when
/p:reportanalyzer=true is set when
dotnet is called but only if the build finishes.
SonarQube 9.1 uses the 8.29 version of the analyzer and SonarQube 9.2.1 uses the 8.32 so the problem might be between one of these releases.
Looking at the logs, I see that indeed nothing happens for ~10 minutes (from
2022-01-26T12:32:29.2581288Z) which is not expected.
My first attempt would be to exclude from analysis these 5 projects which were built when the cancel was triggered and see if the problem disappears:
You can do that by adding the following in the csproj files:
<!-- in .csproj -->
<!-- Exclude the project from analysis -->
If the problem disappears, you can enable the analysis of the projects one by one to narrow down the problem.
I also have a few questions:
- are the projects open source?
- are code generators used in these projects or is there any other kind of generated code?
- is there anything else particular to these projects? (e.g. very large files, entity framework database migrations)
@Aleksandr_Kovalev : thanks a lot for your prompt response.
Could you please try to narrow down the problem by excluding the mentioned projects from the analysis? This might also be a work-around until we manage to find and fix the problem.
reviewed quickly, nothing special, just cs files
Based on what you found, would it be possible to create a reproducer for us?