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

Git plugin needs a better error diagnosis when failing to check out

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None

      Description

      An user reported the following error in the IRC, where he fails to fetch from origin. As you can see, the Git plugin is not reporting the output from Git (nor the exit code), which makes trobule-shooting unnecessarily hard.

      In case of a failure, it should report the output and exit code.

      Checkout:workspace / /Users/administrator/Documents/Jenkins/jobs/FLOW3 raise submodules in Base distribution/workspace - hudson.remoting.LocalChannel@35b5a4ca
      Using strategy: Default
      Last Built Revision: Revision e94111b7f46946051dda9ff1ca30e2c0299e025c (origin/master)
      Checkout:workspace / /Users/administrator/Documents/Jenkins/jobs/FLOW3 raise submodules in Base distribution/workspace - hudson.remoting.LocalChannel@35b5a4ca
      Fetching changes from the remote Git repository
      Fetching upstream changes from ssh://review.typo3.org/FLOW3/Distributions/Base
      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:852)
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:812)
      	at hudson.FilePath.act(FilePath.java:757)
      	at hudson.FilePath.act(FilePath.java:739)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:812)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1182)
      	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:521)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
      	at hudson.model.Run.run(Run.java:1362)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:145)
      

        Issue Links

          Activity

          Hide
          askedrelic Matt Behrens added a comment -

          I would like this second this, for the increased error output and if this a "fetch" bug or related.

          I'm running Hudson ver. 1.380 and Git Plugin 1.1.6 and getting this same "ERROR: Could not fetch from any repository" when trying to fetch from a Github private repository. Logging in, switching to the hudson user and doing a `git fetch` from the repository succeeds, which makes me rule out an SSH/key issue.

          Show
          askedrelic Matt Behrens added a comment - I would like this second this, for the increased error output and if this a "fetch" bug or related. I'm running Hudson ver. 1.380 and Git Plugin 1.1.6 and getting this same "ERROR: Could not fetch from any repository" when trying to fetch from a Github private repository. Logging in, switching to the hudson user and doing a `git fetch` from the repository succeeds, which makes me rule out an SSH/key issue.
          Hide
          abayer abayer added a comment -

          Looks like this was actually fixed by commit a1f63b8d09323d3ce49a27ad3bd6fa7e745298e1 and will be in the next release.

          Show
          abayer abayer added a comment - Looks like this was actually fixed by commit a1f63b8d09323d3ce49a27ad3bd6fa7e745298e1 and will be in the next release.
          Hide
          markewaite Mark Waite added a comment -

          The git plugin and git client plugin provide much more detailed output to show the operations being performed.

          The output is verbose enough that there is now a request to allow user control of the granularity of log output. Refer to JENKINS-24304 for the details of that feature request.

          Show
          markewaite Mark Waite added a comment - The git plugin and git client plugin provide much more detailed output to show the operations being performed. The output is verbose enough that there is now a request to allow user control of the granularity of log output. Refer to JENKINS-24304 for the details of that feature request.
          Hide
          tsniatowski Tomasz Śniatowski added a comment -

          I believe this was resolved erroneously. The bug report was about the git plugin hiding error output, and the output Mark mentioned is only a log of all the commands issued – but if any of them fails, their stderr is still not logged. This sometimes makes debugging difficult, especially in the case of transient errors.

          It's not helpful at all, for example, if we have a single error 24h ago that fixed itself later, where all we get in the log is Error cloning remote repo 'origin' with no way to know if it was a timeout, authentication error or a broken workspace. Getting git's stderr into the log would be much better.

          I was about to report this as a new bug but found this instead. I can file it again if you prefer – but I think this one should be reopened.

          Show
          tsniatowski Tomasz Śniatowski added a comment - I believe this was resolved erroneously. The bug report was about the git plugin hiding error output , and the output Mark mentioned is only a log of all the commands issued – but if any of them fails, their stderr is still not logged. This sometimes makes debugging difficult, especially in the case of transient errors. It's not helpful at all, for example, if we have a single error 24h ago that fixed itself later, where all we get in the log is Error cloning remote repo 'origin' with no way to know if it was a timeout, authentication error or a broken workspace. Getting git's stderr into the log would be much better. I was about to report this as a new bug but found this instead. I can file it again if you prefer – but I think this one should be reopened.
          Hide
          markewaite Mark Waite added a comment -

          Tomasz Śniatowski thanks for looking for existing bugs before submitting a new bug. That is much appreciated!

          When this bug was closed, the diagnostic output was visible. Unfortunately, I made a change in late 2014 (Ocrober-ish) which removed that diagnostic output and made things much worse. Kohsuke recently submitted a fix for my mistake. If you'd be willing to test that fix before the next release of the git plugin, that would be a great help. That would let you confirm that the desired output is available in the specific case you're trying to diagnose.

          My apologies that I introduced a regression. That regression has now been documented through 2 or more bug reports (one from me, one from Jesse Glick).

          Show
          markewaite Mark Waite added a comment - Tomasz Śniatowski thanks for looking for existing bugs before submitting a new bug. That is much appreciated! When this bug was closed, the diagnostic output was visible. Unfortunately, I made a change in late 2014 (Ocrober-ish) which removed that diagnostic output and made things much worse. Kohsuke recently submitted a fix for my mistake . If you'd be willing to test that fix before the next release of the git plugin, that would be a great help. That would let you confirm that the desired output is available in the specific case you're trying to diagnose. My apologies that I introduced a regression. That regression has now been documented through 2 or more bug reports (one from me, one from Jesse Glick).
          Hide
          tsniatowski Tomasz Śniatowski added a comment -

          I'll try testing that some time this week, currently occupied elsewhere and couldn't find the time.

          Show
          tsniatowski Tomasz Śniatowski added a comment - I'll try testing that some time this week, currently occupied elsewhere and couldn't find the time.

            People

            • Assignee:
              abayer abayer
              Reporter:
              kohsuke Kohsuke Kawaguchi
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: