Jenkins Could not read from remote repository BitBucket

Viewed 296

I have a scenario where the Jenkins pipeline fails to read the remote repository using private key credential saying the following error:

load pubkey "/var/jenkins_home/caches/git-5e50bbd24415584a809683107dd1026f@tmp/jenkins-gitclient-##############.key": invalid format

When I try a rebuild it works fine. One thing that I observed is all the jobs that were running at that time failed with the same error. Is there a way I can make the git plugin used in the pipeline to clone a remote repository not use the cache for the key?

1 Answers

When you installed Git on the server and then created the key, did you follow these instructions?

Git is using OpenSSH and it does not support PuTTY key formats. To convert the key to OpenSSH format.

Open PuttyGen, click Load, load your private key, go to Conversions, and then click on Export OpenSSH, and export your private key. Copy your private key to ~/.ssh/id_rsa

Related