Skip to content

[Error] AL2023 - max_revisions - Error deleting directories #377

Open
@ygorth

Description

@ygorth

Specs:

OS: Amazon Linux 2023
codedeploy-agent: OFFICIAL_1.6.0-49_rpm.
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
aws region : us-east-1

Please review this log generated by the codedeploy-agent, which attempted to delete previous deployment folders based on the specified max_revisions number but encountered an error.

2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Successfully parsed the deployment spec
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Creating deployment root directory /opt/codedeploy-agent/deployment-root/1b1cc9e8-aaef-43e7-9bc8-988e6649cf6e/d-8YGI5LZJ1
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Delete Files ["/opt/codedeploy-agent/deployment-root/1b1cc9e8-aaef-43e7-9bc8-988e6649cf6e/d-C6WOEPZJ1"]
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::LinuxUtil: Dirs to delete: ["/opt/codedeploy-agent/deployment-root/1b1cc9e8-aaef-43e7-9bc8-988e6649cf6e/d-C6WOEPZJ1"]
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::LinuxUtil: Deleting dir: /opt/codedeploy-agent/deployment-root/1b1cc9e8-aaef-43e7-9bc8-988e6649cf6e/d-C6WOEPZJ1
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::LinuxUtil: Command status: pid 10890 exit 2
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::LinuxUtil: Command output: 
2023-09-07T19:50:40 ERROR [codedeploy-agent(8798)]: InstanceAgent::LinuxUtil: Error deleting directories: 2
2023-09-07T19:50:40 DEBUG [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" 
2023-09-07T19:50:40 INFO  [codedeploy-agent(8798)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.6.0-49_rpm.
2023-09-07T19:50:40 INFO  [codedeploy-agent(8798)]: [Aws::CodeDeployCommand::Client 200 0.050493 0 retries] put_host_command_complete(command_status:"Failed",diagnostics:{format:"JSON",payload:"{\"error_code\":5,\"script_name\":\"\",\"message\":\"Error deleting directories: 2\",\"log\":\"\"}"},host_command_identifier:"eyJiYXRjaElkIjoiYzQzYTYwY2NiNmU5MzQ0ZWI2OGQ2NjY1N2RjZjZjNTYvcHVibGljMDE3IiwiZGVwbG95bWVudElkIjoiQ29kZURlcGxveS91cy1lYXN0LTEvcHJvZC9vcnBoZXVzOnB1YmxpYzAwMy85NDYwNDM5MzkyMzY6ZC04WUdJNUxaSjEiLCJob3N0SWQiOiJhcm46YXdzOmVjMjp1cy1lYXN0LTE6OTQ2MDQzOTM5MjM2Omluc3RhbmNlL2ktMDU1ZDBjMDlkZjA2NjcxYTQiLCJjb21tYW5kSWQiOiJBcG9sbG9EZXBsb3lDb250cm9sU2VydmljZXxhcm46YXdzOmVjMjp1cy1lYXN0LTE6OTQ2MDQzOTM5MjM2Omluc3RhbmNlL2ktMDU1ZDBjMDlkZjA2NjcxYTR8MnwwIiwiY29tbWFuZE5hbWUiOiJEb3dubG9hZEJ1bmRsZSIsImNvbW1hbmRJbmRleCI6MiwiYXR0ZW1wdEluZGV4IjoxfQ==")  

2023-09-07T19:50:40 ERROR [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: RuntimeError - Error deleting directories: 2 - /opt/codedeploy-agent/lib/instance_agent/platform/linux_util.rb:99:in `delete_folder'
/opt/codedeploy-agent/lib/instance_agent/platform/linux_util.rb:85:in `block in delete_dirs_command'
/opt/codedeploy-agent/lib/instance_agent/platform/linux_util.rb:83:in `each'
/opt/codedeploy-agent/lib/instance_agent/platform/linux_util.rb:83:in `delete_dirs_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:574:in `cleanup_old_archives'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:124:in `block in <class:CommandExecutor>'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:115:in `execute_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:137:in `process_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:119:in `acknowledge_and_process_command'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:99:in `block in perform'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:363:in `run_task'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:in `block (3 levels) in create_worker'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:335:in `loop'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:335:in `block (2 levels) in create_worker'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `catch'
/opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `block in create_worker'
/opt/codedeploy-agent/vendor/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-09-07T19:50:40 WARN  [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" 
2023-09-07T19:50:40 INFO  [codedeploy-agent(8798)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.6.0-49_rpm.
2023-09-07T19:50:40 INFO  [codedeploy-agent(8798)]: [Aws::CodeDeployCommand::Client 200 0.024591 0 retries] put_host_command_complete(command_status:"Failed",diagnostics:{format:"JSON",payload:"{\"error_code\":5,\"script_name\":\"\",\"message\":\"Error deleting directories: 2\",\"log\":\"\"}"},host_command_identifier:"eyJiYXRjaElkIjoiYzQzYTYwY2NiNmU5MzQ0ZWI2OGQ2NjY1N2RjZjZjNTYvcHVibGljMDE3IiwiZGVwbG95bWVudElkIjoiQ29kZURlcGxveS91cy1lYXN0LTEvcHJvZC9vcnBoZXVzOnB1YmxpYzAwMy85NDYwNDM5MzkyMzY6ZC04WUdJNUxaSjEiLCJob3N0SWQiOiJhcm46YXdzOmVjMjp1cy1lYXN0LTE6OTQ2MDQzOTM5MjM2Omluc3RhbmNlL2ktMDU1ZDBjMDlkZjA2NjcxYTQiLCJjb21tYW5kSWQiOiJBcG9sbG9EZXBsb3lDb250cm9sU2VydmljZXxhcm46YXdzOmVjMjp1cy1lYXN0LTE6OTQ2MDQzOTM5MjM2Omluc3RhbmNlL2ktMDU1ZDBjMDlkZjA2NjcxYTR8MnwwIiwiY29tbWFuZE5hbWUiOiJEb3dubG9hZEJ1bmRsZSIsImNvbW1hbmRJbmRleCI6MiwiYXR0ZW1wdEluZGV4IjoxfQ==")  

2023-09-07T19:50:41 DEBUG [codedeploy-agent(8798)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand:
2023-09-07T19:50:41 INFO  [codedeploy-agent(8798)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.6.0-49_rpm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions