2amigos / yiiaws

Amazon Web Services SDK PHP 2 Wrapper
21 stars 15 forks source link

Intermittent `Error retrieving credentials` #33

Open pkid169 opened 7 years ago

pkid169 commented 7 years ago

Hi,

We got the following intermittent error when interacting with S3

Error retrieving credentials from the instance profile metadata server. When you are not running inside of Amazon EC2, you must provide your AWS access key ID and secret access key in the "key" and "secret" options when creating a client or provide an instantiated Aws\Common\Credentials\CredentialsInterface object. ([curl] 28: Operation timed out after 10011 milliseconds with 0 bytes received [url] http://169.254.169.254/latest/meta-data/iam/security-credentials/)

It seems this might be something to do with our connection to retrieve the IAM credentials being throttled (we have lots of machines doing so at the same time). And I read somewhere that we can resolve this by explicitly telling aws lib to cache the credentials via credentials.cache param. In your current implementation, the value of this is a boolean. However it seems AWS might have changed to required a proper adapter object to be passed in (ref: http://docs.aws.amazon.com/aws-sdk-php/v2/guide/credentials.html).

Have you (or anyone) faced the same problem? If so what are the suggested action?

If this is not related to your lib, please ignore and close the issue :)

tonydspaniard commented 7 years ago

@pkid169 I highly recommend you to use http://flysystem.thephpleague.com/ we are not longer supporting or enhancing any job on Yii1. All our work is for Yii2 nowadays. If you were to look for a Yii2 library, check out our new https://github.com/2amigos/yii2-flysystem-component

Best regards

pkid169 commented 7 years ago

Thanks for the help. We'll look into the suggestions.