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

"Can't guess branch name for revision (...) when trying to perform push" message during a build push task where the HEAD state was not in sync with the latest commit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.2.0, 8.0.0, 7.2.1, 7.2.6, 7.2.3, 7.2.4, 7.2.5, 8.0.1, 8.0.2, 8.0.3
    • None

    Description

      Problem

      This is an intermittent issue when running a Plan. The issue consists of a repository checkout in a "detached HEAD" state which then is used by a git commit task that fails because it "Can't guess branch name for revision XXXXXXX when trying to perform push"

      Environment

      Bamboo Server

      Steps to Reproduce

      • Trigger a build. Its metadata gets created and includes the revision that should be pulled from the repository - The plan must include a "git add/commit" and a PUSH task
      • The build will be put on the queue
      • The agent(s) should be busy doing something else and will not pick up the build immediately
      • Whilst the agents are busy and the build is on the queue to be dispatched, push a change to the same branch the build was referring to, changing the HEAD/revision state
      • Once the build is picked up, the Agent pulls the (older) revision as per its metadata (Expected!)
      • The build works normally up to running the PUSH task back to the repository
      • The push task fails with "com.atlassian.bamboo.repository.RepositoryException: Can't guess branch name for revision xxxxxxxx when trying to perform push." because the revision from the metadata is not HEAD anymore

      Expected Results

      Bamboo Server should try to resolve the issue either by:

      • Providing a meaningful message explaining to the user the reason it could not push the changes back to the repository. E.g. "The git revision this Plan checkout was referred to was not in sync with the latest revision in the target repository. Were any commits pushed to the repository whilst this Plan was running?" – I bet the developers can come to a more clever message.
      • Provide an override flag (and a BIG WARNING MESSAGE) to the PUSH task so the customer can choose to force the git push if wanted.

      Actual Results

      The Run fails with the following message:

      com.atlassian.bamboo.repository.RepositoryException: Can't guess branch name for revision XXXXXXXXXXXXXXXXXXXXXX when trying to perform push. 

      Workaround

      Align with the developers to not push any changes to the referred repository whilst the build is running.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              73868399605e Eduardo Alvarenga
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: