Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects. #1437

Closed
aram000111 opened this issue Jun 3, 2018 · 2 comments
Assignees

Comments

@aram000111
Copy link

aram000111 commented Jun 3, 2018

Description

Jenkins pipeline fails with SonarQube analysis.

Repro steps

bat '''cd "%WORKSPACE%\master"
D:\SonarMSBuild\SonarScanner.MSBuild.exe begin /k:STAT /n:STAT /v:1.0 /d:sonar.verbose=true'''
bat '''cd "%WORKSPACE%\master"
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" %WORKSPACE%\master\StateFilings.sln /t:Rebuild /p:Configuration=QA /p:OutputPath=obj\QA /p:Platform="Any CPU" /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}'''
bat '''cd "%WORKSPACE%\master"
D:\SonarMSBuild\SonarScanner.MSBuild.exe end'''

FullLog.txt
SonarQube out file "ProjectInfo" has the following content:
Product projects

Test projects

Invalid projects

{none}

Skipped projects

{none}

Excluded projects

{none}

Expected behavior

Successful Build

Actual behavior

The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:

  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 upwards are supported
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)

Known workarounds

Please provide a description of any known workarounds.

Related information

@valhristov
Copy link
Contributor

On line 18 in the build log there is a warning, that states the reason for the problem: WARNING: Running the Scanner for MSBuild under Local System or Network Service account is not supported. Please, use a local or domain user account instead.. This means that your build slaves run the Jenkins process using Local System account, which is not supported by SonarScanner for MSBuild. I would recommend creating a dedicated used for the build agents and run the Jenkins process with it.

@valhristov valhristov added Question Status: On Hold Postponed or waiting for an answer. labels Jun 4, 2018
@valhristov valhristov self-assigned this Jun 4, 2018
@ghost ghost removed the Status: On Hold Postponed or waiting for an answer. label Jun 4, 2018
@ChrisHimsworth
Copy link

ChrisHimsworth commented Aug 8, 2018

@valhristov I am using this on TeamCity using a Docker Agent, which is not domain joined and I haven't come across this issue. Since this change has been implemented we can no longer go beyond version 4.2.
Will there be an option to disable this behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants