Issue Type: Bug Bug
Assignee: Nicolas De Loof
Components: git-client-plugin
Created: 10/Dec/14 11:36 AM
Description:

Jenkins setup: master + 1 slave
Master: Windows Server 2008 64-bit
Slave: Ubuntu 14.04.1 LTS x86-64

Git repositories server: GitLab 6.5.1
Repository SSH URL: git@<myserver>:test-group/my-test.git
There is "jenkins" user created in GitLab, and SSH public key generated at Ubuntu slave for that one is uploaded to user's GitLab profile.

Jenkins credentials contain entry for SSH username/public key with corresponding data for "jenkins" public key

Git client: official git client distributed via Ubuntu's package repositories
~$ git --version
git version 1.9.1
Build environment: build is restricted to be executed only on slave node. Job is configured to clone git repository from git@<myserver>:test-group/my-test.git using proper "jenkins" credentials. Build workspace is cleaned before. There are no any other build steps defined, so the expectation is to see that project sources are correctly checked out and build finishes with success status.
However, Git plugin execution is failing. See the log below:

Started by user admin
Building remotely on ubuntu_14.04 in workspace /home/jenkins/workspace/my-tests
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository git@<myserver>:test-group/my-test.git
 > git init /home/jenkins/workspace/my-tests # timeout=10
Fetching upstream changes from git@<myserver>:test-group/my-test.git
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git fetch --tags --progress git@<myserver>:test-group/my-test.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
ERROR: Error cloning remote repo 'origin'
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

I have figured out what are the commands that plugin issues in order to clone the repository. I combined them in the simple shell script, and ran that one as the build step. Below is the script content and resulting build output:

set +x
git --version
git init $WORKSPACE
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git config remote.origin.url git@<myserver>:test-group/my-test.git
# Fetching upstream changes from git@<myserver>:test-group/my-test.git
git fetch --tags git@<myserver>:test-group/my-test.git +refs/heads/*:refs/remotes/origin/*
GIT_REVISION=$(git rev-parse refs/remotes/origin/master^{commit})
echo "Checking out Revision $GIT_REVISION (refs/remotes/origin/master)"
git checkout -f $GIT_REVISION
Started by user admin
Building remotely on ubuntu_14.04 in workspace /home/jenkins/workspace/my-tests
Deleting project workspace... done

[my-tests] $ /bin/bash -xe /tmp/hudson7151967760759332823.sh
+ set +x
git version 1.9.1
Initialized empty Git repository in /home/jenkins/workspace/my-tests/.git/
>From <myserver>:test-group/my-test
 * [new branch]      master     -> origin/master
Checking out Revision 366ee0fbaf6483eab4057398d249e3b21f9dcd33 (refs/remotes/origin/master)
Note: checking out '366ee0fbaf6483eab4057398d249e3b21f9dcd33'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 366ee0f...  - refactoring made for xxx
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: SUCCESS

Executing the same sequence of commands from command line of slave node is also successful, thus results in project sources checked out for the latest revision..

In meanwhile I have the opportunity to try cloning exactly the same repository in the job created at another Jenkins instance. That system details are:
Jenkins: 1.590
Git Client plugin: 1.11.1
Git plugin: 2.3
Git Parameter plugin: 0.3.2
SSH Credentials plugin: 1.10
Only master node, running Ubuntu 14.04.1 x86_64
Git client: 1.9.1

Job configuration was made pretty much the same: same repository URL, same user for GitLab access. Build was supposed only to clone repository, and no more extra steps added. Here is the result:

Started by user jenkins
Building in workspace /var/lib/jenkins/workspace/dummy-check-git-clone
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository git@<myserver>:test-group/my-test.git
 > git init /var/lib/jenkins/workspace/dummy-check-git-clone # timeout=10
Fetching upstream changes from git@<myserver>:test-group/my-test.git
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git fetch --tags --progress git@<myserver>:test-group/my-test.git +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url git@<myserver>:test-group/my-test.git # timeout=10
 > git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git@<myserver>:test-group/my-test.git # timeout=10
Fetching upstream changes from git@<myserver>:test-group/my-test.git
using GIT_SSH to set credentials 
 > git fetch --tags --progress git@<myserver>:test-group/my-test.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 366ee0fbaf6483eab4057398d249e3b21f9dcd33 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 366ee0fbaf6483eab4057398d249e3b21f9dcd33
First time build. Skipping changelog.
Notifying upstream projects of job completion
Finished: SUCCESS

So far, it seems that Git Client plugin in v1.12.0 has some bug introduced, comparing to how it worked in v1.11.1; I suppose that with regard to the described problem Git plugin has nothing to do, that's why posting the issue here.
I replaced information like server names etc. due to corporative privacy concerns that I must follow.

Environment: Jenkins: 1.593
Git Client plugin: 1.12.0
Git plugin: 2.3.1
Git Parameter plugin: 0.3.2
SSH Credentials plugin: 1.10
Project: Jenkins
Priority: Major Major
Reporter: Sergii Kozak
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to