You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Howdy, all -- I'm trying to build and push an image using Kaniko in a shared GitLab runner cluster. The IAM role for the instance that runs the job is not the one that I would like to use for the credential helper. I have credentials for an AWS user in our core users account which is meant to assume a role in our build account that has access to push to ECR.
I've configured the GitLab CI/CD variables to the following:
error pushing image: failed to push to destination [account_id].dkr.ecr.us-east-1.amazonaws.com/lambda-wbxf:5a7d58ff: HEAD https://[account_id].dkr.ecr.us-east-1.amazonaws.com/v2/lambda-wbxf/manifests/5a7d58ff: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)
And the output of the log file at ~/.ecr/log/ecr-login.log
time="2023-10-16T22:08:32Z" level=debug msg="Could not fetch credentials for cache prefix, disabling cache" error="failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or \"AWS_EC2_METADATA_DISABLED\" environment variable"
time="2023-10-16T22:08:32Z" level=debug msg="Retrieving credentials" region=us-east-1 registry=[account_id] serverURL=[account_id].dkr.ecr.us-east-1.amazonaws.com service=ecr
time="2023-10-16T22:08:32Z" level=debug msg="Calling ECR.GetAuthorizationToken" registry=[account_id]
time="2023-10-16T22:08:32Z" level=error msg="Error retrieving credentials" error="ecr: Failed to get authorization token: operation error ECR: GetAuthorizationToken, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or \"AWS_EC2_METADATA_DISABLED\" environment variable"
time="2023-10-16T22:08:32Z" level=debug msg="Could not fetch credentials for cache prefix, disabling cache" error="failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or \"AWS_EC2_METADATA_DISABLED\" environment variable"
time="2023-10-16T22:08:32Z" level=debug msg="Retrieving credentials" region=us-east-1 registry=[account_id] serverURL=[account_id].dkr.ecr.us-east-1.amazonaws.com service=ecr
time="2023-10-16T22:08:32Z" level=debug msg="Calling ECR.GetAuthorizationToken" registry=[account_id]
time="2023-10-16T22:08:32Z" level=error msg="Error retrieving credentials" error="ecr: Failed to get authorization token: operation error ECR: GetAuthorizationToken, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or \"AWS_EC2_METADATA_DISABLED\" environment variable"
It feels like the credential helper is not able to locate the credentials that are on the filesystem.
Any help on getting this squared away would be extremely helpful. Thanks!
The text was updated successfully, but these errors were encountered:
Howdy, all -- I'm trying to build and push an image using Kaniko in a shared GitLab runner cluster. The IAM role for the instance that runs the job is not the one that I would like to use for the credential helper. I have credentials for an AWS user in our core users account which is meant to assume a role in our build account that has access to push to ECR.
I've configured the GitLab CI/CD variables to the following:
AWS_CONFIG
(file)AWS_CREDENTIALS
(file)AWS_PROFILE
(variable)ECR_REPO_URI
(variable)As a test, I've created a job that should output the session information of the assumed role:
The output of this is exactly what I expect:
For the image build and push to ECR, I'm really not sure what I'm missing. Here is the job definition:
The line that throws the error in the job:
And the output of the log file at ~/.ecr/log/ecr-login.log
It feels like the credential helper is not able to locate the credentials that are on the filesystem.
Any help on getting this squared away would be extremely helpful. Thanks!
The text was updated successfully, but these errors were encountered: