解决办法在这篇文章,只要在powershell 执行:

Write-Host ("Adding Windows Defender exclude for CodeDeploy...")  
Add-MpPreference -ExclusionPath ("C:\ProgramData\Amazon\CodeDeploy","$env:windir\Temp")

转发Github解决方案

codedeploy-agent.msi fails to install on Windows 2016 ending with “Error 1920…Verify that you have sufficient privileges to start system services.” · Issue #189 · aws/aws-codedeploy-agent · GitHub

codedeploy-agent.msi fails to install on Windows 2016 ending with "Error 1920…Verify that you have sufficient privileges to start system services." · Issue #189 · aws/aws-codedeploy-agent · GitHub

codedeploy-agent.msi fails to install on Windows 2016 ending with “Error 1920…Verify that you have sufficient privileges to start system services.” #189

Closed

codedeploy-agent.msi fails to install on Windows 2016 ending with “Error 1920…Verify that you have sufficient privileges to start system services.” · Issue #189 · aws/aws-codedeploy-agent · GitHub

ddemeyer opened this issue Sep 21, 2018 · 11 comments

Comments

](https://github.com/ddemeyer)

ddemeyer commented Sep 21, 2018

This took me a while to figure out, so I hope this helps somebody to find the resolution quicker.

I had a successful UserData script that worked on Windows 2012R2, running the same failed to install CodeDeploy as a service on Windows 2016 (tried latest AMIs of WINDOWS_2016_SQL_SERVER_EXPRESS_2016 and WINDOWS_2016_SQL_SERVER_STANDARD_2016)

The codedeploy-agent.msi eventually fails with
Error 1920. Service 'CodeDeploy Host Agent Service' (codedeployagent) failed to start. Verify that you have sufficient privileges to start system services. Action ended 15:34:15: InstallFinalize. Return value 3. Action ended 15:34:45: INSTALL. Return value 3. MSI (s) (9C:C0) [15:34:45:682]: Product: CodeDeploy Host Agent -- Installation failed. MSI (s) (9C:C0) [15:34:45:702]: Windows Installer installed the product. Product Name: CodeDeploy Host Agent. Product Version: 1.0.1.1518. Product Language: 1033. Manufacturer: Amazon Web Services. Installation success or error status: 1603.

The 1920 is just a general Oops error. Digging deeper with ProcessExplorer I saw multiple attempts to start winagent.exe that all silently failed without an obvious reason on missing rights.

It could be that I missed something obvious but I didn’t expect Windows 2016 combined with CodeDeploy to be that obscure. Eventually read We have a known issue on Windows 10 that the installer failed to update the service configuration, which cause the installation to fail. in #81 It would be nice that this known issues list would pop up in search results.

So the solution is to add Windows Defender exclusions before starting the installer. I used the following PowerShell statements that require Administrator

 

Write-Host ("Adding Windows Defender exclude for CodeDeploy...")  
Add-MpPreference -ExclusionPath ("C:\ProgramData\Amazon\CodeDeploy","$env:windir\Temp")

Loading

By Yang

Share via
Copy link