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

Break the build when running under local system account #522

Closed
valhristov opened this issue Jun 4, 2018 · 6 comments
Closed

Break the build when running under local system account #522

valhristov opened this issue Jun 4, 2018 · 6 comments
Assignees
Milestone

Comments

@valhristov
Copy link
Contributor

Description

The MSBuild integration is not working when the scanner is run under the Local System account. This happens frequently as the Local System is the default account for authentication of Jenkins slaves.

Expected behavior

When running under Local System the begin step should fail with the same message we currently use as a warning.

Related ticket SonarSource/sonar-dotnet#1437

@OwenGr
Copy link

OwenGr commented Jun 6, 2018

Is there an option to disable this behavior?

Our builds have been reporting fine, while running under LocalSystemAccount, on TeamCity, using 4.2.0. This change just explodes our builds for no good reason.

@valhristov
Copy link
Contributor Author

Hi @OwenGr, did you have analysis results before upgrading SonarScanner for MSBuild?

So far we have been unable to make it work with a Local System account, hence the break. In other words, if the analysis does not work, there is no point adding the steps...

@ChrisHimsworth
Copy link

@valhristov I am in the same situation - we have been using this with TeamCity, including Docker based TeamCity agents with no issues.
I tried upgrading to 4.3 and I can no longer use it on our Docker TeamCity agents.

@ChrisHimsworth
Copy link

@valhristov & @Evangelink - As @OwenGr suggested, is/will there be an option to disable this behaviour?
We are now stuck on version 4.2 due to an issue that was never experienced in our build system.

@dbolkensteyn
Copy link
Contributor

Please follow this issue to support System Account: #465 which now depends on this other issue on the MSBuild project itself: dotnet/msbuild#3781

@dbolkensteyn
Copy link
Contributor

dbolkensteyn commented Sep 24, 2018

The investigation is now completed: The root cause relates to how WoW64 works and how it transparently translates C:\Windows\system32 path into C:\Windows\SysWoW64. Our integration only worked in situations where the bitness of the SonarScanner for MSBuild and the one of MSBuild matched.

Details on when System Account was supported:

  1. Up until version 4.0.2.892, the SonarScanner for MSBuild was a 32 bits process. As MSBuild itself is typically invoked in its 32 bits version, both processes saw the same C:\Windows\system32 path regardless of Windows begin a 32 or 64 bits installation, and our integration worked as expected. Note that the 64 bits version of MSBuild (bin\amd64\MSBuild.exe) was not supported by those releases.
  2. Releases 4.1.0.1148, 4.1.1 and 4.2 of the SonarScanner for MSBuild were 64 bits one. Our integration with the 32 bits version of MSBuild got broken, except on 32 bits Windows installations where the SonarScanner for MSBuild was forced to run as a 32 bits process. The 64 bits version of MSBuild (bin\amd64\MSBuild.exe) became supported.
  3. As of version 4.3, System Account is not supported at all.

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

No branches or pull requests

6 participants