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

Bad credentials on cloned plan when using a non-linked Github repository

    XMLWordPrintable

Details

    Description

      Summary

      When using a non-linked Github repository and cloning the plan, the resulting plan loses the correct credentials and builds will fail.

      Steps to Reproduce

      The GitHub repository will need to be private for the build to fail, but GitHub API calls will still fail so you can reproduce it with a public repository on the Repository UI

      1. Create a Bamboo plan with a non-linked Github repository using password authentication
      2. Clone the plan
      3. Visit Cloned plan configuration > Repositories > Github repository
      4. Hit Load Repositories -> Bad credentials error
      5. Attempt to build the plan (if the repository is private, it'll fail to checkout)

      Expected Results

      Correct credentials are copied to the cloned plan.

      Actual Results

      • Repositories UI reports the error: Failed to load data from GitHub.com.atlassian.bamboo.plugins.git.GitHubAccessor$GitHubException: Bad credentials
      • Building the plan results in error:
        com.atlassian.bamboo.repository.RepositoryException: : Cannot fetch branch 'refs/heads/master' from 'https://github.com/jezowen/test.git' to source directory '/var/bamboo-home-new/xml-data/build-dir/_git-repositories-cache/9517ee02b81385e7f7f2039f2f07f276195c460d'. command /usr/bin/git fetch https://jowen:********@github.com/jowen/test.git +refs/heads/master:refs/heads/master --update-head-ok failed with code 128. Working directory was [/var/bamboo-5132-home-new/xml-data/build-dir/_git-repositories-cache/9517ee02b81385e7f7f2039f2f07f276195c460d]., stderr:
        remote: Invalid username or password.
        fatal: Authentication failed for 'https://jowen:********@github.com/jowen/test.git/'
        	at com.atlassian.bamboo.plugins.git.GitRepository.fetch(GitRepository.java:336)
        	at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:277)
        	at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:233)
        

      Workaround

      1. Re-enter your credentials at: Plan Configuration > Repositories > GitHub repository > Change password
      2. Save the repository
      3. To prevent it from re-occuring next time the plan is cloned, you can convert it to a Linked Repository: Plan Configuration > Repositories > GitHub repository > Convert to Linked Repository

      Attachments

        Activity

          People

            mgardias Marcin Gardias
            jowen@atlassian.com Jeremy Owen
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: