aws/aws-codedeploy-agent

Error installing latest version 1.5.0-57 in Amazon Linux 2023

herrsergio opened this issue ยท 6 comments

Ruby was installed using: dnf install ruby

# cat /etc/system-release && rpm -qa | egrep -i "codedeploy|ruby"

Amazon Linux release 2023 (Amazon Linux)
ruby3.2-libs-3.2.0-177.amzn2023.0.1.x86_64
ruby3.2-rubygem-json-2.6.3-177.amzn2023.0.1.x86_64
ruby3.2-rubygem-io-console-0.6.0-177.amzn2023.0.1.x86_64
ruby3.2-3.2.0-177.amzn2023.0.1.x86_64
ruby3.2-rubygem-bigdecimal-3.1.3-177.amzn2023.0.1.x86_64
ruby3.2-rubygem-bundler-2.4.1-177.amzn2023.0.1.noarch
ruby3.2-rubygem-psych-5.0.1-177.amzn2023.0.1.x86_64
ruby3.2-default-gems-3.2.0-177.amzn2023.0.1.noarch
ruby3.2-rubygems-3.4.1-177.amzn2023.0.1.noarch
ruby3.2-rubygem-rdoc-6.5.0-177.amzn2023.0.1.noarch
codedeploy-agent-1.5.0-57.noarch
# systemctl start codedeploy-agent.service
Job for codedeploy-agent.service failed because the control process exited with error code.
See "systemctl status codedeploy-agent.service" and "journalctl -xeu codedeploy-agent.service" for details.
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require': cannot load such file -- net/smtp (LoadError)
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging/appenders/email.rb:2:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging/appenders.rb:57:in `<module:Logging>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging/appenders.rb:2:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging.rb:537:in `<module:Logging>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/logging-1.8.2/lib/logging.rb:18:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:160:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:149:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/log.rb:2:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:96:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:96:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager.rb:9:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:160:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:149:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/lib/instance_agent.rb:10:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:22:in `<main>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require': cannot load such file -- logging (LoadError)
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: Did you mean?  logger
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:148:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/log.rb:2:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:96:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:96:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager.rb:9:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:160:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:149:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/lib/instance_agent.rb:10:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:22:in `<main>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- process_manager (LoadError)
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/lib/instance_agent.rb:10:in `<top (required)>'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from <internal:/usr/share/ruby3.2-rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
Mar  9 17:48:32 ip-10-80-103-68 bash[4517]: #011from /opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:22:in `<main>'
Mar  9 17:48:32 ip-10-80-103-68 systemd[1]: codedeploy-agent.service: Control process exited, code=exited, status=1/FAILURE
Mar  9 17:48:32 ip-10-80-103-68 systemd[1]: codedeploy-agent.service: Failed with result 'exit-code'.

I've found that in the file: /opt/codedeploy-agent/codedeploy_agent.gemspec it is still using Ruby 2:

12   spec.required_ruby_version = '~> 2.0'

Also in a lot of places it still uses File.exists? which is already deprecated.
https://bugs.ruby-lang.org/issues/17391
ruby/ruby@bf97415

Thanks for reaching out. We don't officially support Amazon Linux 2023 yet. We'll post updates on this issue.

@mwjones-aws Do you know if the agent will be supported when AL2023 is GA?

@herrsergio The ruby version is 3.2, but aws-codedeploy-agent 1.5.0 only supports ruby 3.0.

CodeDeploy Agent 1.6.0 adds AL2023 and Ruby 3.2 support. It has been released to most commercial regions as of this comment.

Please track release progress on #360