java.lang.RuntimeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Tested against a Bitbucket Cloud repo. Source Code Checkout task in Deployment fails with: {noformat} 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 {noformat} *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. h6. 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|https://confluence.atlassian.com/display/BAMBOO/Sharing+artifacts] 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. h6. 2. Script A different workaround would be to use a [Script|https://confluence.atlassian.com/display/BAMBOO/Script] task inside the Environment to manually clone the repository, the same way that it's done using the Terminal or Command Prompt.
    via by Rene Verschoor [Atlassian],
  • Checkout failed
    via GitHub by maverick229
    ,
  • Consider the following: * Plan with a single git Source Repository: ** _Use submodules_ check box ticked. ** _Authentication Type_ SSH private key. * BitBucket git repos representing the parent git repository and all sub-modules; each with the corresponding SSH public key for the private key used in the Plan's Source Repository. These repositories are also have _read_ privileges for any member of the group {{atlassian-staff}} in BitBucket. When the build is executed on a Build agent which doesn't have a local SSH private key, the build will fail on the first submodule update: {noformat} java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Checkout to revision ca17aab070816756a288f339fb7b14c001d3453d has failed.command /usr/bin/git submodule update --init --recursive failed with code 1. Working directory was [/opt/bamboora/bamboo-agent-home/xml-data/build-dir/PERFENGPUPPET-ROLES-JOB1]., stderr: Submodule 'modules/apparmor' (git@bitbucket.org:pdzwart_atlassian/puppet-module-apparmor.git) registered for path 'modules/apparmor' Submodule 'modules/apt' (git@bitbucket.org:pdzwart_atlassian/puppet-module-apt.git) registered for path 'modules/apt' Submodule 'modules/apt_listchanges' (git@bitbucket.org:pdzwart_atlassian/puppet-module-apt_listchanges.git) registered for path 'modules/apt_listchanges' Submodule 'modules/bamboo' (git@bitbucket.org:pdzwart_atlassian/puppet-module-bamboo.git) registered for path 'modules/bamboo' Submodule 'modules/bind' (git@bitbucket.org:pdzwart_atlassian/puppet-module-bind.git) registered for path 'modules/bind' Submodule 'modules/collectd' (git@bitbucket.org:pdzwart_atlassian/puppet-module-collectd.git) registered for path 'modules/collectd' Submodule 'modules/daemontools' (git@bitbucket.org:pdzwart_atlassian/puppet-module-daemontools.git) registered for path 'modules/daemontools' Submodule 'modules/debian_pxeboot' (git@bitbucket.org:pdzwart_atlassian/puppet-module-debian_pxeboot.git) registered for path 'modules/debian_pxeboot' Submodule 'modules/dhcp_client' (git@bitbucket.org:pdzwart_atlassian/puppet-module-dhcp_client.git) registered for path 'modules/dhcp_client' Submodule 'modules/harstorage' (git@bitbucket.org:pdzwart_atlassian/puppet-module-harstorage.git) registered for path 'modules/harstorage' Submodule 'modules/isc_dhcp' (git@bitbucket.org:pdzwart_atlassian/puppet-module-isc_dhcp.git) registered for path 'modules/isc_dhcp' Submodule 'modules/java' (git@bitbucket.org:pdzwart_atlassian/puppet-module-java.git) registered for path 'modules/java' Submodule 'modules/koto' (git@bitbucket.org:pdzwart_atlassian/puppet-module-koto.git) registered for path 'modules/koto' Submodule 'modules/ldap_client' (git@bitbucket.org:pdzwart_atlassian/puppet-module-ldap_client.git) registered for path 'modules/ldap_client' Submodule 'modules/lldpd' (git@bitbucket.org:pdzwart_atlassian/puppet-module-lldpd.git) registered for path 'modules/lldpd' Submodule 'modules/maven' (git@bitbucket.org:pdzwart_atlassian/puppet-module-maven.git) registered for path 'modules/maven' Submodule 'modules/mysql' (git@bitbucket.org:pdzwart_atlassian/puppet-module-mysql.git) registered for path 'modules/mysql' Submodule 'modules/network' (git@bitbucket.org:pdzwart_atlassian/puppet-module-network.git) registered for path 'modules/network' Submodule 'modules/nfs_kernel_server' (git@bitbucket.org:pdzwart_atlassian/puppet-module-nfs_kernel_server.git) registered for path 'modules/nfs_kernel_server' Submodule 'modules/ntp' (git@bitbucket.org:pdzwart_atlassian/puppet-module-ntp.git) registered for path 'modules/ntp' Submodule 'modules/openldap' (git@bitbucket.org:pdzwart_atlassian/puppet-module-openldap.git) registered for path 'modules/openldap' Submodule 'modules/pam_limits' (git@bitbucket.org:pdzwart_atlassian/puppet-module-pam_limits.git) registered for path 'modules/pam_limits' Submodule 'modules/perfeng' (git@bitbucket.org:pdzwart_atlassian/puppet-module-perfeng) registered for path 'modules/perfeng' Submodule 'modules/postgresql' (git@bitbucket.org:pdzwart_atlassian/puppet-module-postgresql.git) registered for path 'modules/postgresql' Submodule 'modules/puppet' (git@bitbucket.org:pdzwart_atlassian/puppet-module-puppet.git) registered for path 'modules/puppet' Submodule 'modules/r' (git@bitbucket.org:pdzwart_atlassian/puppet-module-r.git) registered for path 'modules/r' Submodule 'modules/resolv' (git@bitbucket.org:pdzwart_atlassian/puppet-module-resolv.git) registered for path 'modules/resolv' Submodule 'modules/roles' (git@bitbucket.org:pdzwart_atlassian/puppet-module-roles.git) registered for path 'modules/roles' Submodule 'modules/rsyslog' (git@bitbucket.org:pdzwart_atlassian/puppet-module-rsyslog.git) registered for path 'modules/rsyslog' Submodule 'modules/sbt' (git@bitbucket.org:pdzwart_atlassian/puppet-module-sbt.git) registered for path 'modules/sbt' Submodule 'modules/soke' (git@bitbucket.org:pdzwart_atlassian/puppet-module-soke.git) registered for path 'modules/soke' Submodule 'modules/squid' (git@bitbucket.org:pdzwart_atlassian/puppet-module-squid.git) registered for path 'modules/squid' Submodule 'modules/ssh' (git@bitbucket.org:pdzwart_atlassian/puppet-module-ssh.git) registered for path 'modules/ssh' Submodule 'modules/stdlib' (git@bitbucket.org:pdzwart_atlassian/puppet-module-stdlib.git) registered for path 'modules/stdlib' Submodule 'modules/sudo' (git@bitbucket.org:pdzwart_atlassian/puppet-module-sudo.git) registered for path 'modules/sudo' Submodule 'modules/sysctl' (git@bitbucket.org:pdzwart_atlassian/puppet-module-sysctl.git) registered for path 'modules/sysctl' Submodule 'modules/tftpd' (git@bitbucket.org:pdzwart_atlassian/puppet-module-tftpd.git) registered for path 'modules/tftpd' Submodule 'modules/vagrant' (git@bitbucket.org:pdzwart_atlassian/puppet-module-vagrant.git) registered for path 'modules/vagrant' Submodule 'modules/virtualbox' (git@bitbucket.org:pdzwart_atlassian/puppet-module-virtualbox.git) registered for path 'modules/virtualbox' Submodule 'modules/vncserver' (git@bitbucket.org:pdzwart_atlassian/puppet-module-vncserver.git) registered for path 'modules/vncserver' Cloning into 'modules/apparmor'... Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly Clone of 'git@bitbucket.org:pdzwart_atlassian/puppet-module-apparmor.git' into submodule path 'modules/apparmor' failed 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) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:176) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:109) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:187) at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:68) at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:69) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52) at java.lang.Thread.run(Thread.java:662) Caused by: com.atlassian.bamboo.repository.RepositoryException: Checkout to revision ca17aab070816756a288f339fb7b14c001d3453d has failed.command /usr/bin/git submodule update --init --recursive failed with code 1. Working directory was [/opt/bamboora/bamboo-agent-home/xml-data/build-dir/PERFENGPUPPET-ROLES-JOB1]., stderr: {noformat} When the build is run with the private key from the plan placed in the {{~/.ssh/}} of the Bamboo agent, the build succesfully checks out all git submodules. I would expect that as a user of Bamboo that I wouldn't have to distribute the SSH private key to all Bamboo remote agents; rather just have the private key kept as a part of the plan configuration. This way, the build infrastructure could scale in respect to not having to have a ssh-agent with all the SSH private keys loaded in for all git submodule based builds that are required to be built on these agents. Therefore Bamboo could leave the power of configuration up to the users of bamboo instead of the infrastructure administrators of the build agents.
    via by Pete de Zwart,
  • The branch detection service that runs every 5 minutes keeps creating same branch after each iteration if the branch name contains characters. e.g DSP-241,380,401_hibernate-loaders. In this case, the problematic character is a comma. The logs shows the following: {noformat} 2013-08-30 23:07:16,260 INFO [5-BranchDetectionBackgroundThread:pool-9-thread-1] [BranchDetectionServiceImpl] Created branch with key TESTA-GIT4 for VCS branch VCS Branch [DSP-241,380,401_hibernate-loaders] 2013-08-30 23:07:16,267 INFO [5-BranchDetectionBackgroundThread:pool-9-thread-1] [DashboardCacheListener] event: com.atlassian.bamboo.event.ChainCreatedEvent[source=com.atlassian.bamboo.build.creation.ChainBranchCreationServiceImpl@1b5756a1] plan=TESTA-GIT4 2013-08-30 23:07:16,287 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-14] [InitialBuildListener] Initial build for TESTA-GIT4 2013-08-30 23:07:16,310 INFO [5-BranchDetectionBackgroundThread:pool-9-thread-1] [DashboardCachingManagerImpl] Plan cache updated for 1 plans in 0:00:00.023 2013-08-30 23:07:16,317 INFO [5-BranchDetectionBackgroundThread:pool-9-thread-1] [BranchDetectionServiceImpl] Disabling chain branch TESTA-GIT4 because its vcsBranch is no longer detected as open. . . . . 2013-08-30 23:07:22,012 ERROR [3-DelayedChangeDetectionThread:pool-6-thread-8] [RetryingTaskExecutor] Exception being rethrown 2013-08-30 23:07:22,012 ERROR [3-DelayedChangeDetectionThread:pool-6-thread-8] [ChainExecutionManagerImpl] Errors getting changes for TESTA-GIT4-1 java.lang.RuntimeException: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'https://sultanmaiyaki@bitbucket.org/sultanmaiyaki/bamboo-auto-create-issue.git' on branch 'DSP-241\,380\,401_hibernate-loaders'. 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) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:176) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:470) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:331) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:259) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:161) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectAllChangesSinceLastBuild(DefaultChangeDetectionManager.java:127) at com.atlassian.bamboo.build.BuildDetectionActionFactoryImpl$InitialBuildDetectionAction.performDelayedChangeDetection(BuildDetectionActionFactoryImpl.java:248) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl$2.getChainState(ChainExecutionManagerImpl.java:206) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.tryStartChainState(ChainExecutionManagerImpl.java:259) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.delayedStart(ChainExecutionManagerImpl.java:195) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy97.delayedStart(Unknown Source) {noformat}
    via by Sultan Maiyaki [Atlassian],
  • Hi, I have a branch that was building fine for couple month and now I start to get below error with each build. The folder is not held by another process according to Porcess Explorer. What could cause below problem? java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'Z:\build\TRADE-MAF4-JOB1' Z:\build\TRADE-MAF4-JOB1\.git at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:144) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:203) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:188) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.preRetrieveSourceCode(VcsCheckoutTask.java:217) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:124) at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$68(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl$$Lambda$20/792998599.call(Unknown Source) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:202) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:83) at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:74) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'Z:\build\TRADE-MAF4-JOB1' Z:\build\TRADE-MAF4-JOB1\.git at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:371) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:57) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:222) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:218) at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108) ... 22 more Caused by: java.nio.file.DirectoryNotEmptyException: Z:\build\TRADE-MAF4-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:365)
    via by Steven,
  • I tried this with Bamboo 4.2.1, JIRA 5.0.7, and [Bamboo - JIRA plugin 5.1|https://marketplace.atlassian.com/plugins/com.atlassian.jira.plugin.ext.bamboo/version/460]. {code} java.lang.RuntimeException: com.atlassian.bamboo.plugins.hg.HgCommandException: command [/usr/local/bin/hg, id, -i, --debug, --rev, ${bamboo.jira.version}, --config, ui.ssh=ssh -o StrictHostKeyChecking=no -o BatchMode=yes, file:///Users/akhachatryan/dev/Repositories/MercurialClone] failed. Working directory was `/Users/akhachatryan/Atlassian/BambooHome4.2.1/xml-data/build-dir/_hg-repositories-cache/6f80156028b3e846098db18bf296ceb6d6d498c0'. stderr: hg: parse error at 0: syntax error stdout: at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:119) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:79) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:174) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:389) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuild(DefaultChangeDetectionManager.java:260) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:218) ... Caused by: com.atlassian.bamboo.plugins.hg.HgCommandException: command [/usr/local/bin/hg, id, -i, --debug, --rev, ${bamboo.jira.version}, --config, ui.ssh=ssh -o StrictHostKeyChecking=no -o BatchMode=yes, file:///Users/akhachatryan/dev/Repositories/MercurialClone] failed. Working directory was `/Users/akhachatryan/Atlassian/BambooHome4.2.1/xml-data/build-dir/_hg-repositories-cache/6f80156028b3e846098db18bf296ceb6d6d498c0'. stderr: hg: parse error at 0: syntax error stdout: at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.runCommand(HgCommandProcessor.java:460) at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.runCommand(HgCommandProcessor.java:418) at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.extractTipHash(HgCommandProcessor.java:485) at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.getRemoteTipForBranch(HgCommandProcessor.java:339) at com.atlassian.bamboo.plugins.hg.HgRepositoryAccessImpl.getLatestRemoteRevisionHash(HgRepositoryAccessImpl.java:321) at com.atlassian.bamboo.plugins.hg.HgRepositoryAccessImpl.collectChangesSinceLastBuild(HgRepositoryAccessImpl.java:94) at com.atlassian.bamboo.plugins.hg.HgRepository.collectChangesSinceLastBuild(HgRepository.java:371) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:393) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:390) at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:100) ... 38 more Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 255 at com.atlassian.utils.process.PluggableProcessHandler.complete(PluggableProcessHandler.java:83) at com.atlassian.utils.process.ExternalProcess.finish(ExternalProcess.java:376) at com.atlassian.utils.process.ExternalProcess.execute(ExternalProcess.java:419) at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.runCommand(HgCommandProcessor.java:455) ... 47 more {code} Bamboo cannot even substitute that variable in a script task: {code} /var/folders/gl/0lz__sg17fn4z5gcl_lsb66m0000gp/T/PROJ1-PLAN1-JOB1-4-ScriptBuildTask-8957754229755330542.sh: line 3: ${bamboo.jira.version}: bad substitution {code}
    via by Armen Khachatryan [Atlassian],
  • h3. Steps to reproduce # Create a new plan that has a single task to check out a Git repository. # In the Source Code Checkout task, tick "Force Clean Build". # In the Miscellaneous tab of the job, tick "Clean working directory after each build". # Start a Windows elastic Bamboo agent and run a couple of builds. h3. Expected results All the builds check out the code successfully and subsequently clean up the working directory. h3. Actual results The first build will pass, but an error will appear in the Bamboo error log: {quote} *Could not remove working directory for plan 'TEST-BUIL-JOB1': C:\build\TEST-BUIL-JOB1\.git* {code:none} java.nio.file.DirectoryNotEmptyException: C:\build\TEST-BUIL-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.cleanWorkingDirectory(ExecuteBuildTask.java:129) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:98) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) {code} {quote} Subsequent builds will all fail with the error: {code:none} Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout' Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Error occurred while running Task 'Checkout Default Repository(1)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout. java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:144) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:203) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:188) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.preRetrieveSourceCode(VcsCheckoutTask.java:217) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:124) at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$68(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl$$Lambda$20/1672639360.call(Unknown Source) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:202) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:83) at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:74) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:371) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:57) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:222) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:218) at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108) ... 22 more Caused by: java.nio.file.DirectoryNotEmptyException: C:\build-dir\TEST-BUIL-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:365) error 04-Nov-2015 13:51:01 ... 26 more {code} h3. Workaround Add a script task to move (not delete) the {{.git}} directory out of the working directory.
    via by Pavel Veller,
  • {panel} (i) *The procedure below requires direct changes into the database being used by Bamboo. Because of that, do not proceed without [exporting your Bamboo data first|https://confluence.atlassian.com/bamboo/exporting-data-for-backup-289277255.html]. Own a valid database backup before proceeding.* {panel} h3. Summary Bamboo Server fails to start up due to a corruption on the {{LIST_POSITION}} column of {{CHAIN_STAGE}} table. h3. Steps to Reproduce At this stage, the steps to reproduce this are not clear. It is known that this could be caused by editing a Build Plan (i.e. re-ordering the steps in a build plan) and restarting the instance, for example. h3. Expected Results Bamboo shouldn't get into this database corruption state. h3. Actual Results Due to the corruption, the below exceptions are thrown in the atlassian-bamboo.log file: {code} 2011-10-12 11:16:16,966 FATAL [main] [BambooContainer] Cannot start bamboo java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.set(ArrayList.java:339) at net.sf.hibernate.collection.List.readFrom(List.java:312) at net.sf.hibernate.loader.Loader.readCollectionElement(Loader.java:384) at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:240) ...... ...... at $Proxy11.getAllPlans(Unknown Source) at com.atlassian.bamboo.container.BambooContainer.initialisePlans(BambooContainer.java:332) at com.atlassian.bamboo.container.BambooContainer.start(BambooContainer.java:243) {code} Or: {code} 2014-09-15 19:30:09,928 DEBUG [ActiveMQ Journal Checkpoint Worker] [MessageDatabase] Checkpoint started. 2014-09-15 19:30:09,934 DEBUG [ActiveMQ Journal Checkpoint Worker] [MessageDatabase] Checkpoint done. 2014-09-15 19:30:11,310 INFO [localhost-startStop-1] [RetryingTaskExecutor] Task 'Retrieving TESTONE-SAMPLEONE' threw java.lang.NullPointerException, aborting. 2014-09-15 19:30:11,312 FATAL [localhost-startStop-1] [BambooContainer] Cannot start bamboo java.lang.RuntimeException: java.lang.NullPointerException at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:120) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:191) at com.atlassian.bamboo.plan.cache.ImmutablePlanManagerImpl.getPlanByKey(ImmutablePlanManagerImpl.java:129) at sun.reflect.GeneratedMethodAccessor215.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) .... at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.NullPointerException at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187) at com.atlassian.bamboo.deletion.NotDeletedPredicate.apply(NotDeletedPredicate.java:28) .... {code} h3.Workaround *Identifying the problem:* You should run the following query in order to find out the duplicates: {noformat} select stage.* from chain_stage as stage join build as chain ON stage.build_id = chain.build_id where chain.full_key = 'PLAN-KEY-0' order by stage.list_position {noformat} As an example, let's look at a _bad_ result for the query above: ||STAGE_ID||NAME||BUILD_ID||LIST_POSITION|| |8389098|Stage 2|4063315| 1| |8389099|Stage 2|4063368| 1| |8389100|Stage 2|8422478| 1| |8389101|Stage 3|4063315| 1| |8389102|Stage 3|4063368| 1| |8389103|Stage 3|8422478| 1| From this result, you can see that the 3 {{BUILD_ID}}: {{4063315}}, {{4063368}} and {{8422478}} are duplicated as they appear _twice_ on the table above. That means that each one of those {{BUILD_ID}} need to be fixed on the {{CHAIN_STAGE}} table. If this query had returned zero results, the corruption we are trying to fix wouldn't exist. *How to fix the problem:* If you run the following query specifying one of the duplicate {{BUILD_ID}}'s reported above: {noformat} SELECT * FROM CHAIN_STAGE WHERE BUILD_ID=8422478 ORDER BY BUILD_ID, LIST_POSITION; {noformat} You will get the following result which evidences the corruption on the {{CHAIN_STAGE}} table: ||STAGE_ID||CREATED_DATE||UPDATED_DATE||NAME||DESCRIPTION||OPTIONAL_STAGE||MARKED_FOR_DELETION||BUILD_ID||LIST_POSITION|| |8389103 |(null)| (null) |Stage 3 | |false |false |8422478| 1| |8389100 |2015-10-24 13:00:38 |2015-10-24 13:00:38| Stage 2| | false |true |8422478|1| |8389106 |(null) |(null) |Stage 4| |false |false |8422478 |2| Therefore, in order to identify what needs to be fixed, 3 separate queries would have to be run against the db so you can see the corruption for each {{BUILD_ID}}. In this specific example, they are: {noformat} SELECT * FROM CHAIN_STAGE WHERE BUILD_ID=4063315 ORDER BY BUILD_ID, LIST_POSITION; SELECT * FROM CHAIN_STAGE WHERE BUILD_ID=4063368 ORDER BY BUILD_ID, LIST_POSITION; SELECT * FROM CHAIN_STAGE WHERE BUILD_ID=8422478 ORDER BY BUILD_ID, LIST_POSITION; {noformat} *But wait... Where is the corruption on the table above?* Notice from the result above that for each row of {{CHAIN_STAGE}} the {{LIST_POSITION}} for the {{BUILD_ID=8422478}} holds the values {{1}}, {{1}} and {{2}} when it should be holding the values {{0}}, {{1}} and {{2}}. The values should _always_ start off from {{0}}, otherwise Bamboo won't start. That's what the corruption is about. *How to fix it?* In order to fix this, you will need to analyse the corruption for each one of the queries above and manually fix the problematic rows. - *If you're running Bamboo with an external db ...* Then just update the rows manually. As mentioned before, the result should have been {{0}}, {{1}} and {{2}} and *not* {{1}}, {{1}} and {{2}}. So, in order to fix the problem in this specific corrupt output, you would need to update the first row _only_ by running the following query: {noformat} UPDATE CHAIN_STAGE SET LIST_POSITION = 0 WHERE STAGE_ID = '8389103' {noformat} In our example, after analysing the output of the {{SELECT * FROM CHAIN_STAGE WHERE BUILD_ID=... ORDER BY BUILD_ID, LIST_POSITION;}}, the final set of queries to fix this is: {noformat} UPDATE CHAIN_STAGE SET LIST_POSITION = 0 WHERE STAGE_ID = '8389103' UPDATE CHAIN_STAGE SET LIST_POSITION = 0 WHERE STAGE_ID = '8389101' UPDATE CHAIN_STAGE SET LIST_POSITION = 0 WHERE STAGE_ID = '8389102' {noformat} - *If you're running Bamboo with an HSQLDB ...* HSQLDB is the in-memory database _for evaluation purposes only_. If you're using this in production, well, you should really have [migrated to an external database by now|https://confluence.atlassian.com/bamboo/connecting-bamboo-to-an-external-database-289276815.html] because we don't recommend production environments to be using HSQLDB. -- *How to detect issue and fix it:* If you're in this scenario, though, here is how you can fix it: --- Stop your Bamboo instance process. --- In order to run the queries to identify the corruption, you will need to [Connect to your HSQLDB using DBVisualizer|https://confluence.atlassian.com/conf51/connecting-to-hsqldb-using-dbvisualizer-336169749.html] and run the {{SELECT}} queries as described under the *Identifying the problem* section. ---- If your database is big (consider big ~200MB), you might consider [increasing the memory allocated for your DBVisualizer to 2048m|http://confluence.dbvis.com/pages/viewpage.action?pageId=3146118] --- Make sure Bamboo is not running. This is very important, otherwise the values we update on the next step will be overwritten and void the fix. --- Edit the {{<BAMBOO_HOME>/database/defaultdb.script}}. In there, you will find queries that populate the HSQLDB when Bamboo is started up. For the example we fixed here, you would have found: {noformat} INSERT INTO CHAIN_STAGE VALUES(8389101,NULL,NULL,'Stage 3','',FALSE,FALSE,4063315,1) INSERT INTO CHAIN_STAGE VALUES(8389102,NULL,NULL,'Stage 3','',FALSE,FALSE,4063368,1) INSERT INTO CHAIN_STAGE VALUES(8389103,NULL,NULL,'Stage 3','',FALSE,FALSE,8422478,1) {noformat} --- You'd have to change that the {{INSERT}} queries above into the ones below so that they can start off at {{0}}: {noformat} INSERT INTO CHAIN_STAGE VALUES(8389101,NULL,NULL,'Stage 3','',FALSE,FALSE,4063315,0) INSERT INTO CHAIN_STAGE VALUES(8389102,NULL,NULL,'Stage 3','',FALSE,FALSE,4063368,0) INSERT INTO CHAIN_STAGE VALUES(8389103,NULL,NULL,'Stage 3','',FALSE,FALSE,8422478,0) {noformat}
    via by Turner Benard [Atlassian],
    • java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Runtime exception. at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:144) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:203) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:188) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:144) at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$272(TaskExecutorImpl.java:317)
    No Bugmate found.