Bitbucket Pipeline build cannot find a deployment environment
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
The user tries to run a Bitbucket Pipeline build for a specific deployment environment, and the build fails with the following error:
Configuration error
The environment '{environment-name}' in your bitbucket-pipelines.yml doesn’t match any environment defined in your settings.
Either update your yml, or your settings, to use the same name.

Cause
The most likely scenario is that:
The repository doesn't have a deployment environment with the same name referenced in the pipelines YML file.
The deployment environment has a blank space at the beginning or end of the name.
Solution
If confirmed that the repository has an environment with the expected name, please check the environment name for blank spaces. The user should be able to rerun the build once the blank spaces at the beginning or end of the name have been removed.
Was this helpful?