err:unkey:application:deployment_is_productionExample
What Happened?
You calledstartDeployment or stopDeployment on a deployment in the production environment. Neither action applies to production:
- Production deployments serve live traffic and are never stopped directly; doing so would take the app offline.
- Because production is never stopped, there is no stopped state to start from.
promoteDeployment and rollbackDeployment, not start or stop.
getDeployment reports the deployment’s environmentId, and availableActions omits both start and stop for production deployments.
How To Fix
- Fetch the deployment with
getDeploymentand inspectavailableActions; neitherstartnorstopis listed for production deployments. - To change what production serves, use
promoteDeploymentorrollbackDeployment. - The
startandstopactions only apply to non-production deployments.
Common Mistakes
- Trying to take production offline: Using
stopon a production deployment instead of promoting or rolling back. - Starting production: Using
starton a production deployment instead of promoting it. - Wrong environment: Passing a production deployment id when you meant a preview one.
Related Errors
- err:unkey:application:deployment_not_running - When stopping a deployment that is not running
- err:unkey:application:deployment_not_stopped - When starting a deployment that is not stopped
- err:unkey:application:deployment_is_stopping - When a stop is already in flight