err:unkey:application:deployment_not_readyExample
What Happened?
You tried to promote or roll back to a deployment that cannot serve traffic. A deployment is only eligible once it has finished building and reachedready status. This error is returned in two cases:
- The deployment never reached
readystatus (it is still building, or it failed, was skipped, or was superseded). - The deployment reached
readybut is now shutting down after being demoted, so routing it live again would send traffic to a deployment that is going away.
getDeployment reports the current status, and availableActions omits promote and rollback while a deployment is in either state.
How To Fix
- Fetch the deployment with
getDeploymentand check itsstatus. - If it is still building, wait for
readyand retry. - If it
failed, inspect theerrorobject for the reason, fix the underlying issue, and create a new deployment. - If
statusisreadybutpromoteorrollbackis not listed inavailableActions, the deployment is shutting down; pick a different one.
Common Mistakes
- Promoting before the build finishes: Acting on a deployment that is still building instead of waiting for
ready. - Ignoring
availableActions: Callingpromoteorrollbackwhen the action is not listed for the current state. - Reusing a demoted deployment: Routing live traffic back onto a deployment that is already shutting down.
Related Errors
- err:unkey:application:deployment_is_current - When the target is already the current deployment
- err:unkey:application:deployment_no_current - When the app has no current deployment to act over
- err:unkey:application:deployment_not_production - When the action requires a production deployment