aws / aws-codedeploy-agent

Host Agent for AWS CodeDeploy
https://aws.amazon.com/codedeploy
Apache License 2.0
328 stars 188 forks source link

Windows Agent Does Not Support IMDSv2 #312

Closed moloch-- closed 1 year ago

moloch-- commented 2 years ago

Latest version of the Windows Code Deploy Agent does not work with IMDSv2

2021-12-03T17:51:38 INFO  [codedeploy-agent(2716)]: On Premises config file does not exist or not readable
2021-12-03T17:51:38 DEBUG [codedeploy-agent(2716)]: HTTP error from metadata service, code 401
2021-12-03T17:51:38 ERROR [codedeploy-agent(2716)]: CodeDeploy Instance Agent Service: CodeDeploy Instance Agent Service: error during start or run: RuntimeError - HTTP error from metadata service, code 401 - C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/lib/instance_metadata.rb:55:in `block in http_get'
C:/Windows/TEMP/ocrC594.tmp/lib/ruby/2.3.0/net/http.rb:853:in `start'
C:/Windows/TEMP/ocrC594.tmp/lib/ruby/2.3.0/net/http.rb:584:in `start'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/lib/instance_metadata.rb:51:in `http_get'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/lib/instance_metadata.rb:22:in `region'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:38:in `initialize'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/lib/instance_agent/agent/base.rb:10:in `new'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/lib/instance_agent/agent/base.rb:10:in `runner'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/bin/winagent.rb:42:in `block (2 levels) in service_main'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/bin/winagent.rb:41:in `synchronize'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/bin/winagent.rb:41:in `block in service_main'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/bin/winagent.rb:89:in `with_error_handling'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/bin/winagent.rb:38:in `service_main'
C:/Windows/Temp/ocrC594.tmp/lib/ruby/gems/2.3.0/gems/win32-service-0.8.10/lib/win32/daemon.rb:316:in `mainloop'
C:/Windows/Temp/ocrC594.tmp/lib/ruby/gems/2.3.0/gems/win32-service-0.8.10/lib/win32/daemon.rb:214:in `mainloop'
C:/Windows/TEMP/ocrC594.tmp/src/opt/codedeploy-agent/bin/winagent.rb:104:in `<main>'
mwjones-aws commented 1 year ago

CodeDeploy Agent 1.6.0 supports IMDSv2 on Windows. It has been deployed to most commercial regions as of this comment.

Please track release progress on https://github.com/aws/aws-codedeploy-agent/issues/360