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

No valid creds error even if the tokens are avialable in atlantis container #294

Open
ismathk opened this issue Feb 19, 2025 · 0 comments
Open

Comments

@ismathk
Copy link

ismathk commented Feb 19, 2025

I have spin Atlantis as a docker container inside an EC2 instance and it is working fine.

This is the error showing

{"level":"panic","ts":1739965199.8792841,"caller":"atlantis-drift-detection/main.go:148","msg":"failed to drift","error":"failed to find extra workspaces: failed to init workspace /aws/core/prod: \nInitializing the backend...\nInitializing modules...\n- acm_cert in ../../modules/acm-cert\n- alb in ../../modules/alb\n- bemi_instance in ../../modules/ec2\n- dynamodb in ../../modules/dynamodb\n- ecs_cluster in ../../modules/ecs-cluster\n- rds in ../../modules/rds-instance\n- s3 in ../../modules/infra-s3\n- sg in ../../modules/sg\n- vpc in ../../modules/vpc\n:\nError: No valid credential sources found\n\nPlease see [https://www.terraform.io/docs/language/settings/backends/s3.html\nfor](https://www.terraform.io/docs/language/settings/backends/s3.html/nfor) more information about providing credentials.\n\nError: failed to refresh cached credentials, no EC2 IMDS role found,\noperation error ec2imds: GetMetadata, failed to get API token, operation\nerror ec2imds: getToken, http response error StatusCode: 400, request to EC2\nIMDS failed\n\n\n:exit status 1","stacktrace":"main.main\n\t/app/cmd/atlantis-drift-detection/main.go:148\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271"} panic: failed to drift

The Atlantis is able to plan and apply at its end.
`jobs:
drift:
name: Detect Terraform Drift
runs-on: ubuntu-latest
- name: Detect Drift
uses: cresta/[email protected]
env:
ATLANTIS_HOST: http:/XXXXXX:4141
ATLANTIS_TOKEN: ${{ secrets.ATLANTIS_TOKEN }}
REPO: magnifi-codeverse/platform-engineering-infra # Change this to your repo
GITHUB_TOKEN: ${{ secrets.ATLANTIS_GITHUB_TOKEN }}

`
Only added above part as the action for testing but it is showing the above error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant