Comments (8)
What do you mean by "hammer the credentials endpoint with valid credentials"?
Can you provide any code to reproduce the issue? What service and operation are you trying to use and how are you constructing a client?
from aws-sdk-ruby.
from rails, from an AWS instance, with credentials from the instance
1000.times.map { Thread.new { Aws::S3::Client.new(region: 'us-east-2').head_object(bucket: 'my_bucket', key: 'my_file.txt') } }.map(&:join)
reproduces the error for me.
sometimes I have to futz with the number (2000? 3000?) to consistently reproduce.
from aws-sdk-ruby.
In general you should only be creating a single client - the AWS service clients are thread safe and can safely be shared and re-used across your application.
The InstanceProfileCredentials
(EC2 credentials) is part of the Credential Provider Chain, which requires that credential providers that encounter errors or otherwise fail to load/fetch credentials don't raise errors and skip to the next provider in the chain - so I dont think that we can/should surface an error during that process. We also defer raising any missing credential related errors until an operation that requires credentials is called (since there are unsigned operations and it must be possible to use the client without credentials for those operations).
If you know the type of credentials your application needs ahead of time, you can explicitly check and configure them.
from aws-sdk-ruby.
Yup -- the issue is not at all blocking. Just when we got the error it was misleading.
from aws-sdk-ruby.
Yeah - thats fair - getting to the root cause issue there is difficult. I'll look into the possibility of adding some logging for such failures.
from aws-sdk-ruby.
What if I create 100 or more AWS S3 clients instead of a single client?
I'm asking because I want to know more about creating S3 clients.
from aws-sdk-ruby.
There is some overhead in creating a client, so its generally recommended to create only a single client (per set of configuration options) and share it across your application.
When you create a service client, it will attempt to resolve all of the configuration options. For credentials (unless credentials are explicitly provided) it uses the credential provider chain, which will check each credential provider in order until one of them is able to resolve credentials. With the InstanceProfileCredentials
it will make a request to the local EC2 credentials endpoint. If you're creating a large number of clients at one time, this could overwhelm that endpoint and cause it to start throttling requests.
from aws-sdk-ruby.
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.
from aws-sdk-ruby.
Related Issues (20)
- [SES] Custom verification email template no redirect HOT 9
- SQS QueuePoller sometimes returns dupe messages, raises BatchEntryIdsNotDistinct HOT 1
- DynamoDB #query method returns response with items = nil HOT 18
- Aws::S3::PresignedPost does not support tagging field HOT 3
- Multipart copy for Glacier
- CognitoIdentityCredentials is not including the logins set when getting credentials, making all requests unauthenticated HOT 5
- `Aws::BedrockRuntime::Types::<X>` doesn't have `event_type=` HOT 3
- Listing shared RDS Clusters raises an ArgumentError HOT 6
- Errors downloading files from s3 are propagated to incorrect thread HOT 8
- aws-sdk-sqs raises NoMethodError when messages not found HOT 14
- Generate RBS HOT 15
- aws-partitions 1.856.0 no longer be found in that source HOT 8
- aws-sigv4/eventstream released a minor version bump after removing support for Ruby 2.3/2.4 HOT 5
- [aws-sdk-sqs] Aws::SQS::Types::SendMessageBatchResult#failed returns nil HOT 8
- aws-sdk-sesv2 API :next_token Symbol key literal doesn't work as expected (but String key does) HOT 4
- S3 Control Client - Unable to Parse URI HOT 6
- AWS Bedrock ReadTimeout NetworkingError TCPSocket closed HOT 3
- Tagging resources seems to be broken HOT 6
- Aws::Errors::MissingCredentialsError exception in ECS when using TaskRoleArn HOT 10
- Gem displays deprecation warning in ruby 3.3 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-ruby.