need better error message when missing github secret.
When a user forgets to either miss to do below 3 things for the setup of Github secret prior to running any pipeline the build step in pipeline fails
Error snippet :
{"level":"warn","ts":1568057939.538,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: \"KO_DATA_PATH\" does not exist or is empty"}
{"level":"error","ts":1568057939.8545134,"logger":"fallback-logger","caller":"git/git.go:35","msg":"Error running git [fetch --depth=1 --recurse-submodules=yes origin fc7fe7fb8d87779dd5419b509dd2c91e63ba87b7]: exit status 128\nfatal: could not read Username for 'https://github.ibm.com': No such device or address\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:35\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:88\nmain.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:36\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:198"}
{"level":"error","ts":1568057940.1771348,"logger":"fallback-logger","caller":"git/git.go:35","msg":"Error running git [pull --recurse-submodules=yes origin]: exit status 1\nfatal: could not read Username for 'https://github.ibm.com': No such device or address\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:35\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:91\nmain.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:36\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:198"}
{"level":"warn","ts":1568057940.1772096,"logger":"fallback-logger","caller":"git/git.go:92","msg":"Failed to pull origin : exit status 1"}
{"level":"error","ts":1568057940.1798232,"logger":"fallback-logger","caller":"git/git.go:35","msg":"Error running git [checkout fc7fe7fb8d87779dd5419b509dd2c91e63ba87b7]: exit status 128\nfatal: reference is not a tree: fc7fe7fb8d87779dd5419b509dd2c91e63ba87b7\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:35\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:94\nmain.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:36\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:198"}
{"level":"fatal","ts":1568057940.179904,"logger":"fallback-logger","caller":"git-init/main.go:37","msg":"Error fetching git repository: exit status 128","stacktrace":"main.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:37\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:198"}
Step failed
This type of error can occur for a set of related reasons:
1.
2.
3.
We were able to reproduce it when we have our project in github.ibm.com and we miss to setup github secret for it in the cluster before running the pipelinerun. If user miss to do that you get the error shown in description of this issue.
After investigation we found it comes from Tektoncd code.
Below is the direct link to the Tekton code from where the error is coming which we see after the failure of the pipeline.
https://github.com/tektoncd/pipeline/blob/master/pkg/git/git.go#L35
The problem is the error is not showing clear message that github secret is missing.
This issue was created as a output of other issue in pipelines repository (https://github.com/kabanero-io/kabanero-pipelines)
Below is the reference issue:
https://github.com/kabanero-io/kabanero-pipelines/issues/54
@aadeshpa
hi Ashish
so did you finally fixed this issue?
I got the same error ...
It seems that Tekton only support the secret for github.com gitlab.com , not support the private github
If possible I am willing to contribute on this one
/assign
/kind documentation
@aadeshpa
hi Ashish
so did you finally fixed this issue?
I got the same error ...
It seems that Tekton only support the secret for github.com gitlab.com , not support the private github
It is definitely possible to clone git repos from github.ibm.com, this works fine for me:
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
generateName: use-github-ibm-
spec:
taskSpec:
inputs:
resources:
- name: source
type: git
steps:
- name: list-git
image: busybox
script: |
#!/bin/sh
set -ex
ls $(inputs.resources.source.path)
inputs:
resources:
- name: source
resourceSpec:
params:
- name: url
value: [email protected]:Andrea-Frittoli/beamer_template.git
- name: revision
value: master
type: git
where the following is attached to my service account:
secrets:
- name: github-ibm
and the secret is annotated with the tekton annotation.
Looking at the initial log in this ticket, I see that the URL is an anonymous only one: https://github.ibm.com. Could you try [email protected] or git+ssh://github.ibm.com/ instead?
@afrittoli : thank you for the details, however we were able to get it working once we created a secret for github.ibm.com with our account , however did not came back and updated this issue . Will mark this issue as closed