aws / aws-codedeploy-agent

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

incompatible with newer versions of aws-sdk-core package #314

Open bunsenmcdubbs opened 2 years ago

bunsenmcdubbs commented 2 years ago

aws-codedeploy-agent is not compatible with aws-sdk-core 3.126.2. The gemspec file specifies '~> 3'

After pinning the dependency to 3.114.0, the error disappeared.

Stack trace:

$ rake
...
Failure: test_: Without the file credentials should raise error when credential file is missing. (FileCredentialsTest)
/opt/codedeploy-agent/test/helpers/instance_agent_helper.rb:24:in `assert_raised_with_message'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:55:in `block (2 levels) in <class:FileCredentialsTest>'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:62:in `instance_exec'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:62:in `block in create_test_from_should_hash'

<RuntimeError> expected but was
<Aws::Errors::NoSuchProfileError(<Profile `default' not found in /tmp/invalid_credentials_path>)
/usr/local/lib/ruby/gems/2.7.0/gems/aws-sdk-core-3.126.2/lib/aws-sdk-core/shared_config.rb:367:in `validate_profile_exists'
/usr/local/lib/ruby/gems/2.7.0/gems/aws-sdk-core-3.126.2/lib/aws-sdk-core/shared_config.rb:103:in `credentials'
/usr/local/lib/ruby/gems/2.7.0/gems/aws-sdk-core-3.126.2/lib/aws-sdk-core/shared_credentials.rb:48:in `initialize'
/opt/codedeploy-agent/lib/instance_agent/file_credentials.rb:17:in `new'
/opt/codedeploy-agent/lib/instance_agent/file_credentials.rb:17:in `refresh'
/usr/local/lib/ruby/gems/2.7.0/gems/aws-sdk-core-3.126.2/lib/aws-sdk-core/refreshing_credentials.rb:25:in `initialize'
/opt/codedeploy-agent/lib/instance_agent/file_credentials.rb:11:in `initialize'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:56:in `new'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:56:in `block (3 levels) in <class:FileCredentialsTest>'
/opt/codedeploy-agent/test/helpers/instance_agent_helper.rb:24:in `block in assert_raised_with_message'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:1869:in `block (2 levels) in _assert_raise'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:55:in `block in assert_block'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:1821:in `_wrap_assertion'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:54:in `assert_block'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:1867:in `block in _assert_raise'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:1826:in `_wrap_assertion'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:1853:in `_assert_raise'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/assertions.rb:287:in `assert_raise'
/opt/codedeploy-agent/test/helpers/instance_agent_helper.rb:24:in `assert_raised_with_message'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:55:in `block (2 levels) in <class:FileCredentialsTest>'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:62:in `instance_exec'
/opt/codedeploy-agent/test/instance_agent/file_credentials_test.rb:62:in `block in create_test_from_should_hash'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:871:in `run_test'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:566:in `block (2 levels) in run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:257:in `run_fixture'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:292:in `run_setup'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:564:in `block in run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:563:in `catch'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:563:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:67:in `run_suite'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:45:in `block (2 levels) in run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:102:in `with_listener'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:41:in `block in run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:39:in `catch'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:39:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunner.rb:40:in `start_mediator'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunner.rb:25:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnerutilities.rb:24:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:458:in `block in run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:514:in `change_work_directory'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:457:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:66:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/test-unit-3.5.3/lib/test/unit.rb:518:in `block (2 levels) in <top (required)>'
...
Finished in 5.849030391 seconds.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
395 tests, 926 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
99.7468% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
67.53 tests/s, 158.32 assertions/s
[2022-02-18 01:26:17.998] ERROR -- undefined method `kill' for nil:NilClass: nil
[Coveralls] Outside the CI environment, not sending data.
rake aborted!
Command failed with status (1): [ruby -w -I"lib:test:lib:test/helpers" /usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/instance_agent/agent/base_test.rb" "test/instance_agent/config_test.rb" "test/instance_agent/file_credentials_test.rb" "test/instance_agent/platform/linux_util_test.rb" "test/instance_agent/platform/thread_joiner_test.rb" "test/instance_agent/plugins/codedeploy/application_specification_test.rb" "test/instance_agent/plugins/codedeploy/codedeploy_control_test.rb" "test/instance_agent/plugins/codedeploy/command_executor_test.rb" "test/instance_agent/plugins/codedeploy/command_poller_test.rb" "test/instance_agent/plugins/codedeploy/deployment_specification_test.rb" "test/instance_agent/plugins/codedeploy/hook_executor_test.rb" "test/instance_agent/plugins/codedeploy/install_instruction_test.rb" "test/instance_agent/plugins/codedeploy/installer_test.rb" "test/instance_agent/plugins/codedeploy/onpremise_config_test.rb" "test/instance_agent/plugins/codedeploy/unpack_bundle_test.rb" "test/instance_agent/plugins/codedeploy/version_tracking_test.rb" "test/instance_agent/plugins/windows/winagent_test.rb" "test/instance_agent/runner/child_test.rb" "test/instance_agent/string_utils_test.rb" "test/instance_metadata_test.rb" ]

Tasks: TOP => default => test
ring-pete commented 2 years ago

I've verified this on my end as well, so it would be great if we could pin to this version until the unit-test is fixed with the latest aws-sdk-core.