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

"Source Code Checkout" task fails in Deployment

XMLWordPrintable

      Tested against a Bitbucket Cloud repo.

      Source Code Checkout task in Deployment fails with:

      simple	24-May-2016 17:39:12	Finished task 'Download release contents' with result: Success
      simple	24-May-2016 17:39:12	Starting task 'get Code' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
      simple	24-May-2016 17:39:15	Updating source code to revision: 42b96809f4600841e8b369fe281eb2e12d9e5668
      simple	24-May-2016 17:39:16	Updating source code to revision: 42b96809f4600841e8b369fe281eb2e12d9e5668
      simple	24-May-2016 17:39:17	Updating source code to revision: 42b96809f4600841e8b369fe281eb2e12d9e5668
      error	24-May-2016 17:39:17	Error occurred while running Task 'get Code(3)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.
      error	24-May-2016 17:39:17	java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Runtime exception.
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:144)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:203)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:188)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:144)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$272(TaskExecutorImpl.java:317)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.task.TaskExecutorImpl$$Lambda$276/850358159.call(Unknown Source)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:246)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:317)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:74)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      error	24-May-2016 17:39:17		at java.lang.Thread.run(Thread.java:745)
      error	24-May-2016 17:39:17	Caused by: com.atlassian.bamboo.repository.RepositoryException: Runtime exception.
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:534)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:427)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:419)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.bitbucket.BitbucketRepository.retrieveSourceCode(BitbucketRepository.java:324)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.fillWorkingDirFromVcs(VcsCheckoutTask.java:295)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$000(VcsCheckoutTask.java:56)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$1.call(VcsCheckoutTask.java:149)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$1.call(VcsCheckoutTask.java:145)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108)
      error	24-May-2016 17:39:17		... 21 more
      error	24-May-2016 17:39:17	Caused by: io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLoggerImpl.streamEntry(BuildLoggerImpl.java:73)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLoggerImpl.onAddLogEntry(BuildLoggerImpl.java:61)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.AbstractBuildLogger.addLogEntry(AbstractBuildLogger.java:153)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.AbstractBuildLogger.addBuildLogEntry(AbstractBuildLogger.java:105)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.AbstractBuildLogger.addBuildLogEntry(AbstractBuildLogger.java:163)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.rethrowOrRemoveDirectory(GitRepository.java:1179)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.access$000(GitRepository.java:109)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository$2.call(GitRepository.java:479)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository$2.call(GitRepository.java:464)
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:293)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:463)
      error	24-May-2016 17:39:17		... 29 more
      error	24-May-2016 17:39:17	Caused by: java.lang.NullPointerException
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.storage.location.StorageLocationServiceImpl.getStorageLabel(StorageLocationServiceImpl.java:124)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.storage.location.StorageLocationServiceImpl.getBuildDataDirectory(StorageLocationServiceImpl.java:62)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.storage.location.StorageLocationServiceImpl.getBuildDownloadDataDirectory(StorageLocationServiceImpl.java:74)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.storage.location.StorageLocationServiceImpl.getBuildLogsDirectory(StorageLocationServiceImpl.java:80)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.LoggerIds$PersistentLogger.getLogFileDirectory(LoggerIds.java:40)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLogFileWriter.<init>(BuildLogFileWriter.java:62)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLoggerImpl$1.create(BuildLoggerImpl.java:24)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLoggerImpl$1.create(BuildLoggerImpl.java:20)
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:332)
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:150)
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLoggerImpl.streamEntry(BuildLoggerImpl.java:73)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.BuildLoggerImpl.onAddLogEntry(BuildLoggerImpl.java:61)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.AbstractBuildLogger.addLogEntry(AbstractBuildLogger.java:153)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.AbstractBuildLogger.addBuildLogEntry(AbstractBuildLogger.java:105)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.build.logger.AbstractBuildLogger.addBuildLogEntry(AbstractBuildLogger.java:163)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.fetch(NativeGitOperationHelper.java:425)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository$2.call(GitRepository.java:470)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository$2.call(GitRepository.java:464)
      error	24-May-2016 17:39:17		at io.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:293)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:463)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:427)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:419)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.bitbucket.BitbucketRepository.retrieveSourceCode(BitbucketRepository.java:324)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.fillWorkingDirFromVcs(VcsCheckoutTask.java:295)
      error	24-May-2016 17:39:17		at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:136)
      error	24-May-2016 17:39:17		... 17 more
      
      

      Workarounds

      There are two possible workarounds here, but first we need to remove the Source Code Checkout task from the Environment task configuration to prevent the deployment from failing.

      1. Artifact

      A workaround would be to download the code, from the target repository, using the Source Code Checkout in the source build plan. It is possible to create a shared artifact to wrap up all the downloaded code and then use the Artifact download task in the Environment to download the artifact containing the source code downloaded from the source build plan.

      2. Script

      A different workaround would be to use a Script task inside the Environment to manually clone the repository, the same way that it's done using the Terminal or Command Prompt.

              mgardias Marcin Gardias
              rverschoor Rene Verschoor (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: