s3cmd
s3cmd copied to clipboard
Misleading error message "Configuration file not available" when IAM role not found
I receiving a misleading error message when passing an empty access_key
and secret_key
in config file and there is no IAM role attached to ec2 instance.
https://github.com/s3tools/s3cmd/blob/db37cf75ff372e81f4c8a7d42418135de37fdb2f/S3/Config.py#L214
https://github.com/s3tools/s3cmd/blob/db37cf75ff372e81f4c8a7d42418135de37fdb2f/s3cmd#L2783
It would be nice to receive more meaningful error message: "IAM security-credentials not found"
Thanks for your report. You are right, that should be improved.
FYI, this StackOverflow comment points to the part of the code that results in this message: https://stackoverflow.com/a/45789911/443201
If I find the time, I'll work on a fix and send a pull request.
I just need a bit more time to fix that, but i have a rework of this section of code in the pipe. It is messy and something is bad with the current code for iam. (requesting a refresh at each request).
it would be nice to have the actual IAM error from AWS when this happens. we are authenticating using metadata server (hence, not explicitly passing credentials via env vars or on cmd line) and sometimes we get failures but the actual error message is masked by this incorrect one about config file (that we do not use)