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

asking hudson to build a git project whose repository is empty permanently disables builds until manual rmdir of workspace

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-plugin
    • None

      The initial git clone will behave differently than normal because git doesn't behave consistently across empty/non-empty repositories. Subsequent build attempts, even after making the repository non-empty, end up failing with:

      ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
      ERROR: Could not fetch from any repository
      FATAL: Could not fetch from any repository
      hudson.plugins.git.GitException: Could not fetch from any repository
      at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:735)
      at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:702)
      at hudson.FilePath.act(FilePath.java:753)
      at hudson.FilePath.act(FilePath.java:735)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:702)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1116)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
      at hudson.model.Run.run(Run.java:1324)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:349)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:139)

      This should be easy to reproduce and I strongly suspect it's just about the difference in which git initializes .git/config for the empty/non-empty cases. I'm not familiar with hudson and it's git plugin enough to make any concrete suggestions as to how it should be handled in this particular case

          [JENKINS-8593] asking hudson to build a git project whose repository is empty permanently disables builds until manual rmdir of workspace

          Aleksi Aalto added a comment -

          I had the exact same issue. I solved it by downgrading to version 1.1.4.

          Aleksi Aalto added a comment - I had the exact same issue. I solved it by downgrading to version 1.1.4.

          Mark Waite added a comment -

          I've confirmed that this is no longer an issue with git-client-plugin 1.6.2 and git-plugin 2.0.1 and later. I verified it with both the command line implementation and the JGit implementation.

          Steps I took:

          • Create an empty bare repository on my git server (git protocol)
          • Define a job which clones that bare repository
          • Run that job and confirm the job fails (no revision to checkout)
          • Push a change to that bare repository from a clone made elsewhere
          • Run the job again and confirm that the job succeeds

          Mark Waite added a comment - I've confirmed that this is no longer an issue with git-client-plugin 1.6.2 and git-plugin 2.0.1 and later. I verified it with both the command line implementation and the JGit implementation. Steps I took: Create an empty bare repository on my git server (git protocol) Define a job which clones that bare repository Run that job and confirm the job fails (no revision to checkout) Push a change to that bare repository from a clone made elsewhere Run the job again and confirm that the job succeeds

            abayer Andrew Bayer
            scode scode
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: