Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-16118

Build fails to run because Bamboo attempts to connect to 'default' branch (non-existent) instead of 'master'

    XMLWordPrintable

    Details

      Description

      In some cases, some Bamboo builds have been failing because Bamboo is attempting to connected to the 'master' branch in some repository, but instead it looks for 'default'.

      When this branch doesn't exist, the build fails to run.

      The logs show the following errors:

      com.atlassian.bamboo.repository.RepositoryException: java.lang.RuntimeException: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'https://bitbucket.org/witech2/wipod' on branch 'default'. Branch has probably been removed.
      	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:444)
      	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:301)
      	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:186)
      	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildIfTriggered(DefaultChangeDetectionManager.java:124)
      	at com.atlassian.bamboo.v2.trigger.ChangeDetectionListenerAction.testIfBuildShouldStart(ChangeDetectionListenerAction.java:112)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$4.call(PlanExecutionManagerImpl.java:526)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$4.call(PlanExecutionManagerImpl.java:510)
      	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312)
      	at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:85)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:800)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startConditionalBuild(PlanExecutionManagerImpl.java:509)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:582)
      ...
      Caused by: java.lang.RuntimeException: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'https://bitbucket.org/witech2/wipod' on branch 'default'. Branch has probably been removed.
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:132)
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88)
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:191)
      ...
      Caused by: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'https://bitbucket.org/witech2/wipod' on branch 'default'. Branch has probably been removed.
      	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.obtainLatestRevision(NativeGitOperationHelper.java:550)
      	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper$2.call(NativeGitOperationHelper.java:561)
      	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper$2.call(NativeGitOperationHelper.java:557)
      

      Another behavior we could see in a case, when selecting the repository in the Linked Repositories page in Bamboo, right when it's select the 'Branch' is 'default' and it's immediately changed to 'master'.

      Workaround

      1. Delete the repository and add it back

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mgardias Marcin Gardias
              Reporter:
              jsilveira Jaime S
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: