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

Git Credential Manager for Windows can cause Bamboo to queue the build until command timeout when authenticating with a public GitHub repository

    XMLWordPrintable

Details

    • 0
    • 2
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition

      When attempting to authenticate with a public GitHub repository by supplying a username and no password, if Git Credential Manager for Windows is installed it will launch an interactive child process in the background that waits for you to enter your GitHub credentials. Since Bamboo is being running the git command for change detection in an automated, non-interactive fashion – this process will never receive the credentials and terminate, so Bamboo will keep the build in the 'queued' state until the configured command timeout on the repository is reached with a log entry similar to the following:

      2017-02-15 01:47:54,686 INFO [9-BAM::PlanExec:pool-16-thread-1] [GitCommandProcessor] Command was canceled: command 'C:\Program Files\Git\cmd\git.exe' ls-remote https://user@github.com/repository-owner/repo.git failed with code -1. Working directory was [.].
      

      Suggested Solution

      1. If technically feasible, it'd be fantastic if we could detect that this was occurring and either bypass the credential manager in some fashion or kill the build earlier with an error message.
      2. We could also get around this by allowing the GitHub plugin to authenticate in an anonymous fashion with a public GitHub repo since this appears to only occur when you authenticate with just a username. Username is a mandatory field in the GitHub plugin. The Bitbucket cloud plugin allows you to choose public access without a username or private.

      Workaround

      1. First check to see if any credentials have been stored for the repository under Windows Control Panel > Credential Manager > Generic Credentials. Depending on previous authentication attempts, sometimes the credential manager can store just the username here and all subsequent attempts will launch the interactive git-credential-manager.exe with the GitHub login prompt UI – so it's best to clear this entry first.
      2. From command-line, run a git command to the repo. I.E: git ls-remote https://user@github.com/repository-owner/repo.git
      3. When prompted for a password, enter it. This will store your user/pass in the credential vault and it won't prompt for it again when the same command is executed from Bamboo.
      4. Alternatively, you can also add your password to the repository configuration in Bamboo to bypass the credential manager prompt.

      Another workaround: Instead of using a GitHub type repository in Bamboo to access a public repository, you can use a repository of type 'Git' and point it to the public GitHub URL. The difference being that in the GitHub repository in Bamboo, the Username is a mandatory field, so you cannot authenticate with a public repository anonymously as you can with the Git repository.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jowen@atlassian.com Jeremy Owen
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: