Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18243

Source Code Checkout fails when Repository cache is stored on Windows using Cygwin Git

    XMLWordPrintable

Details

    • Bug
    • Resolution: Answered
    • Low
    • None
    • 5.12.3.1, 5.14.4.1
    • None

    Description

      Summary

      The Bamboo Source Code Checkout task fails when Repository cache is stored on Windows using Cygwin Git. There has been some changes to Cygwin Git libraries and the way it handles the remote origin path. Bamboo needs to adapt to the recent changes made to Cygwin Git.

      Steps to Reproduce

      Install Bamboo Server or remote agent on a Windows machine using Cygwin Git.

      • Instructions on how to install Cygiwn Git here: Installing GIT on Windows (using Cygwin). If you are installing Cygwin for the first time, don't forget to:
        • Add Cygwin to Path (e.g. C:\cygwin64\bin).
        • Download all of the packages related to Git and OpenSSH while installing Cygwin.
        • Set the remote agent git binary path (e.g. C:\cygwin64\bin\git.exe).

      Trigger a manual build with a Source Code Checkout task to download code from your Git repository.

      • If you are using remote agents, check the option to enable remote agent caching.

      Expected Results

      Build will succeed.

      Actual Results

      Build fails with the following error message:

      simple	09-Mar-2017 18:42:26	Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
      simple	09-Mar-2017 18:42:26	Updating source code to revision: 5484e78c6c634009f678eb6a21162d531659aea3
      simple	09-Mar-2017 18:42:26	C:\cygwin64\bin\git.exe version
      simple	09-Mar-2017 18:42:26	C:\cygwin64\bin\git.exe log -1 --encoding=UTF-8 --format=%H HEAD
      simple	09-Mar-2017 18:42:26	C:\cygwin64\bin\git.exe ls-remote https://gobrunoo:********@github.com/gobrunoo/usage.git
      simple	09-Mar-2017 18:42:27	Fetching 'refs/heads/master' from 'https://github.com/gobrunoo/usage.git'.
      simple	09-Mar-2017 18:42:27	C:\cygwin64\bin\git.exe fetch https://gobrunoo:********@github.com/gobrunoo/usage.git +refs/heads/master:refs/heads/master --update-head-ok --progress --verbose
      simple	09-Mar-2017 18:42:28	From https://github.com/gobrunoo/usage
      simple	09-Mar-2017 18:42:28	 = [up to date]      master     -> master
      simple	09-Mar-2017 18:42:28	C:\cygwin64\bin\git.exe log -1 --encoding=UTF-8 --format=%H 5484e78c6c634009f678eb6a21162d531659aea3
      simple	09-Mar-2017 18:42:28	Checking out revision 5484e78c6c634009f678eb6a21162d531659aea3.
      simple	09-Mar-2017 18:42:28	Creating local git repository in 'C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\GIT-GIT-JOB1\.git'.
      simple	09-Mar-2017 18:42:28	C:\cygwin64\bin\git.exe clone C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\_git-repositories-cache\2c00d41937a5d7e8f9bbf7d7dc4415d1f4fcfa6e --shared --no-checkout C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\GIT-GIT-JOB1
      simple	09-Mar-2017 18:42:28	Cloning into 'C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\GIT-GIT-JOB1'...
      simple	09-Mar-2017 18:42:28	fatal: '/cygdrive/c/Users/Administrator/Documents/Atlassian/RemoteAgents/Bamboo5.14.3.1/Home/xml-data/build-dir/GIT-GIT-JOB1/C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\_git-repositories-cache\2c00d41937a5d7e8f9bbf7d7dc4415d1f4fcfa6e' does not appear to be a git repository
      simple	09-Mar-2017 18:42:28	fatal: Could not read from remote repository.
      simple	09-Mar-2017 18:42:28	
      simple	09-Mar-2017 18:42:28	Please make sure you have the correct access rights
      simple	09-Mar-2017 18:42:28	and the repository exists.
      error	09-Mar-2017 18:42:28	Checkout to revision 5484e78c6c634009f678eb6a21162d531659aea3 has failed.
      simple	09-Mar-2017 18:42:28	C:\cygwin64\bin\git.exe remote set-url origin file://C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\_git-repositories-cache\2c00d41937a5d7e8f9bbf7d7dc4415d1f4fcfa6e
      simple	09-Mar-2017 18:42:29	fatal: Not a git repository (or any parent up to mount point /cygdrive/c)
      simple	09-Mar-2017 18:42:29	Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
      simple	09-Mar-2017 18:42:29	Warning: failed to checkout source code to directory 'C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\GIT-GIT-JOB1', trying to recover...
      simple	09-Mar-2017 18:42:29	Cleaned source directory 'C:\Users\Administrator\Documents\Atlassian\RemoteAgents\Bamboo5.14.3.1\Home\xml-data\build-dir\GIT-GIT-JOB1'...
      

      Workaround

      Bamboo Remote Agents

      If this is happening on a Bamboo remote agent running on a Windows machine:

      • Advise users to switch to using Git for Windows as it's more reliable. We've had many problems with the Git implementation for Cygwin in the past and have opted to suggest Git for Windows as it's more stable, as seen on the Bamboo Supported Platforms.
      • Don't store the Git cache on the remote agent side. If we store the cache on the Bamboo Server side, it will be handled by the Git distribution installed on the server running Bamboo.

      Bamboo Server
      If this is happening to local agents and Bamboo Server is running on a Windows machine with Cygwin Git, please switch to using Git for Windows.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brosa Bruno Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: