Hello World,

I have the following setup:

git Server: Debian Linux 9.1
Jenkins master: Debian Linux 9.1
Jenkins agent: Windows 7

I created a user on the git server for building, it is called "build". I also have created a ssh key-pair for that user. The public key is in the authorized_keys file on the git server. I have installed PuTTY on the Windows agent, and I autostart Pageant with the key for the user "build". git v2.14.2 is installed on Windows as well and GIT_SSH contains the full path to PuTTY plink.exe. If I use PuTTY to log in to the git server, it works without a problem (and without a password as well as Pageant serves the key).

I now wanted to use this setup with Jenkins and it always fails. If I enter the git commands it shows on the console output on a cmd.exe it works, but it does not work with Jenkins.

I tried with the credentials username/password, I get:
Cloning repository ssh://git.metromec.ch/repositories/quartis.git
> git init C:\Jenkins-Jobs\workspace\Branch-origin-features-QT-7889 # timeout=10 Fetching upstream changes from ssh://git.metromec.ch/repositories/quartis.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Build user from the VMs
> git fetch --tags --progress ssh://git.metromec.ch/repositories/quartis.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git.metromec.ch/repositories/quartis.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: protocol error: bad line length character: logi

I tried without credentials from Jenkins, using the username directly in the repository string (thinking Pageant is running and will provide the key):
Cloning repository ssh://[email protected]/repositories/quartis.git
> git init C:\Jenkins-Jobs\workspace\Branch-origin-features-QT-7889 # timeout=10 Fetching upstream changes from ssh://[email protected]/repositories/quartis.git
 > git --version # timeout=10
> git fetch --tags --progress ssh://[email protected]/repositories/quartis.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://[email protected]/repositories/quartis.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: protocol error: bad line length character: buil

I also tried username/private key from Jenkins and got:
Cloning repository ssh://git.metromec.ch/repositories/quartis.git
> git init C:\Jenkins-Jobs\workspace\Branch-origin-features-QT-7889 # timeout=10 Fetching upstream changes from ssh://git.metromec.ch/repositories/quartis.git
 > git --version # timeout=10
using GIT_SSH to set credentials Build user from the VMs (with key)
> git fetch --tags --progress ssh://git.metromec.ch/repositories/quartis.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git.metromec.ch/repositories/quartis.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: plink: unknown option "-o"
fatal: Could not read from remote repository.

How do I provide the correct credentials for this user in this setup?

TIA and best regards
        Andreas
--
Andreas Tscharner                             [email protected]

Gordon's Law:
If you think you have the solution, the question was poorly phrased.

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d92a7ac0-9a49-c423-ca34-722604050156%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to