pipeline: Following the tutorial fails with "error checking push permissions"
Expected Behavior
A successful docker login followed by a docker push to my repo docker.io/calvinpark/leeroy-web
Actual Behavior
[build-and-push] 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 "docker.io/calvinpark/leeroy-web": UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:calvinpark/leeroy-web Type:repository] map[Action:push Class: Name:calvinpark/leeroy-web Type:repository]]
Steps to Reproduce the Problem
- Follow the tutorial exactly
pipelineresource.yml
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: skaffold-git
spec:
type: git
params:
- name: revision
value: master
- name: url
value: https://github.com/GoogleContainerTools/skaffold
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: skaffold-image-leeroy-web
spec:
type: image
params:
- name: url
value: docker.io/calvinpark/leeroy-web
secret.yml
apiVersion: v1
kind: Secret
metadata:
name: regcred
annotations:
tekton.dev/docker-0: docker.io
type: kubernetes.io/basic-auth
data:
username: Y2FsdmlucGFyaw==
password: aHVudGVyMg==
cat /tekton/home/.docker/config.jsoncorrectly shows
{"auths":{"docker.io":{"username":"calvinpark","password":"*******","auth":"Y2FsdmlucGFyazpodW50ZXIy","email":"not@val.id"}}}
(password of course substituted with the real one)
Additional Info
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.5", GitCommit:"e0fccafd69541e3750d460ba0f9743b90336f24f", GitTreeState:"clean", BuildDate:"2020-04-16T11:35:47Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
$ tkn version
Client version: 0.9.0
Pipeline version: v0.12.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 15 (3 by maintainers)
Commits related to this issue
- Fix docker registry credentials issue by changing Kaniko version Fixes #2616 — committed to Peaorl/pipeline by Peaorl 4 years ago
- Fix docker registry credentials issue by changing Kaniko version Fixes #2616 — committed to tektoncd/pipeline by Peaorl 4 years ago
Hi all,
I had the same issue with same message.
I used the recommendation of @Peaorl to get it to work: use ‘index.docker.io’ (instead of my initial ‘docker.io’ for docker-server) and then everything goes fine.
kubectl create secret docker-registry secret-docker-credentials
–docker-server=‘index.docker.io’
–docker-username=$DOCKER_USERID
–docker-password=$DOCKER_PASSWORD
–docker-email=$DOCKER_EMAIL
Maybe the tutorial doc should be updated accordingly: I opened https://github.com/tektoncd/pipeline/pull/3298 for thhis purpose.
Best
Didier
I think you can leave the version strings out completely as @Peaorl suggested - so just
index.docker.ioin your secret andindex.docker.io/username/repo:tagin your Image PipelineResource.If you’re still having trouble it would be helpful to see your PipelineResource YAML and the
kubectl create secretcommand that you’re using. Leave out any sensitive info like usernames / passwords. Cheers!I’ve been trying this out and got it to work with the following settings:
Thank you very much, it is not working with gcr.io/kaniko-project/executor:v0.24.0 (as the only difference as my previous message) but it is working with gcr.io/kaniko-project/executor:v0.16.0
Step 1 : Testing with gcr.io/kaniko-project/executor:v0.24.0 (image tag 1.0.0) => fail Step 2 : Testing with gcr.io/kaniko-project/executor:v0.16.0 (image tag 1.0.0) => success Step 3 : Testing with gcr.io/kaniko-project/executor:v0.17.1 (image tag 1.0.1) => fail, same logs as step 1 Step 4 : Testing with gcr.io/kaniko-project/executor:v0.24.0 (image tag 1.0.1) => fail, same logs as step 1 Step 5 : Testing with gcr.io/kaniko-project/executor:v0.16.0 (image tag 1.0.1) => success, same logs as step 2
Only working with 0.16.0
Logs with gcr.io/kaniko-project/executor:v0.24.0, step 1
Logs with gcr.io/kaniko-project/executor:v0.16.0, step 2
You’re welcome!
Following your steps we had similar authentication errors even though the only things changed as compared to the tekton tutorial were the input repo you specified along with omitting a docker context.
In the end we tried a different Kaniko version, namely v0.16.0. Which means specifying the following image under the build-and-push step in cicd-tekton/task.yaml:
image: gcr.io/kaniko-project/executor:v0.16.0This allowed us to successfully push the image to a private docker repo. We then tried the latest Kaniko version (v0.24.0) which also worked. After that we tried v0.17.1 again which actually worked this time around.
At the moment we’re not sure what is causing this issue but these steps should resolve the problem. Perhaps you could try v0.24.0 right away and see whether that resolves the issue as well.