You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Aws::SharedCredentials class doesn't have the refresh! method implemented since this is not a refreshable credential class. Whenever we use this class for storing credentials and the credentials are expired, the SDK will try to call the refresh! method and will raise the following error.
The user should not be seeing these error messages. If the credentials are expired, show a corresponding error message.
Current Behavior
Currently, this is throwing the NoMethodError.
Reproduction Steps
For reproducing the error skew the clock first.
~$ sudo timedatectl set-ntp no
~$ sudo timedatectl set-time 12:17:13 # skewed past 15 minutes~$ aws sts get-caller-identity
An error occurred (SignatureDoesNotMatch) when calling the GetCallerIdentity operation: Signature not yet current: 20220412T132639Z is still later than 20220412T124047Z (20220412T122547Z + 15 min.)
Now open the ruby console and initialize the client and call the describe_images method:
3.0.0:005 > ::Aws.config.update(region: 'us-east-2',profile: 'default',http_proxy: nil,ssl_verify_peer: true)=>{:region=>"us-east-2",:profile=>"default",:http_proxy=>nil,:ssl_verify_peer=>true}3.0.0:006 > client=Aws::EC2::Client.new=>#<Aws::EC2::Client>3.0.0:007 > client.describe_images({:image_ids=>["ami-0fb653ca2d3203ac1"]})Traceback(mostrecentcalllast):
16: from/usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/idempotency_token.rb:19:in`call' 15: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:22:in `call' 14: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/checksum_algorithm.rb:111:in `call'13: from/usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/seahorse/client/plugins/raise_response_errors.rb:16:in`call' 12: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/param_validator.rb:26:in `call' 11: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/seahorse/client/plugins/endpoint.rb:47:in `call'10: from/usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/endpoint_discovery.rb:80:in`call' 9: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/user_agent.rb:13:in `call' 8: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/recursion_detection.rb:18:in `call'7: from/usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/query/handler.rb:30:in`call' 6: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/checksum_algorithm.rb:136:in `call' 5: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/endpoint_pattern.rb:30:in `call'4: from/usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/http_checksum.rb:19:in`call' 3: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/retry_errors.rb:368:in `call' 2: from /usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/retry_errors.rb:381:in `retry_if_possible'1: from/usr/share/rvm/gems/ruby-3.0.0/gems/aws-sdk-core-3.130.0/lib/aws-sdk-core/plugins/retry_errors.rb:392:in`retry_request'NoMethodError (undefined method `refresh!' for#<Aws::SharedCredentials profile_name="default" path="/home/ubuntu/.aws/credentials">)
Possible Solution
Since the refresh! method is not available for the Aws::SharedCredentials, add that condition as well before trying to refresh the credentials.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
The
Aws::SharedCredentials
class doesn't have therefresh!
method implemented since this is not a refreshable credential class. Whenever we use this class for storing credentials and the credentials are expired, the SDK will try to call therefresh!
method and will raise the following error.Expected Behavior
The user should not be seeing these error messages. If the credentials are expired, show a corresponding error message.
Current Behavior
Currently, this is throwing the NoMethodError.
Reproduction Steps
For reproducing the error skew the clock first.
Now open the ruby console and initialize the client and call the describe_images method:
Possible Solution
Since the
refresh!
method is not available for the Aws::SharedCredentials, add that condition as well before trying to refresh the credentials.Additional Information/Context
test-kitchen/kitchen-ec2#576
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-core-3.130.0
Environment details (Version of Ruby, OS environment)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
The text was updated successfully, but these errors were encountered: