-
Notifications
You must be signed in to change notification settings - Fork 212
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
CloudWatchAgent on Windows fails with "imds retry client will retry 1 times" #871
Comments
Looking at previous issues, it seems like the issue is related to #516 . Related - https://github.com/aws/amazon-cloudwatch-agent/blob/main/internal/retryer/imdsretryer.go#L30 |
Can you post your ami. We have tests for win-2022 where the agent does start. |
Same here. This worked last week. AMI ID - ami-00c896faf296575ab
Output:
|
I am also seeing the same. I noticed:
Last week, https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi returns
References: |
I put this together to demonstrate the problem and assist with troubleshooting. https://github.com/ryanwilliams83/CloudWatchAgent-871 MSI Package Version 1.4.37882 (https://github.com/ryanwilliams83/CloudWatchAgent-871/raw/main/assets/amazon-cloudwatch-agent-1.4.37882.msi) |
Is this issue only when running this command in user data or when running in powershell. I ran this command in powershell after agent started and it worked. I want to make this issue only happens when starting with user data. |
Okay so I was able to reproduce and fix the issue. Can you please take this version of the agent until we finish the patch release. |
Closing the issue since root cause is found, the issue is mitigated. |
Thanks for the effort! Glad to see it's fixed. BTW, for those who are interested in why it happens only in user data execution, but not in interactive powershell: I believe it's a long lasting issue when powershell redirects error stream.
User data is executed in this way, with both C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command {
$env:EC2Launch_Execution_Mode = 'attached';
. 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\EC2Launch123\UserScript.ps1' 1> 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\EC2Launch123\output.tmp' 2> 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\EC2Launch123\err.tmp';
exit $LASTEXITCODE
} And I do find if I manually run it in powershell with
|
When will this fix be released so that I can start using the latest version again? |
The fix for this issue is currently released in the latest CloudWatch Agent, please try retrieving it by using the link below. Thanks! |
Describe the bug
In EC2 UserData, I am trying to execute "& 'C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1' -a fetch-config -m ec2 -s -c file:C:\tmp\cloud-watch-agent-config.json" to install the cloud watch agent configuration on Windows Server 2022 host on start up. The UserData fails with "PS>TerminatingError(config-downloader.exe): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: 2023/09/29 01:07:56 I! imds retry client will retry 1 times" message.
Steps to reproduce
What did you expect to see?
AmazonCloudWatchAgent boots up with the provided configuration.
What did you see instead?
User data script fails.
What version did you use?
Version: (e.g.,
v1.247350.0
, etc)What config did you use?
Config: (e.g. the agent json config file)
Environment
Windows Server 2022
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: