Question

I have two jobs on my Jenkins server. Both are based on git but only one works and I don't know why.

Job 1

The first one works with a Github repository. Configuration is as follows :

Repository URL: git://github.com/profilsoft/profilsoft.git

Name: origin

Refspec: +refs/heads/:refs/remotes/origin/

When I launch a build, I can see that in the log :

Building in workspace /var/lib/jenkins/jobs/Profilsoft - Tools/workspace

Checkout:workspace / /var/lib/jenkins/jobs/Profilsoft - Tools/workspace - hudson.remoting.LocalChannel@14a1e7ad

Using strategy: Default

Last Built Revision: Revision 5441ae757daccf1f3bf2edd392a7131eccdf6184 (origin/HEAD, origin/master)

Checkout:workspace / /var/lib/jenkins/jobs/Profilsoft - Tools/workspace - hudson.remoting.LocalChannel@14a1e7ad

Fetching changes from 1 remote Git repository

Fetching upstream changes from git://github.com/profilsoft/profilsoft.git

Seen branch in repository origin/HEAD

Seen branch in repository origin/master

Commencing build of Revision 5441ae757daccf1f3bf2edd392a7131eccdf6184 (origin/HEAD, origin/master)

Checking out Revision 5441ae757daccf1f3bf2edd392a7131eccdf6184 (origin/HEAD, origin/master)

Warning : There are multiple branch changesets here

[workspace] $ ant

Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar

Buildfile: /var/lib/jenkins/jobs/Profilsoft - Tools/workspace/build.xml

The build success without any trouble

Job 2

The second job have the following configuration

Repository URL: git@192.168.1.12:front

Name: origin

Refspec: +refs/heads/:refs/remotes/origin/

When I launch a build, I can see that in the log :

Building in workspace /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace

Checkout:workspace / /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace - hudson.remoting.LocalChannel@72be8e1

Using strategy: Default

Checkout:workspace / /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace - hudson.remoting.LocalChannel@72be8e1

Cloning the remote Git repository

Cloning repository origin

ERROR: Error cloning remote repo 'origin' : Could not clone git@192.168.1.12:front

Caused by: hudson.plugins.git.GitException: Error performing command: /usr/bin/git clone --progress -o origin git@192.168.1.12:front /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace

Command "/usr/bin/git clone --progress -o origin git@192.168.1.12:front /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace" returned status code 128: Cloning into /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace... No protocol specified

I have tried

  1. I put the content of my ~/.shh on /var/lib/jenkins/.ssh with with the correct permissions (600, jenkins:jenkins)
  2. I ran the command "/usr/bin/git clone --progress -o origin git@192.168.1.12:front /var/lib/jenkins/jobs/profilsoft-wordpress-plugin/workspace" in the console and it works perfectly (repository is cloned)
  3. I have updated the Git Plugin. I have the latest version.
  4. A coworker installed Jenkins and he has set the same configuration. The build has succeeded.

Anyone have any ideas?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top