aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.05k stars 323 forks source link

AWS-SSM: unable to install ssm-agent in windows system #535

Closed sant527 closed 9 months ago

sant527 commented 1 year ago

I have create a new aws-workspace using windows10

enter image description here

I want to now register this with AWS systems manager. I have created an Hybrid activation

The windows instance is 64 bit

I am running the following

the below commands work fine

$code = "zzzzzzzzzzzzzzzzz"
$id = "ggggggggggggggggggggg"
$region = "us-east-1"
$dir = $env:TEMP + "\ssm"
New-Item -ItemType directory -Path $dir -Force
cd $dir
(New-Object System.Net.WebClient).DownloadFile("https://amazon-ssm-$region.s3.$region.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exe", $dir + "\AmazonSSMAgentSetup.exe")

but the below fails

Start-Process .\AmazonSSMAgentSetup.exe -ArgumentList @("/q", "/log", "install.log", "CODE=$code", "ID=$id", "REGION=$region") -Wait

I checked the logs

[18D0:1470][2023-08-31T15:57:32]i001: Burn v3.11.0.1701, Windows v10.0 (Build 17763: Service Pack 0), path: D:\Users\sant8test\AppData\Local\Temp\{CC54BDD5-B9CB-4457-BBE8-FEEE8D58A5BB}\.cr\AmazonSSMAgentSetup.exe
[18D0:1470][2023-08-31T15:57:32]i000: Initializing hidden variable 'CODE'
[18D0:1470][2023-08-31T15:57:32]i000: Initializing string variable 'ID' to value 'null'
[18D0:1470][2023-08-31T15:57:32]i000: Initializing string variable 'REGION' to value 'null'
[18D0:1470][2023-08-31T15:57:32]i000: Initializing string variable 'ALLOWEC2INSTALL' to value 'null'
[18D0:1470][2023-08-31T15:57:32]i000: Initializing string variable 'DELETESYMLINKSFORSSMFOLDER' to value 'no'
[18D0:1470][2023-08-31T15:57:32]i000: Initializing string variable 'SKIPSYMLINKSCAN' to value 'no'
[18D0:1470][2023-08-31T15:57:32]i009: Command Line: '-burn.clean.room=D:\Users\sant8test\AppData\Local\Temp\ssm\AmazonSSMAgentSetup.exe -burn.filehandle.attached=664 -burn.filehandle.self=700 /q /log install.log CODE=***** ID=9c60e1ca-9bec-4998-bfe6-18e9e8466f85 REGION=us-east-1'
[18D0:1470][2023-08-31T15:57:32]i000: Setting string variable 'WixBundleOriginalSource' to value 'D:\Users\sant8test\AppData\Local\Temp\ssm\AmazonSSMAgentSetup.exe'
[18D0:1470][2023-08-31T15:57:32]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'D:\Users\sant8test\AppData\Local\Temp\ssm\'
[18D0:1470][2023-08-31T15:57:32]i000: Setting string variable 'WixBundleLog' to value 'D:\Users\sant8test\AppData\Local\Temp\ssm\install.log'
[18D0:1470][2023-08-31T15:57:32]i052: Condition '((VersionNT >= v5.2) AND (ServicePackLevel >= 1)) OR (VersionNT >= v6.0)' evaluates to true.
[18D0:1470][2023-08-31T15:57:32]i000: Setting string variable 'WixBundleName' to value 'Amazon SSM Agent'
[18D0:1470][2023-08-31T15:57:32]i000: Setting string variable 'WixBundleManufacturer' to value 'Amazon Web Services'
[18D0:195C][2023-08-31T15:57:33]i000: Setting hidden variable 'CODE'
[18D0:195C][2023-08-31T15:57:33]i000: Setting string variable 'ID' to value '9c60e1ca-9bec-4998-bfe6-18e9e8466f85'
[18D0:195C][2023-08-31T15:57:33]i000: Setting string variable 'REGION' to value 'us-east-1'
[18D0:195C][2023-08-31T15:57:33]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[18D0:195C][2023-08-31T15:57:33]i000: Setting version variable 'WixBundleFileVersion' to value '3.2.1478.0'
[18D0:1470][2023-08-31T15:57:33]i100: Detect begin, 2 packages
[18D0:1470][2023-08-31T15:57:33]e000: Error 0x80070003: Failed to get size of pseudo bundle: C:\ProgramData\Package Cache\{9b366a99-66ba-4da5-a01d-d57836b0eeb6}\AmazonSSMAgentSetup.exe
[18D0:1470][2023-08-31T15:57:33]e000: Error 0x80070003: Failed to initialize package from related bundle id: {9b366a99-66ba-4da5-a01d-d57836b0eeb6}
[18D0:1470][2023-08-31T15:57:33]i101: Detected package: AmazonSSMAgentMSI, state: Absent, cached: None
[18D0:1470][2023-08-31T15:57:33]i101: Detected package: AmazonSSMAgentMSI_32, state: Absent, cached: None
[18D0:1470][2023-08-31T15:57:33]i199: Detect complete, result: 0x0
[18D0:1470][2023-08-31T15:57:33]i200: Plan begin, 2 packages, action: Install
[18D0:1470][2023-08-31T15:57:33]i052: Condition 'VersionNT64' evaluates to true.
[18D0:1470][2023-08-31T15:57:33]i000: Setting string variable 'WixBundleRollbackLog_AmazonSSMAgentMSI' to value 'D:\Users\sant8test\AppData\Local\Temp\ssm\install_000_AmazonSSMAgentMSI_rollback.log'
[18D0:1470][2023-08-31T15:57:33]i000: Setting string variable 'WixBundleLog_AmazonSSMAgentMSI' to value 'D:\Users\sant8test\AppData\Local\Temp\ssm\install_000_AmazonSSMAgentMSI.log'
[18D0:1470][2023-08-31T15:57:33]i052: Condition 'NOT VersionNT64' evaluates to false.
[18D0:1470][2023-08-31T15:57:33]i201: Planned package: AmazonSSMAgentMSI, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[18D0:1470][2023-08-31T15:57:33]i201: Planned package: AmazonSSMAgentMSI_32, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[18D0:1470][2023-08-31T15:57:33]i299: Plan complete, result: 0x0
[18D0:1470][2023-08-31T15:57:33]i300: Apply begin
[18D0:1470][2023-08-31T15:57:33]i010: Launching elevated engine process.
[18D0:1470][2023-08-31T15:57:33]i011: Launched elevated engine process.
[18D0:1470][2023-08-31T15:57:33]i012: Connected to elevated engine.
[09AC:1038][2023-08-31T15:57:33]e000: Error 0x80070003: Failed to get size of pseudo bundle: C:\ProgramData\Package Cache\{9b366a99-66ba-4da5-a01d-d57836b0eeb6}\AmazonSSMAgentSetup.exe
[09AC:1038][2023-08-31T15:57:33]e000: Error 0x80070003: Failed to initialize package from related bundle id: {9b366a99-66ba-4da5-a01d-d57836b0eeb6}
[09AC:1038][2023-08-31T15:57:33]i358: Pausing automatic updates.
[09AC:1038][2023-08-31T15:57:33]i359: Paused automatic updates.
[09AC:1038][2023-08-31T15:57:33]i360: Creating a system restore point.
[09AC:1038][2023-08-31T15:57:33]i362: System restore disabled, system restore point not created.
[09AC:1038][2023-08-31T15:57:33]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{e4b995ae-8fd1-4957-8301-132e1392b266}, options: 0x7, disable resume: No
[09AC:1038][2023-08-31T15:57:33]i000: Caching bundle from: 'D:\Users\sant8test\AppData\Local\Temp\{3047F947-C1A7-4867-BC81-4DBB145BF448}\.be\AmazonSSMAgentSetup.exe' to: 'C:\ProgramData\Package Cache\{e4b995ae-8fd1-4957-8301-132e1392b266}\AmazonSSMAgentSetup.exe'
[09AC:1038][2023-08-31T15:57:33]i320: Registering bundle dependency provider: {e4b995ae-8fd1-4957-8301-132e1392b266}, version: 3.2.1478.0
[09AC:1038][2023-08-31T15:57:33]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{e4b995ae-8fd1-4957-8301-132e1392b266}, resume: Active, restart initiated: No, disable resume: No
[09AC:1348][2023-08-31T15:57:34]i305: Verified acquired payload: AmazonSSMAgentMSI at path: C:\ProgramData\Package Cache\.unverified\AmazonSSMAgentMSI, moving to: C:\ProgramData\Package Cache\{0199A771-9380-4737-A562-ACDD7AC7C229}v3.2.1478.0\AmazonSSMAgent.msi.
[09AC:1038][2023-08-31T15:57:34]i323: Registering package dependency provider: {0199A771-9380-4737-A562-ACDD7AC7C229}, version: 3.2.1478.0, package: AmazonSSMAgentMSI
[09AC:1038][2023-08-31T15:57:34]i301: Applying execute package: AmazonSSMAgentMSI, action: Install, path: C:\ProgramData\Package Cache\{0199A771-9380-4737-A562-ACDD7AC7C229}v3.2.1478.0\AmazonSSMAgent.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" CODE="*****" ID="9c60e1ca-9bec-4998-bfe6-18e9e8466f85" REGION="us-east-1" ALLOWEC2INSTALL="null" DELETESYMLINKSFORSSMFOLDER="no" SKIPSYMLINKSCAN="no"'
[09AC:1038][2023-08-31T15:59:11]e000: Error 0x80070643: Failed to install MSI package.
[09AC:1038][2023-08-31T15:59:11]e000: Error 0x80070643: Failed to execute MSI package.
[18D0:1470][2023-08-31T15:59:11]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[18D0:1470][2023-08-31T15:59:11]i319: Applied execute package: AmazonSSMAgentMSI, result: 0x80070643, restart: None
[18D0:1470][2023-08-31T15:59:11]e000: Error 0x80070643: Failed to execute MSI package.
[09AC:1038][2023-08-31T15:59:11]i318: Skipped rollback of package: AmazonSSMAgentMSI, action: Uninstall, already: Absent
[18D0:1470][2023-08-31T15:59:11]i319: Applied rollback package: AmazonSSMAgentMSI, result: 0x0, restart: None
[09AC:1038][2023-08-31T15:59:11]i329: Removed package dependency provider: {0199A771-9380-4737-A562-ACDD7AC7C229}, package: AmazonSSMAgentMSI
[09AC:1038][2023-08-31T15:59:11]i351: Removing cached package: AmazonSSMAgentMSI, from path: C:\ProgramData\Package Cache\{0199A771-9380-4737-A562-ACDD7AC7C229}v3.2.1478.0\
[09AC:1038][2023-08-31T15:59:11]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{e4b995ae-8fd1-4957-8301-132e1392b266}, resume: None, restart: None, disable resume: No
[09AC:1038][2023-08-31T15:59:11]i330: Removed bundle dependency provider: {e4b995ae-8fd1-4957-8301-132e1392b266}
[09AC:1038][2023-08-31T15:59:11]i352: Removing cached bundle: {e4b995ae-8fd1-4957-8301-132e1392b266}, from path: C:\ProgramData\Package Cache\{e4b995ae-8fd1-4957-8301-132e1392b266}\
[09AC:1038][2023-08-31T15:59:11]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{e4b995ae-8fd1-4957-8301-132e1392b266}, resume: None, restart initiated: No, disable resume: No
[18D0:1470][2023-08-31T15:59:11]i399: Apply complete, result: 0x80070643, restart: None, ba requested restart:  No
[18D0:1470][2023-08-31T15:59:11]i500: Shutting down, exit code: 0x643
[18D0:1470][2023-08-31T15:59:11]i410: Variable: ALLOWEC2INSTALL = null
[18D0:1470][2023-08-31T15:59:11]i410: Variable: CODE = *****
[18D0:1470][2023-08-31T15:59:11]i410: Variable: DELETESYMLINKSFORSSMFOLDER = no
[18D0:1470][2023-08-31T15:59:11]i410: Variable: ID = 9c60e1ca-9bec-4998-bfe6-18e9e8466f85
[18D0:1470][2023-08-31T15:59:11]i410: Variable: REGION = us-east-1
[18D0:1470][2023-08-31T15:59:11]i410: Variable: SKIPSYMLINKSCAN = no
[18D0:1470][2023-08-31T15:59:11]i410: Variable: VersionNT = 10.0.0.0
[18D0:1470][2023-08-31T15:59:11]i410: Variable: VersionNT64 = 10.0.0.0
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleAction = 5
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleElevated = 1
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleFileVersion = 3.2.1478.0
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleInstalled = 0
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleLog = D:\Users\sant8test\AppData\Local\Temp\ssm\install.log
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleLog_AmazonSSMAgentMSI = D:\Users\sant8test\AppData\Local\Temp\ssm\install_000_AmazonSSMAgentMSI.log
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleManufacturer = Amazon Web Services
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleName = Amazon SSM Agent
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleOriginalSource = D:\Users\sant8test\AppData\Local\Temp\ssm\AmazonSSMAgentSetup.exe
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleOriginalSourceFolder = D:\Users\sant8test\AppData\Local\Temp\ssm\
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleProviderKey = {e4b995ae-8fd1-4957-8301-132e1392b266}
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleRollbackLog_AmazonSSMAgentMSI = D:\Users\sant8test\AppData\Local\Temp\ssm\install_000_AmazonSSMAgentMSI_rollback.log
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleSourceProcessFolder = D:\Users\sant8test\AppData\Local\Temp\ssm\
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleSourceProcessPath = D:\Users\sant8test\AppData\Local\Temp\ssm\AmazonSSMAgentSetup.exe
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleTag = 
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleUILevel = 2
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixBundleVersion = 3.2.1478.0
[18D0:1470][2023-08-31T15:59:11]i410: Variable: WixStdBALanguageId = 1033
[18D0:1470][2023-08-31T15:59:11]i007: Exit code: 0x643, restarting: No

enter image description here

I am following the docs

https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-win.html

enter image description here

sluggard76 commented 9 months ago

windows10 is not officially supported by SSM Agent. Please read more here for supported OSes.