tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.44k stars 1.77k forks source link

Failed git clone #7067

Open Yeroha opened 1 year ago

Yeroha commented 1 year ago

Expected Behavior

Correct git clone

Actual Behavior

I try running pipeline with git-clone task. I am passing the necessary conditions to complete this task. Secret for connect to private git

apiVersion: v1
kind: Secret
metadata:
  name: tkn-git-ssh
  namespace: tkn-cicd
data:
  # cat id_ed25519-gitops-ssh | base64 -w 0
  id_rsa: LS0t.....
  # ssh-keyscan <GIT-URL> | base64 -w 0
  known_hosts: Z2l....

But my pipeline failed with error:

+ /ko-app/git-init '-url=git@<URL-TO-REPO>' '-revision=master' '-refspec=' '-path=/workspace/output/' '-sslVerify=true' '-submodules=true' '-depth=1' '-sparseCheckoutDirectories='
{"level":"warn","ts":1692860409.5486653,"caller":"git/git.go:271","msg":"URL(\"[git@<GIT-URL>](mailto:git@<URL-TO-REPO>\") appears to need SSH authentication but no SSH credentials have been provided"}
{"level":"error","ts":1692860409.5831604,"caller":"git/git.go:53","msg":"Error running git [init /workspace/output/]: exit status 128\nhint: Using 'master' as the name for the initial branch. This default branch name\nhint: is subject to change. To configure the initial branch name to use in all\nhint: of your new repositories, which will suppress this warning, call:\nhint: \nhint: \tgit config --global init.defaultBranch <name>\nhint: \nhint: Names commonly chosen instead of 'master' are 'main', 'trunk' and\nhint: 'development'. The just-created branch can be renamed via this command:\nhint: \nhint: \tgit branch -m <name>\nerror: chmod on /workspace/output/.git/config.lock failed: Operation not permitted\nfatal: could not set 'core.filemode' to 'false'\n","stacktrace":"[github.com/tektoncd/pipeline/pkg/git.run\n\tgithub.com/tektoncd/pipeline/pkg/git/git.go:53\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\tgithub.com/tektoncd/pipeline/pkg/git/git.go:88\nmain.main\n\tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:53\nruntime.main\n\truntime/proc.go:250](http://github.com/tektoncd/pipeline/pkg/git.run/n/tgithub.com/tektoncd/pipeline/pkg/git/git.go:53/ngithub.com/tektoncd/pipeline/pkg/git.Fetch/n/tgithub.com/tektoncd/pipeline/pkg/git/git.go:88/nmain.main/n/tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:53/nruntime.main/n/truntime/proc.go:250)"}
{"level":"fatal","ts":1692860409.5832539,"caller":"git-init/main.go:54","msg":"Error fetching git repository: exit status 128","stacktrace":"main.main\n\[tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:54\nruntime.main\n\truntime/proc.go:250](http://tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:54/nruntime.main/n/truntime/proc.go:250)"}

Additional Info

(paste your output here)
x4lpha commented 11 months ago

If its possible can you add the code of your pipeline run just to have more context and see where you call the task and the the parameters you are using. Thx @Yeroha