Skip to content
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

Assume role command is failing in CI #6652

Open
4 tasks
vertism opened this issue Jan 10, 2025 · 0 comments
Open
4 tasks

Assume role command is failing in CI #6652

vertism opened this issue Jan 10, 2025 · 0 comments

Comments

@vertism
Copy link

vertism commented Jan 10, 2025

Service name

Multiple including:
https://github.com/ministryofjustice/correspondence_tool_public "contact-moj-"
https://github.com/ministryofjustice/request-personal-information "request-for-personal-information-

https://github.com/ministryofjustice/parliamentary-questions "parliamentary-questions-*"

Service environment

N/A - Issue in CI

  • Dev / Development
  • Staging
  • Prod / Production
  • Other

Impact on the service

Builds in CI are failing which is blocking the deploy pipeline

Problem description

Recently the assume role command has sometimes stopped working. These are setup according to this guide.

When it fails, the role-to-assume argument just seems to be missing and there’s an error -
Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers.

The logs look like:

Run aws-actions/configure-aws-credentials@v4
  with:
    aws-region: eu-west-2
    audience: sts.amazonaws.com
  env:
    PREFIX: pq
    SHA: a88b588e4abb305dffde32635398fbb2d05732
Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers

When it's running correctly (which it sometimes does) the role-to-assume argument is visible:

Run aws-actions/configure-aws-credentials@v4
  with:
    role-to-assume: ***
    aws-region: eu-west-2
    audience: sts.amazonaws.com
  env:
    PREFIX: pq
    SHA: 7f84ecac522209b46e674d6a71685e19692f055
Assuming role with OIDC
Authenticated as assumedRoleId AROA2HJSWAHHQCMGLEDP

I have found a workaround which is to make a change to the configure-aws-credentials such as setting the role-to-assume to an empty string, allowing that to build then reverting the commit.

I thought it might be some kind of caching bug and tried adding the unset-current-credentials: true argument to the command, but that has not fixed it.

Contact person

[email protected]
Slack: "@andrew Pepler"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant