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

Specifying multiple git repositories to git plugin causes "git fetch" to fail on all repos after first repo

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • git-plugin
    • None
    • Linux master server using either master node or any Linux slave agent

    Description

      If I specify multiple git repositories to the git plugin by clicking the "Add" button in the "Repositories" area of the git section of the job configuration screen, then the "git fetch" for each added repository will fail with the message that the remote repository being fetched is invalid.

      In this example, I assigned the name "origin-mwaite1" to the second repository.

      ERROR: Problem fetching from origin-mwaite1 / origin-mwaite1 - could be unavailable. Continuing anyway
      hudson.plugins.git.GitException: Command "git fetch -t origin-mwaite1 +refs/heads/:refs/remotes/origin-mwaite1/" returned status code 128:
      stdout:
      stderr: fatal: 'origin-mwaite1' does not appear to be a git repository
      fatal: The remote end hung up unexpectedly

      I suspect the plugin has missed the necessary step of defining the remote repository with "git remote add" if the remote is not already defined in the working repository.

      This is only using the Git plugin, not any other plugin. This is not related to any "multiple SCM" plugin topics, nor to any interaction between other plugins and the Git plugin.

      Attachments

        Activity

          markewaite Mark Waite added a comment -

          Confirmed fixed

          markewaite Mark Waite added a comment - Confirmed fixed
          markewaite Mark Waite added a comment -

          My mistake for reopening the issue. I've confirmed it is resolved in the most recent source code of the combination of the git plugin and the git-client plugin. The current git-client release contains the fix. The next git-plugin release (likely 1.3.0) is expected to include the fix.

          markewaite Mark Waite added a comment - My mistake for reopening the issue. I've confirmed it is resolved in the most recent source code of the combination of the git plugin and the git-client plugin. The current git-client release contains the fix. The next git-plugin release (likely 1.3.0) is expected to include the fix.
          markewaite Mark Waite added a comment -

          After installing a locally compiled copy of the git-plugin (1.3.0-SNAPSHOT (private-03/02/2013 05:29-mwaite) from the latest source code ( 9625801c185976562467a016e9d6998227c08f41 ), I confirmed this is fixed. The 1.3.0 release of the git plugin should resolve this issue.

          markewaite Mark Waite added a comment - After installing a locally compiled copy of the git-plugin (1.3.0-SNAPSHOT (private-03/02/2013 05:29-mwaite) from the latest source code ( 9625801c185976562467a016e9d6998227c08f41 ), I confirmed this is fixed. The 1.3.0 release of the git plugin should resolve this issue.
          markewaite Mark Waite added a comment -

          The issue does not seem to be fixed in git-client 1.0.3, even though the submission 130be9a0c15a953c4c7ea3e3e170e1583939d2d1 is included in 1.0.3.

          I defined a job with two repositories, one named git-protocol and the other named local-file-system. When I execute the job, the console output reports:

          Started by user anonymous
          Building on master in workspace /var/lib/jenkins/jobs/bin-multi-2/workspace
          Checkout:workspace / /var/lib/jenkins/jobs/bin-multi-2/workspace - hudson.remoting.LocalChannel@192a97b
          Using strategy: Default
          Cloning the remote Git repository
          Cloning repository git://markwaite2.markwaite.net/git/bin.git
          git --version
          git version 1.7.10.4
          Fetching upstream changes from git-protocol
          Fetching upstream changes from local-file-system
          ERROR: Problem fetching from local-file-system / local-file-system - could be unavailable. Continuing anyway.
          hudson.plugins.git.GitException: Command "git fetch -t local-file-system +refs/heads/:refs/remotes/local-file-system/" returned status code 128:
          stdout:
          stderr: fatal: 'local-file-system' does not appear to be a git repository
          fatal: The remote end hung up unexpectedly

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:772)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:738)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:159)
          at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1023)
          at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:941)
          at hudson.FilePath.act(FilePath.java:852)
          at hudson.FilePath.act(FilePath.java:834)
          at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:941)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1113)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:590)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:495)
          at hudson.model.Run.execute(Run.java:1502)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)
          Seen branch in repository git-protocol/HEAD
          Seen branch in repository git-protocol/master
          Commencing build of Revision 31ea928f9fc14022855618fac3621f10ecad2cf8 (git-protocol/master, git-protocol/HEAD)
          Checking out Revision 31ea928f9fc14022855618fac3621f10ecad2cf8 (git-protocol/master, git-protocol/HEAD)
          No change to record in branch git-protocol/master
          No change to record in branch git-protocol/HEAD
          [workspace] $ echo hello world
          hello world
          Finished: SUCCESS

          markewaite Mark Waite added a comment - The issue does not seem to be fixed in git-client 1.0.3, even though the submission 130be9a0c15a953c4c7ea3e3e170e1583939d2d1 is included in 1.0.3. I defined a job with two repositories, one named git-protocol and the other named local-file-system. When I execute the job, the console output reports: Started by user anonymous Building on master in workspace /var/lib/jenkins/jobs/bin-multi-2/workspace Checkout:workspace / /var/lib/jenkins/jobs/bin-multi-2/workspace - hudson.remoting.LocalChannel@192a97b Using strategy: Default Cloning the remote Git repository Cloning repository git://markwaite2.markwaite.net/git/bin.git git --version git version 1.7.10.4 Fetching upstream changes from git-protocol Fetching upstream changes from local-file-system ERROR: Problem fetching from local-file-system / local-file-system - could be unavailable. Continuing anyway. hudson.plugins.git.GitException: Command "git fetch -t local-file-system +refs/heads/ :refs/remotes/local-file-system/ " returned status code 128: stdout: stderr: fatal: 'local-file-system' does not appear to be a git repository fatal: The remote end hung up unexpectedly at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:772) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:738) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:159) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1023) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:941) at hudson.FilePath.act(FilePath.java:852) at hudson.FilePath.act(FilePath.java:834) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:941) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1113) at hudson.model.AbstractProject.checkout(AbstractProject.java:1256) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:590) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:495) at hudson.model.Run.execute(Run.java:1502) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Seen branch in repository git-protocol/HEAD Seen branch in repository git-protocol/master Commencing build of Revision 31ea928f9fc14022855618fac3621f10ecad2cf8 (git-protocol/master, git-protocol/HEAD) Checking out Revision 31ea928f9fc14022855618fac3621f10ecad2cf8 (git-protocol/master, git-protocol/HEAD) No change to record in branch git-protocol/master No change to record in branch git-protocol/HEAD [workspace] $ echo hello world hello world Finished: SUCCESS

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          http://jenkins-ci.org/commit/git-plugin/5e898848a12a4923b7d882bdab0a31cd12ee9c44
          Log:
          JENKINS-16914 set remote.<remoteName>.url before fetch


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

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/5e898848a12a4923b7d882bdab0a31cd12ee9c44 Log: JENKINS-16914 set remote.<remoteName>.url before fetch – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          People

            ndeloof Nicolas De Loof
            markewaite Mark Waite
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: