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

v0.21.0 breaks in cloudbuild for private GCR image #1242

Closed
victortrac opened this issue May 6, 2020 · 19 comments
Closed

v0.21.0 breaks in cloudbuild for private GCR image #1242

victortrac opened this issue May 6, 2020 · 19 comments

Comments

@victortrac
Copy link

Actual behavior
Builds using gcr.io/kaniko-project/executor:latest started failing with a GCR authentication error today when the kaniko is trying to build a private image hosted in GCR. Changing the kaniko executer tag to v0.20.0 fixes the problem.

gcr.io/kaniko-project/executor:latest
error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "gcr.io/<my-project-id>/<my-docker-image>:<my-docker-tag>": creating push check transport for gcr.io failed: GET https://gcr.io/v2/token?scope=repository%3A<my-project-id>%2F<my-docker-image>%3Apush%2Cpull&service=gcr.io: UNAUTHORIZED: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication

Expected behavior
Kaniko executor should be able to read the service account assigned to cloudbuild to pull the docker image from GCR just like in previous versions.

To Reproduce
Steps to reproduce the behavior:

  1. Use kaniko executor v0.21.0 in a cloudbuild that uses a private GCR image

Additional Information

  • Kaniko Image:
Digest: sha256:fee59f1fc71e70b3a0f4d93be747ff94a81e8079dcccef735005a29890b18a5e
Status: Downloaded newer image for gcr.io/kaniko-project/executor:latest

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@tejal29
Copy link
Member

tejal29 commented May 6, 2020

@victortrac Looks like this got fixed in #1238

Would you up for trying the edge build here to confirm?

gcr.io/kaniko-project/executor:debug-edge
gcr.io/kaniko-project/executor:edge

@deepapanwar
Copy link

Had same issue when using gcr.io/kaniko-project/executor:latest. Runs correctly when using gcr.io/kaniko-project/executor:debug-edge.

@dinvlad
Copy link

dinvlad commented May 7, 2020

Could you please keep this issue open, until this fix gets released in the new Kaniko version? Thanks!

@ALTELMA
Copy link

ALTELMA commented May 7, 2020

@dinvlad +1 and Let me know if it fixes asap.

@ctison
Copy link

ctison commented May 7, 2020

gcr.io/kaniko-project/executor:debug-edge fixed error checking push permissions [...] while using GOOGLE_APPLICATION_CREDENTIALS. Thanks.

@tejal29
Copy link
Member

tejal29 commented May 7, 2020

hey folks, I was able to verify the gcr.io/kaniko-project/executor:edge works with GCB.
I created an issue to add integration test for GCB.
Would love some contributions~
#1247

@tejal29
Copy link
Member

tejal29 commented May 7, 2020

Release branch is out #1248

@tejal29
Copy link
Member

tejal29 commented May 7, 2020

https://github.com/GoogleContainerTools/kaniko/releases/tag/v0.22.0 is out. Can someone please try this

@zoran15
Copy link

zoran15 commented May 7, 2020

https://github.com/GoogleContainerTools/kaniko/releases/tag/v0.22.0 is out. Can someone please try this

It appears to be working for us (compute-image-tools)

@TimShilov
Copy link

https://github.com/GoogleContainerTools/kaniko/releases/tag/v0.22.0 is out. Can someone please try this

Worked for me. Thanks! 👍

@tejal29
Copy link
Member

tejal29 commented May 7, 2020

Fixed on latest version v0.22.0

@ejose19
Copy link
Contributor

ejose19 commented May 25, 2020

I'm getting this on executor:debug-v0.22.0

WARN[0184] error uploading layer to cache: failed to push to destination us.gcr.io/... GET https://us.gcr.io/v2/token?scope=repository...: UNAUTHORIZED: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication 

Edit: Also since v0.20 kaniko is neither finding nor pushing to cache, using 0.19 still works

@here-nerd
Copy link

Seem to get reintroduced in v1.7.0.

tomanders added a commit to AtB-AS/atb-bff that referenced this issue Oct 21, 2021
@AchoArnold
Copy link

I can confirm @here-nerd I also have the same issue, Did you find a fix?

@Kliton
Copy link

Kliton commented Oct 21, 2021

+1

dancerj added a commit to dancerj/gitlstreefs that referenced this issue Oct 22, 2021
@hhuseyinpay
Copy link

+1

@dinvlad
Copy link

dinvlad commented Oct 22, 2021

There's a detailed discussion on it in #1786 btw

@danilo-devoteam
Copy link

+1

1 similar comment
@ALTELMA
Copy link

ALTELMA commented Nov 16, 2021

+1

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

No branches or pull requests