# deployment_is_current

> The target deployment is already the current deployment, so promoting or rolling back to it would be a no-op.

<Danger>`err:unkey:application:deployment_is_current`</Danger>

```json Example
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "The deployment is already the current deployment.",
    "status": 412,
    "title": "Precondition Failed",
    "type": "https://unkey.com/docs/errors/unkey/application/deployment_is_current"
  }
}
```

## What Happened?

You called `promoteDeployment` or `rollbackDeployment` targeting the deployment that is already serving production traffic. In the normal case this would not change anything, so it is rejected to surface a likely mistake in the request rather than silently doing nothing.

The one exception is on `promoteDeployment`: if the app is currently in a rolled-back state, promoting the current deployment is allowed, because it confirms moving forward off the rollback instead of being a no-op. `rollbackDeployment` always rejects the current deployment, whether or not the app is rolled back.

`getDeployment` reports `isCurrent: true` for the current deployment.

## How To Fix

1. Fetch the target with `getDeployment` and check `isCurrent`.
2. If you intended to change which deployment is current, target a different deployment.
3. If the deployment is already current and that is what you want, no action is needed.

```bash
# Check whether the deployment is already the current one
curl -X POST https://api.unkey.com/v2/deployments.getDeployment \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{ "deploymentId": "d_1234abcd" }'
```

## Common Mistakes

- **Re-promoting the current deployment**: Promoting the deployment that is already current.
- **Stale deployment id**: Acting on an id that has since become the current deployment.

## Related Errors

- [err:unkey:application:deployment_no_current](./deployment_no_current) - When the app has no current deployment to act over
- [err:unkey:application:deployment_not_ready](./deployment_not_ready) - When the target deployment cannot serve traffic
- [err:unkey:application:deployment_not_production](./deployment_not_production) - When the action requires a production deployment
