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

Git plugin cannot find revision to build on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Windows 2008 Server 64 Bit
      NTFS
    • Similar Issues:

      Description

      After we upgraded the Git plugin from 1.1.14 to 1.1.16, all our builds on Windows build slaves started failing like this:

      Started by user anonymous
      Building remotely on win-slave1 in workspace d:\hudson\workspace\my-app
      Checkout:my-app / d:\hudson\workspace\my-app - hudson.remoting.Channel@95ff886:win-slave1
      Using strategy: Default
      Last Built Revision: Revision e00e2c1328a011ca99980e0ffd90f33337534b34 (origin/master)
      Checkout:my-app / d:\hudson\workspace\my-app - hudson.remoting.LocalChannel@470a4b80
      Fetching changes from 1 remote Git repository
      Fetching upstream changes from d:\hudson\shared\repo.git
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

      The builds on our Linux slaves are not affected. Wiping the workspaces on the Windows slaves did not help. Both clones and checkouts/updates seem to fail with the same error. Downgrading back to 1.1.14 made the Windows builds work again.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Ilari Mäkimattila
            Path:
            src/main/java/hudson/plugins/git/GitAPI.java
            http://jenkins-ci.org/commit/git-plugin/3de8e933225d7cc5369193866cde6d585621a0a3
            Log:
            Fixed a windows bug caused by unneeded escaping of curly brackets.

            This is related to a reported bug https://issues.jenkins-ci.org/browse/JENKINS-13007

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ilari Mäkimattila Path: src/main/java/hudson/plugins/git/GitAPI.java http://jenkins-ci.org/commit/git-plugin/3de8e933225d7cc5369193866cde6d585621a0a3 Log: Fixed a windows bug caused by unneeded escaping of curly brackets. This is related to a reported bug https://issues.jenkins-ci.org/browse/JENKINS-13007
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            Maybe this is because I use this with Cygpath plugin, but for me, http://jenkins-ci.org/commit/git-plugin/3de8e933225d7cc5369193866cde6d585621a0a3 was actually broken.

            I needed to use

            ^\\{commit\\}
            Show
            kohsuke Kohsuke Kawaguchi added a comment - Maybe this is because I use this with Cygpath plugin, but for me, http://jenkins-ci.org/commit/git-plugin/3de8e933225d7cc5369193866cde6d585621a0a3 was actually broken. I needed to use ^\\{commit\\}
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            src/main/java/hudson/plugins/git/GitAPI.java
            http://jenkins-ci.org/commit/git-plugin/8810661600f42c0ee2ce2d0352a2f01542b2c2af
            Log:
            [FIXED JENKINS-13007]

            On Windows command prompt, '^' is an escape character (http://en.wikipedia.org/wiki/Escape_character#Windows_Command_Prompt)
            This isn't a problem if 'git' we are executing is git.exe, because '^' is a special character only for the command processor,
            but if 'git' we are executing is git.cmd (which is the case of msysgit), then the arguments we pass in here ends up getting
            processed by the command processor, and so 'xyz^

            {commit}' becomes 'xyz{commit}

            ' and fails.

            Since we can't really tell if we are calling into git.exe or git.cmd, the best we can do for Windows
            is not to use '^

            {commit}

            '. This reverts 13f6038acc4fa5b5a62413155da6fc8cfcad3fe0
            and it will not dereference tags, but it's far better than having this method completely broken.

            See JENKINS-13007 where this blew up on Windows users.

            I filed https://github.com/msysgit/msysgit/issues/36 as a bug in msysgit.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: src/main/java/hudson/plugins/git/GitAPI.java http://jenkins-ci.org/commit/git-plugin/8810661600f42c0ee2ce2d0352a2f01542b2c2af Log: [FIXED JENKINS-13007] On Windows command prompt, '^' is an escape character ( http://en.wikipedia.org/wiki/Escape_character#Windows_Command_Prompt ) This isn't a problem if 'git' we are executing is git.exe, because '^' is a special character only for the command processor, but if 'git' we are executing is git.cmd (which is the case of msysgit), then the arguments we pass in here ends up getting processed by the command processor, and so 'xyz^ {commit}' becomes 'xyz{commit} ' and fails. Since we can't really tell if we are calling into git.exe or git.cmd, the best we can do for Windows is not to use '^ {commit} '. This reverts 13f6038acc4fa5b5a62413155da6fc8cfcad3fe0 and it will not dereference tags, but it's far better than having this method completely broken. See JENKINS-13007 where this blew up on Windows users. I filed https://github.com/msysgit/msysgit/issues/36 as a bug in msysgit.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            src/main/java/hudson/plugins/git/GitAPI.java
            http://jenkins-ci.org/commit/git-plugin/85afc7b0e64dd18c2807373880d1a8e2824fffbc
            Log:
            JENKINS-13007

            Based on the discussion in msysgit issue #36, tweaking the fix a bit more to bring back the capability to peal tags on Windows without getting affected by git.cmd/git.exe mess.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: src/main/java/hudson/plugins/git/GitAPI.java http://jenkins-ci.org/commit/git-plugin/85afc7b0e64dd18c2807373880d1a8e2824fffbc Log: JENKINS-13007 Based on the discussion in msysgit issue #36, tweaking the fix a bit more to bring back the capability to peal tags on Windows without getting affected by git.cmd/git.exe mess.
            Hide
            jhansche Joe Hansche added a comment -

            I also saw the plugin break with the same error message as of upgrading from 1.1.19 to 1.1.21 (https://github.com/jenkinsci/git-plugin/compare/git-1.1.19...git-1.1.21). This is on a Linux server, however. I have downgraded back to 1.1.19, and that has fixed the problem.

            Show
            jhansche Joe Hansche added a comment - I also saw the plugin break with the same error message as of upgrading from 1.1.19 to 1.1.21 ( https://github.com/jenkinsci/git-plugin/compare/git-1.1.19...git-1.1.21 ). This is on a Linux server, however. I have downgraded back to 1.1.19, and that has fixed the problem.

              People

              • Assignee:
                ndeloof Nicolas De Loof
                Reporter:
                ritzmann ritzmann
              • Votes:
                37 Vote for this issue
                Watchers:
                40 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: