Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-2694

Cherry-pick to 1.9: git-clone with ssh-key fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • Pipelines 1.9.0
    • Pipelines 1.9.0
    • Operator
    • None
    • Pipelines Sprint 229, Pipelines Sprint 230

      Description of problem:

      git-clone with ssh-key fails

      Prerequisites (if any, like setup, operators/versions):

      Install Openshift Pipelines 1.8.1

      Steps to Reproduce

      1. Install Openshift Pipelines 1.8.1 Operator
      2. Create a pipeline with clustertask git-clone
      3. Create a secret wich ssh-key and attach it to pipeline service account
      4. Start the pipeline and provide ssh link repository to clone

      Actual results:

      The pipelinerun fails with the below error

      {"level":"error","ts":1668687926.8676572,"caller":"git/git.go:55","msg":"Error running git [fetch --recurse-submodules=yes --depth=1 origin --update-head-ok --force ]: exit status 128\nCould not create directory '/home/nonroot/.ssh'.\r\nFailed to add the host to the list of known hosts (/home/nonroot/.ssh/known_hosts).\r\ngit@github.com: Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:55\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:158\nmain.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:53\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:255"}
      {"level":"fatal","ts":1668687926.8677328,"caller":"git-init/main.go:54","msg":"Error fetching git repository: failed to fetch []: exit status 128","stacktrace":"main.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:54\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:255"} 

      Expected results:

      The pipelinerun should clone the repository without any error

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

              concaf Shubham Minglani
              ppitonak Pavol Pitoňák
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: