configure-aws-credentials icon indicating copy to clipboard operation
configure-aws-credentials copied to clipboard

Improve error messaging

Open richardhboyd opened this issue 3 years ago • 6 comments

Currently any number of failures result in Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers which isn't terribly helpful. We should better surface error messages for:

  • the workflow not having the correct permissions
  • IAM refusing to grant credentials for a token
  • others?

richardhboyd avatar Oct 06 '21 17:10 richardhboyd

Richard, is there any form of debug logging currently? I've got this working in one repository, but it fails in another repository using the same OIDC provider and an identical role. As you mentioned I just get Could not load credentials from any providers which doesn't help much.

andrewlytle avatar Oct 15 '21 13:10 andrewlytle

Did you update the Role's condition on the trust policy to allow the second repository as well?

richardhboyd avatar Oct 15 '21 13:10 richardhboyd

I created a whole new role for each repository. The only thing funky about this repo I can think of is that I moved it from my personal org to my company org, but I've tried both names and even removed the Condition entirely. I've probably done something dumb, but there's just no path to debug right now.

andrewlytle avatar Oct 15 '21 13:10 andrewlytle

I see the error fairly frequently in one of my repos - it's intermittent and rerunning a workflow will generally work / not produce this error. However, having this pop up as often as it does slows down my CI/CD process. I'd love more info on what's causing it and why it only happens sometimes, but not consistenly.

jazanne avatar Dec 06 '21 14:12 jazanne

same here, got Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers and would really like to know where to start looking.

Any chance the error messages / logs are improved?

jtheuer avatar Apr 22 '22 13:04 jtheuer

We should absolutely improve error messaging. I'll try to update this thread with the errors I and others come across that are unclear

peterwoodworth avatar Oct 07 '22 23:10 peterwoodworth

Any updates here?

I have a job on a self hosted runner, on one container it runs smoothly, on another I'm getting: Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers

If the error message would be more specific, I could tell where the problem resides.

astropanic avatar Jul 01 '23 22:07 astropanic

The error messaging will be improved upon in v3, however I can't yet give a date for when that will be available.

@astropanic feel free to submit a new issue or discussion with further details including your workflow files

peterwoodworth avatar Jul 03 '23 02:07 peterwoodworth

For me, it was because I missed adding the id-token permission, which is in the README, I just missed it: https://github.com/aws-actions/configure-aws-credentials/blob/746d33e7c1cc7b6e40a836b0f2ef033136aa6b2a/README.md#L73-L76

Leaving this note here for future travelers.

blimmer avatar Aug 14 '23 20:08 blimmer

For me, every time it's because I forget to add the permissions token. :P It would be nice if the error message told you to check this.

jwalton avatar Aug 15 '23 23:08 jwalton

Error messaging and our docs should be improved overall for this action in v3. Please open any issues if you encounter any error messages that are unclear.

peterwoodworth avatar Aug 24 '23 22:08 peterwoodworth

** Note ** Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Aug 24 '23 22:08 github-actions[bot]