-
Notifications
You must be signed in to change notification settings - Fork 9
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
Error retrieving credentials from the instance profile metadata service #14
Comments
Breaking down your stack trace:
We can see that it is a curl timeout error.
1001 milliseconds is ~ 1 second. So, you are making a request, not getting a response within one second and then curl stops. The primary cause for this is using the wrong or a non-existent URL. [Verify all your settings.] The secondary cause for this is a slow/clogged network. [Increase the timeout period.] Finally, it is possible that you have a firewall or some other network configuration preventing you from reaching the AWS endpoint. That's my best attempt at troubleshooting from here. :-) |
It seems that php artisan command is not able to read the AWS credentials (~/.aws/credentials). We have already stored the credentials at my own user home directory /home/[myusername]/.aws/credentials. I am successfully able to run "aws kms encrypt" and "aws kms decrypt" CLI commands to encrypt/decrypt a sample file. Hence, I have proper credentials installed. But when I run the php artisan command then it seems that it cannot access the aws credentials. Any feedback would be highly appriciated. |
You are running the artisan command manually, logged in as yourself? Or you
are running it via supervisor or cron?
If you are running it as yourself, do you have other credentials in your
.env file? Those would get used prior to looking in the credentials file.
…On Wed, Mar 25, 2020 at 10:56 AM devendra-gohil-plenar < ***@***.***> wrote:
It seems that php artisan command is not able to read the AWS credentials
(~/.aws/credentials). We have already stored the credentials at my own user
home directory /home/[myusername]/.aws/credentials. I am successfully able
to run "aws kms encrypt" and "aws kms decrypt" CLI commands to
encrypt/decrypt a sample file. Hence, I have proper credentials installed.
But when I run the php artisan command then it seems that it cannot access
the aws credentials.
Any feedback would be highly appriciated.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2K235LM5OOY2YBID4FETDRJILSJANCNFSM4LQHZONA>
.
--
Bubba Hines | Stechstudio
http://www.stechstduio.com <http://www.stechstudio.com>
V.P. of Solving Big Problems
tel: 630.938.7601 | cell: 704.879.1133
|
Hello - I am working with Devendra on this issue. To answer your question - we are running the command 'sudo php artisan env:edit local' as myself directly through the terminal and the AWS credentials are stored in my home directory ~/.aws/credentials. The .env file has the parameters 'ENV_DRIVER' and 'AWS_KMS_KEY' defined as per your guide. We are still getting the same error of Connection Timeout. I think that php artisan command is not able to retrieve the AWS credentials from my home directory? The credentials are working, as we test AWS CLI commands encrypt/decrypt successfully. Appreciate your help! |
Not sure what to tell you. Sure sounds like some kind of permission issue here, outside the scope of this specific package. If the AWS php sdk isn't picking up your credentials, that has to be resolved for this package to do its job. Googling "Error retrieving credentials from the instance profile metadata service" turns up a whole lot of results. |
I am using Laravel 6 with PHP 7.2 on CentOS 7 Apache server.
On amazon console, I have created a new IAM User with KMS permssions. Then logged in as IAM user and created a new
SYMMETRIC
Customer managed key using KMS.I've installed the package in my Laravel project using
composer require stechstudio/laravel-env-security
Also have set composer.json with
and have set .env keys
I have created
~.aws/credentials
file and there I have placedNow, in my Laravel project's root directory, if I run
sudo php artisan env:edit local
Then copining my exising .env file's content to this one and save it using
:wq
, it returns following error:I have checked laravel storage logs and find following stacktrace.
Can you please let me know what am I missing?
The text was updated successfully, but these errors were encountered: