Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20189

git can't clone but doesn't ever call git clone

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None
    • Linux RHEL 6.4

      For some reason I can't clone or update git jobs after updating to Jenkins 1.536. I can see that it calls git --version but it never seems to call git clone. I've verified this by wrapping the git command with a shell script to log it. I've blown away the workspace and had Jenkins rebuild it, still produces the same git error.

      Last Built Revision: Revision 1480f9f672147b2e1b7daad55dc74048fa977bf1 (origin/master)
      Cloning the remote Git repository
      Cloning repository https://github.com/EMSL-MSC/go-rpms.git
      git --version
      git version 1.7.1
      ERROR: Error cloning remote repo 'origin' : Could not clone https://github.com/EMSL-MSC/go-rpms.git
      hudson.plugins.git.GitException: Could not clone https://github.com/EMSL-MSC/go-rpms.git
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:286)
      at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.clone(AbstractGitAPIImpl.java:59)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:47)
      at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1012)
      at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:948)
      at hudson.FilePath.act(FilePath.java:912)
      at hudson.FilePath.act(FilePath.java:885)
      at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:948)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1114)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
      at hudson.model.Run.execute(Run.java:1665)
      at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)
      at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
      Caused by: hudson.plugins.git.GitException: Failed to connect to https://github.com/EMSL-MSC/go-rpms.git
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1374)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1326)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:47)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:280)
      ... 17 more
      Trying next repository
      ERROR: Could not clone repository
      java.io.IOException: Could not clone
      at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1025)
      at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:948)
      at hudson.FilePath.act(FilePath.java:912)
      at hudson.FilePath.act(FilePath.java:885)
      at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:948)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1114)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
      at hudson.model.Run.execute(Run.java:1665)
      at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)
      at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
      Finished: FAILURE

          [JENKINS-20189] git can't clone but doesn't ever call git clone

          David Brown added a comment -

          Yes I agree this, this has happened just recently. I think our back traces are slightly different, I have an IOException you have a NullPointerException. With a NullPointerException I think you might just have to fill out something in the web page that you didn't have to in the past. I'm thinking mine has to do something with the file system or the OS but the my exception doesn't say what the IO error was about.

          David Brown added a comment - Yes I agree this, this has happened just recently. I think our back traces are slightly different, I have an IOException you have a NullPointerException. With a NullPointerException I think you might just have to fill out something in the web page that you didn't have to in the past. I'm thinking mine has to do something with the file system or the OS but the my exception doesn't say what the IO error was about.

          David Brown added a comment -

          Additionally,

          I do the following as tomcat in the workspace.

          -bash-4.1$ git clone https://github.com/EMSL-MSC/go-rpms.git go-master
          Initialized empty Git repository in /srv/jenkins/workspace/go-master/.git/
          remote: Counting objects: 45, done.
          remote: Compressing objects: 100% (41/41), done.
          remote: Total 45 (delta 20), reused 25 (delta 3)
          Unpacking objects: 100% (45/45), done.
          -bash-4.1$ cd go-master/
          -bash-4.1$ ls
          cgo.patch COPYING download.bat download.sh go-goos.c-no-envvars.diff go.spec install.bat Makefile README.md runit.bat uninstall.bat
          -bash-4.1$ logout

          and it works.

          David Brown added a comment - Additionally, I do the following as tomcat in the workspace. -bash-4.1$ git clone https://github.com/EMSL-MSC/go-rpms.git go-master Initialized empty Git repository in /srv/jenkins/workspace/go-master/.git/ remote: Counting objects: 45, done. remote: Compressing objects: 100% (41/41), done. remote: Total 45 (delta 20), reused 25 (delta 3) Unpacking objects: 100% (45/45), done. -bash-4.1$ cd go-master/ -bash-4.1$ ls cgo.patch COPYING download.bat download.sh go-goos.c-no-envvars.diff go.spec install.bat Makefile README.md runit.bat uninstall.bat -bash-4.1$ logout and it works.

          David Brown added a comment -

          Ah, additionally I was at git client 1.5.0 and just recently got 2.0 and now I'm getting something similar to Ricardo.

          Building on master in workspace /srv/jenkins/workspace/go-master
          Cloning the remote Git repository
          Cloning repository https://github.com/EMSL-MSC/go-rpms.git
          git --version
          git version 1.7.1
          ERROR: Error cloning remote repo 'origin'
          hudson.plugins.git.GitException: Could not clone https://github.com/EMSL-MSC/go-rpms.git
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:286)
          at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:828)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
          at hudson.model.Run.execute(Run.java:1665)
          at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:230)
          at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
          Caused by: hudson.plugins.git.GitException: Failed to connect to https://github.com/EMSL-MSC/go-rpms.git
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1380)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1326)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:47)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:280)
          ... 11 more
          ERROR: null
          Finished: FAILURE

          David Brown added a comment - Ah, additionally I was at git client 1.5.0 and just recently got 2.0 and now I'm getting something similar to Ricardo. Building on master in workspace /srv/jenkins/workspace/go-master Cloning the remote Git repository Cloning repository https://github.com/EMSL-MSC/go-rpms.git git --version git version 1.7.1 ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could not clone https://github.com/EMSL-MSC/go-rpms.git at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:286) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:828) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861) at hudson.model.AbstractProject.checkout(AbstractProject.java:1411) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557) at hudson.model.Run.execute(Run.java:1665) at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43) Caused by: hudson.plugins.git.GitException: Failed to connect to https://github.com/EMSL-MSC/go-rpms.git at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1380) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1326) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:47) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:280) ... 11 more ERROR: null Finished: FAILURE

          Ricardo Silva added a comment -

          I've downgraded the GIT Client to 1.4.0 and can again clone repositories, but only if the to the GitHub repository ends in .git.

          It used to work without the .git as I had several projects configured like this. But maybe the GitHub plugin allowed this, and it's currently disabled because of https://issues.jenkins-ci.org/browse/JENKINS-20201.

          Ricardo Silva added a comment - I've downgraded the GIT Client to 1.4.0 and can again clone repositories, but only if the to the GitHub repository ends in .git. It used to work without the .git as I had several projects configured like this. But maybe the GitHub plugin allowed this, and it's currently disabled because of https://issues.jenkins-ci.org/browse/JENKINS-20201 .

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
          http://jenkins-ci.org/commit/git-client-plugin/ddfde14d27aa6cd802dfc9897506eae4095b4f37
          Log:
          JENKINS-20189 automatically append .git to repo URL
          just as git-cli does when base URL don't resolve to a git repo

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/ddfde14d27aa6cd802dfc9897506eae4095b4f37 Log: JENKINS-20189 automatically append .git to repo URL just as git-cli does when base URL don't resolve to a git repo

          Ricardo Silva added a comment -

          Thanks for the update on the .git aside. But it was an aside, the original issue that 'git clone' doesn't work with git client versions above 1.4.0 (in my case) is still true.

          (The title is a bit misleading but the problem exists.)

          Ricardo Silva added a comment - Thanks for the update on the .git aside. But it was an aside, the original issue that 'git clone' doesn't work with git client versions above 1.4.0 (in my case) is still true. (The title is a bit misleading but the problem exists.)

          Mark Waite added a comment -

          This was marked "Resolved" some time ago. Now marking it "Closed" since there is

          Mark Waite added a comment - This was marked "Resolved" some time ago. Now marking it "Closed" since there is

          Daniel Beck added a comment -

          markewaite Preceding comment is incomplete.

          Daniel Beck added a comment - markewaite Preceding comment is incomplete.

          Mark Waite added a comment -

          Jira for that comment does not allow me to edit the comment. The comment should have said that I am marking it Closed since git versions prior to 1.7.10 do not support credentials, and credentials are now a key part of the git plugin use model.

          Mark Waite added a comment - Jira for that comment does not allow me to edit the comment. The comment should have said that I am marking it Closed since git versions prior to 1.7.10 do not support credentials, and credentials are now a key part of the git plugin use model.

          Daniel Beck added a comment -

          markewaite:

          Jira for that comment does not allow me to edit the comment

          Probably thanks to 'Closed' status, just like it doesn't allow editing the issue. Hoping for INFRA-119.

          Daniel Beck added a comment - markewaite : Jira for that comment does not allow me to edit the comment Probably thanks to 'Closed' status, just like it doesn't allow editing the issue. Hoping for INFRA-119.

            ndeloof Nicolas De Loof
            dmlb2000 David Brown
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: