Anyone has any idea what the following error means?
#aws s3 ls
Credentials were refreshed, but the refreshed credentials are still expired.
I running it from the command line on the server, have already updated the keys couple of time but getting this error which i haven't seen before
Currently, the only way to refresh a session token is to create a new MongoClient with a new MongoCredential. Additionally, there are some use cases for obtaining session tokens that the driver does not support, e.g. the Elastic Kubernetes Service (EKS).
If your application uses temporary credentials when creating an AWS client, then the credentials expire at the time interval specified during their creation. You must refresh the credentials before they expire. Another reason for expiration is using the incorrect time.
The error "the Security Token included in the Request in Invalid" can occur for multiple reasons: The user's credentials are inactive. Open the IAM console, click on the user, and in the Security Credentials tab, make sure the security credentials of the user are active.
To remove a setting, delete the corresponding setting in your config and credentials files. Run this command to quickly set and view your credentials, Region, and output format. The following example shows sample values. You can set any credentials or configuration settings using aws configure set .
I spoke with AWS support about this and they provided a resolution that does not involve changing TZs. What they advised was to check the IAM role assigned to your instanc.
Run this from the affected instance.
curl -v http://169.254.169.254/latest/meta-data/iam/security-credentials/IAM-ROLE
Check the expiration date of the
{
"Code" : "",
"LastUpdated" : "",
"Type" : "",
"AccessKeyId" : "",
"SecretAccessKey" : "",
"Token" : "",
**"Expiration" : ""**
}
In my case, the expiration date showed a value from yesterday. These are temporary credentials that should refresh every so often but in this case, they refreshed but the expiration date did not change. This explains the error AWS Credentials Refreshed but Still Expired
To resolve
Simply unattach and re-attach the role associated with your instance to get new temporary credentials and try the S3 command again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With