0

So I am trying to set up our CICD pipeline to authenticate to github via a github app rather than a perosnal user token.

So once I follow the instructions (https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-admin-guide/github-app-auth) I run a pipeline and during startup the following error occurs.

ERROR: Error cloning remote repo 'origin'

hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress -- git@github.com:AusBOM/gridutility.git +refs/heads/master:refs/remotes/origin/master" returned status code 128:

stdout: 

stderr: Failed to add the RSA host key for IP address '20.248.137.48' to the list of known hosts (/home/jenkins/.ssh/known_hosts).

git@github.com: Permission denied (publickey).

fatal: Could not read from remote repository.

The known_hosts file is mounted as a volume from a kubernetes secret on the container we use to run the pipeline. So I have the ability to modify and update this if required and I believe I could do this for a personal access token but not sure how to do this for the github app authentication.

What can I do to fix this so that the github app authentication will work on the box.

user3559247
  • 1,117
  • 1
  • 11
  • 21
  • Please check if the user has required permissions or not? for executing that CI/CD pipeline? – Ramesh kollisetty Sep 28 '22 at 11:50
  • The pipeline was kicked off by myself who has permissions, the access issue is from the github app authentication to github, if I use the existing personal access token configured in the jenkins pipeline then it works fine – user3559247 Sep 29 '22 at 00:10
  • If there are already token available please check the permissions given to those tokens and replicate the same for new token.Please find more cases and steps for troubleshooting this issuefrom this official github [documentation](https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey). – Ramesh kollisetty Sep 29 '22 at 05:32

0 Answers0