I'm attempting to set up a build in Jenkins using SSH credentials for Git as we are using submodules in the repository. Currently seeing the following error:
Cloning the repo on the server itself works fine over SSH, logged in as the user account that Jenkins runs under and using the same credentials with the same private key that is uploaded to Jenkins Credentials plugin.
I'm running the following versions:
I had this error recently. In my case it turned out to be Jenkins being run as a service under the Local System account and picking up a system environment variable GIT_SSH which was set to plink.exe (my user account uses this setup so that TortoiseGit via Git for Windows can access a GitLab server). The use of plink seems incompatible with Jenkins credentials.
I unset the system environment variable e.g. by adding _DONT to its name as shown below and rebooted which fixed the error.
In your case, if the user running Jenkins can successfully clone, have you tried not supplying any credentials?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With