Error retrieving credentials from the instance profile metadata service.
arthimann opened this issue · 3 comments
Confirm by changing [ ] to [x] below:
- I've checked AWS Forums and StackOverflow for answers
- I've gone though Developer Guide and API reference
Version of AWS SDK for PHP?
Example: v3.133.6
- get SDK version by printing the output of
Aws\Sdk::VERSION
in your code - if the SDK was installed via composer you can see the version installed with
composer show -i
Version of AWS Service Provider for Laravel?
3.6
Version of Laravel (php artisan --version
)?
8.15.0
Version of PHP (php -v
)?
7.4.1
Describe the question
After running the command: php artisan config:cache
for some reason I always got this error:
Error retrieving credentials from the instance profile metadata service
If I'll use the following command: php artisan config:clear
it's work fine. Now, to work with the socket server I need those cached config files. Basically, as I understand if I will cache the configuration file, the SDK cannot see the connection credentials. Basically, the issue is not only with only one AWS service it's with all of them (SNS, SES, S3, SQS, etc).
The reason that this happens is that the provided aws_default.php
config file does not contain the credentials section which loads from the environment with env()
.
If you publish the config file aws_publish.php
using php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider"
then as this file does contain the credentials section so using a cached config will work as expected.
This is described in the configuration section of the readme, however it is not clear that the default file is actually different from the default published file.
Hi @arthimann, is this a persistent issue for you?, if so, have you tried the recommendation from @danwall in this comment here?, which I confirm that is correct.
Thanks!
This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.