Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudFront KeyValueStore can't work #3034

Closed
jiunjiun opened this issue Jun 3, 2024 · 3 comments
Closed

CloudFront KeyValueStore can't work #3034

jiunjiun opened this issue Jun 3, 2024 · 3 comments
Labels
guidance Question that needs advice or information. investigating Issue is being investigated

Comments

@jiunjiun
Copy link

jiunjiun commented Jun 3, 2024

Describe the bug

I found an issue with the implementation using the 'aws-sdk-cloudfrontkeyvaluestore' package.

I am not sure if it is related to sigv4a.

Below is my code:

access_key_id = 'xxxx'
secret_access_key = 'xxxx'
client = Aws::CloudFrontKeyValueStore::Client.new(access_key_id:, secret_access_key:)

resp = client.describe_key_value_store({
  kvs_arn: 'arn:aws:cloudfront::xxxx'
})

resp = client.list_keys({
  kvs_arn: 'arn:aws:cloudfront::xxxx'
})

Error message:

/.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/endpoints.rb:26:in `resolve_auth_scheme': No supported auth scheme for this endpoint. (RuntimeError)

Expected Behavior

Respond with the correct data.

Current Behavior

/.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/endpoints.rb:26:in `resolve_auth_scheme': No supported auth scheme for this endpoint. (RuntimeError)
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-cloudfrontkeyvaluestore-1.6.0/lib/aws-sdk-cloudfrontkeyvaluestore/plugins/endpoints.rb:41:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/endpoint_discovery.rb:84:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/seahorse/client/plugins/endpoint.rb:47:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/param_validator.rb:26:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/seahorse/client/plugins/raise_response_errors.rb:16:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/checksum_algorithm.rb:111:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:16:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/invocation_id.rb:16:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/idempotency_token.rb:19:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/param_converter.rb:26:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/seahorse/client/plugins/request_callback.rb:89:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/aws-sdk-core/plugins/response_paging.rb:12:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/seahorse/client/plugins/response_target.rb:24:in `call'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-core-3.196.1/lib/seahorse/client/request.rb:72:in `send_request'
        from /.rvm/gems/ruby-3.1.2/gems/aws-sdk-cloudfrontkeyvaluestore-1.6.0/lib/aws-sdk-cloudfrontkeyvaluestore/client.rb:496:in `describe_key_value_store'```

### Reproduction Steps

```ruby
access_key_id = 'xxxx'
secret_access_key = 'xxxx'
client = Aws::CloudFrontKeyValueStore::Client.new(access_key_id:, secret_access_key:)

resp = client.describe_key_value_store({
  kvs_arn: 'arn:aws:cloudfront::xxxx'
})

resp = client.list_keys({
  kvs_arn: 'arn:aws:cloudfront::xxxx'
})

Possible Solution

I tried to modify the file from:

aws-sdk-ruby/gems/aws-sdk-cloudfrontkeyvaluestore/lib/aws-sdk-cloudfrontkeyvaluestore/endpoint_provider.rb

Replace all sigv4a with sigv4.

It can be successfully executed in the example below.

access_key_id = 'xxxx'
secret_access_key = 'xxxx'
client = Aws::CloudFrontKeyValueStore::Client.new(access_key_id:, secret_access_key:, region: 'us-east-1')

resp = client.describe_key_value_store({
  kvs_arn: 'arn:aws:cloudfront::xxxx'
})

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-cloudfrontkeyvaluestore

Environment details (Version of Ruby, OS environment)

Ruby 3.1.2, macOS 14.5

@jiunjiun jiunjiun added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 3, 2024
@alextwoods
Copy link
Contributor

sigv4a requires the aws-crt gem to be installed.

Can you try installing the aws-crt gem?

We have error messages in other places that provide more useful information. If installing the aws-crt fixes this issue, then I'll look into updating this error message to provide more information.

@alextwoods alextwoods added investigating Issue is being investigated and removed needs-triage This issue or PR still needs to be triaged. labels Jun 3, 2024
@jiunjiun
Copy link
Author

jiunjiun commented Jun 3, 2024

Hi alextwoods,

Thank you very much for your response. The issue was resolved by running gem install aws-crt.

@jiunjiun jiunjiun closed this as completed Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@alextwoods alextwoods added guidance Question that needs advice or information. and removed bug This issue is a bug. labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. investigating Issue is being investigated
Projects
None yet
Development

No branches or pull requests

2 participants