Bitbucket cloud pipeline error: pipeline is currently deploying to the "<environment name>" environment, but there is no running pipeline
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
The pipeline error "Another pipeline is currently deploying to the <environment name>
environment" is observed while deploying to the <environment name>
environment, even though there are no other builds in progress deploying to the same environment.
Diagnosis
ℹ️ The issue occurs randomly during deployment to an environment, and there are no exact steps to reproduce the problem. However, here is an explanation of why this happens:
When a deployment step is triggered, one of the first things this process involves is acquiring an environment lock. This is used as part of the deployment concurrency feature. When a deployment step attempts to begin execution, it needs to acquire an environment lock before it can start processing. Once that deployment step is completed, it should release the environment lock to allow another deployment step to claim it.
If the environment lock enters a state where it cannot be unlocked, then no other deployments to that repository can be triggered by related repositories until the state is fixed.
Expected Results
The deployment into the <environment name>
environment should happen without any issue if there is no build running and deploying to the same environment.
Actual Results
The pipeline is giving the error "Another pipeline is currently deploying to the <environment name>
environment."
Solution
Contact support to release the lock. Otherwise, after four hours, the lock will be automatically opened via an automation job, and you will be able to deploy into the environment. Please watch the bug ticket BCLOUD-22330 to receive the latest updates regarding the bug fix.
Was this helpful?