CodeDeploy错误:无法从Loadbalancer删除实例

问题描述 投票:0回答:1

我在AWS控制台中遇到以下代码部署错误

LifecycleEvent - ApplicationStop
Script - scripts/deregister_from_elb.sh
[stderr]Running AWS CLI with region: us-east-1
[stderr]Started deregister_from_elb.sh at 2020-01-21 10:53:43
[stderr]Checking that user set at least one load balancer
[stderr]Checking validity of load balancer named 'lb'
[stderr]Checking health of 'i-xxxxxxxxxxxxxxxx' as known by ELB 'lb'
[stderr]Checking status of instance 'i-xxxxxxxxxxxxxxxx' in load balancer 'lb'
[stderr]Deregistering i-xxxxxxxxxxxxxxxx from lb
[stderr]Waiting for instance to de-register from its load balancers
[stderr]Checking 2 times, every 70 seconds, for instance i-xxxxxxxxxxxxxxxx to be in state OutOfService
[stderr]Checking status of instance 'i-xxxxxxxxxxxxxxxx' in load balancer 'lb'
[stderr]Instance is currently in state: InService
[stderr]Checking status of instance 'i-xxxxxxxxxxxxxxxx' in load balancer 'lb'
[stderr]Instance is currently in state: InService
[stderr]Instance failed to reach state, OutOfService within 140 seconds
[stderr][FATAL] Failed waiting for i-xxxxxxxxxxxxxxxx to leave lb

[在EC2实例中检查代码部署代理日志文件时,其显示

ERROR [codedeploy-agent(14347)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: InstanceAgent::Plugins::CodeDeployPlugin::ScriptError - Script at specified location: scripts/deregister_from_elb.sh failed with exit code 1 -
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:183:in `execute_script'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:129:in `block (2 levels) in execute'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:117:in `each'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:117:in `block in execute'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:208:in `create_script_log_file_if_needed'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:115:in `execute'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:158:in `block (3 levels) in map'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:146:in `each'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:146:in `block (2 levels) in map'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:68:in `execute_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:114:in `process_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:96:in `acknowledge_and_process_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:75:in `block in perform'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `call'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
/opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
/opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2020-01-21 10:54:56 WARN  [codedeploy-agent(14347)]:
InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" 
2020-01-21 10:54:56 WARN  [codedeploy-agent(14347)]: 
InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" 
2020-01-21 10:54:56 INFO  [codedeploy-agent(14347)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.0-1.1597_deb.
2020-01-21 10:54:56 INFO  [codedeploy-agent(14347)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.0-1.1597_deb.
2020-01-21 10:54:56 INFO  [codedeploy-agent(14347)]: [Aws::CodeDeployCommand::Client 200 0.186875 0 retries] put_host_command_complete(command_status:"Failed",diagnostics:{format:"JSON",payload:"{\"error_code\":5,\"script_name\":\"\",\"message\":\"Script at specified location: scripts/deregister_from_elb.sh failed with exit code 1\",\"log\":\"\"}"},host_command_identifier:"1YmxpYzAwMS9hcm46YXdzOnNkczp1cy1lYXN0LTE6MTMxMjE0OTI1MjQ1OmRlcGxveW1lbnQvZC1LVjgyTVRPNTIiLCJob3N0SWQiOiJhcm46YXdzOmVjMjp1cy1lYXN0LTE6MTMxMjE0OT1MjQ1Omluc3RhbmNlL2ktMDFhMGFiMjlhMWM2NjEwNjJ8MXwwIiwiY29tbWFuZE5hbWUiOiJBcHBsaWNhdGlvblN0b3AiLRleCI6MX0=") 

我通过删除/ opt / codedeploy-agent / deployment-root文件夹中的所有内容并重新启动code-deploy代理服务来暂时解决了该问题。但是一段时间后,问题又重演了。有谁知道为什么会这样吗?

amazon-web-services aws-code-deploy aws-codepipeline
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.