Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Git Plugin - stderr: plink: unknown option "-o"

Tags:

git

ssh

jenkins

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:

enter image description here

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:

  • Jenkins - 1.625.3
  • Git plugin - 3.0.0
  • Git client plugin - 2.0.0
  • Credentials plugin - 2.1.4
like image 670
CraigA Avatar asked Mar 12 '23 02:03

CraigA


1 Answers

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.

Unset the system environment variable GIT_SSH

In your case, if the user running Jenkins can successfully clone, have you tried not supplying any credentials?

like image 77
hotblack944 Avatar answered Mar 14 '23 06:03

hotblack944