# Try a fix on an environment

> Lock an environment such as Beta, deploy a fix there while its pipeline waits, then release it and put back what ran.

Checkout answers 502s, and a fix on the branch `fix-502` needs trying on `MyService/Beta` before it goes to main. Beta is where the pipeline deploys each candidate, so it would replace the fix within minutes. A lock keeps Beta yours until it's released. See [Environments, Locking it](../concepts/environments.md#locks) for what a lock holds.

## 1. Release the fix where you can deploy it {#fix}

A deployment puts a release of a version group's main package on an environment. Release the fix into a group of its own, made from `main` as [Try a change in a group of its own](group-of-your-own.md) shows, such as `myservice-fix502`.

## 2. Lock Beta {#lock}

Open `MyService/Beta` in the Environments app and press **Lock…**. Say why, in one line: everyone sees it, on Beta's page, in the environments list and in the pipeline that waits. The dialog lists what waits until it's released: the pipelines that deploy there, and hosts joining its targets.

What is queued or running goes on, and your deployments come after it.

## 3. Deploy the fix {#deploy}

**Deploy a revision…**, choose `myservice-fix502` and its revision, and **Deploy**. Beta's deployments mark it *under the lock*. Deploy again as often as you need; **Restart** and **Roll back to this** are yours too.

Meanwhile the pipeline's Beta stage says *waiting*, with your reason, and a newer candidate takes the place of the one waiting.

## 4. Release it {#release}

When you're done, press **Release…** on the band. Anyone can, so a lock forgotten over a weekend doesn't hold Beta for good. Choose what Beta runs afterwards:

- **Leave … running**: a candidate waiting in the pipeline deploys over it within seconds; when none waits, the fix stays until the next one.
- **Put #… back first**: what ran before the lock was taken is deployed again, ahead of anything else.

Hosts that joined Beta's targets meanwhile get the current release within a minute.

## When someone else holds it {#someone-else}

Beta's page says who, since when and why, and offers **Deploy** to them alone. Ask them, or press **Release…** yourself.

- [Environments](../concepts/environments.md#locks): what a lock holds
- [Pipelines](../concepts/pipelines.md): stages wait for a lock
- [Try a change in a group of its own](group-of-your-own.md): where the fix is released
