Stuck deployment
Use this runbook when a deployment stays queued, building or deploying and its event trail stops. The alert deployment_stuck fires after 30 minutes.
Most stuck deployments fail by themselves. Look for a deployment_reaped event in the trail first: it names the reason.
When the reaper fails a deployment, and which alerts send you here
The scheduler’s reaper fails a deployment with no progress for 60 min in queued, 45 min in building or 60 min in deploying (PUSHLEFT_REAP_{QUEUED,BUILDING,DEPLOYING}_AFTER). It also fails a release whose role is still unplaced 10 min after its first waiting_for_capacity event (PUSHLEFT_REAP_PLACEMENT_AFTER). It never touches a deployment with a live lease.
Alerts that link here: deployment_stuck (ticket), job_lease_orphaned (page, an expired lease nobody reclaims), scan_lease_orphaned (ticket, the same for a daily scan after 60 min: an agent restart stops a running scan, and the restarted agent normally reclaims it within minutes), deployment_success_rate_low and up_to_live_slow.
Before you start
- Get the deployment id. Below,
$Dis that id. - Open Deployments in the Fleet app and open the deployment’s page.
- The break-glass steps need an operator host with
pushleft-controllerandDATABASE_URLset to thepushleft_controllerrole.
Find the cause
-
Read the state and the event trail on the deployment’s page: the status badge and What happened. The last event tells you what happened last.
-
Read the jobs. Pipeline shows each build with its attempt and retry time. Recent jobs on a node’s page shows its last 25 jobs with their status. For one job’s lease owner, lease times, attempt and last error:
pushleft-controller fleet job <job> -
Check the source, the artifact, the instances, the reservations and the routes:
- What happened:
source_verifiedmeans the source arrived,build_completedmeans the artifact exists. - Services: each role’s instances, their node, generation and status.
- Routes: each hostname, its node and its status.
- Placements on the node’s page: the reservations on that node.
- What happened:
-
Check the nodes involved. Read their
STATUS,SCHEDandSEEN(s)columns:pushleft-controller fleet list -
Find your result in this table and do the next step.
| What you see | Cause | Next step |
|---|---|---|
A build stays Queued in Pipeline, no source_verified event in What happened | Source never uploaded (CLI interrupted), or source ingestion is not configured | The user runs pl up again. Fail the stale one (below). |
A build stays Queued in Pipeline, source_verified present | No active, schedulable build node seen in the last 60 s with oci_build/isolated_build/vm_isolated_build | Fix or admit a build node. A build node without Kata (pushleft-agent doctor) does not advertise vm_isolated_build (build hosts). |
job_lease_orphaned fired, or Recent jobs shows Leased on a node with a high SEEN(s) | The node died mid-job. Only the next lease of that node reclaims the job (job_lease_orphaned). If the deployment has finished, or the job’s application instance is removed, the reaper fails the job 5 min after expiry (last_error = lease expired after the deployment finished). | Recover the node, or replace it (node drain, node lost). |
Recent jobs shows Queued on a node that is unhealthy/draining/retired | Targeted work never moves to another node (gap) | Same as above. Draining nodes cannot lease, not even teardown work. |
Recent jobs shows Ensure application Queued, and Services shows the instance Reserved | Waiting for network admission (ready_network_attachments) or capacity | Check the mesh worker and the attachment evidence for that host and environment. |
Services shows the instance Pending placement, and Pipeline lists it under Waiting for capacity | No application node has capacity: 500m/512 MiB per replica by default, plus 1000m/256 MiB per new environment gateway. After 10 min the reaper fails the deployment (a role waited … s for placement). | node_capacity_high (a ticket). Add capacity (capacity). The user then runs pl up again. |
Recent jobs shows Publish ingress stuck, and Routes shows Publishing | The node is not leasing, or an upstream instance is no longer ready | Ingress host failure. |
PUSHLEFT_PREVIEW_BASE_DOMAIN unset on the scheduler | Nothing is published, so no deployment reaches live | Set it and restart the scheduler. |
Fail a deployment safely
The user path is pl down <id> (POST /v1/deployments/{id}/teardown). It removes traffic first. Then it queues fenced teardown jobs to the nodes that hold the instances.
An operator without the credentials of the tenant uses the break-glass steps below. Write the reason in the ticket, and give it as --reason. Each command writes an audit row (operator_cli_action).
-
Decide which case applies:
- Nothing was dispatched: Deployments shows
Not placed yet, Pipeline does not show the build asBuilding, and Build output is empty. Do step 2. - Something was dispatched: anything else. Do step 3.
- Nothing was dispatched: Deployments shows
-
Changes state: mark the deployment failed. The scheduler stops placing it, and the gateway refuses its leases. The reaper releases reservations that were never dispatched, if the segment has no network attachment yet (
reap_unstarted_application).pushleft-controller fleet fail-deployment $D --reason "<ticket and reason>"The command accepts only a
queued,buildingordeployingdeployment. It setsfailedand appends anoperator_failedevent in one transaction. -
Destroys the deployment: request teardown. The API makes the same state change, and the scheduler then runs the fenced teardown.
pushleft-controller fleet fail-deployment $D --teardown --reason "<ticket and reason>"The command refuses a deployment that is already
teardown_queuedordestroyed. It setsteardown_queuedand appends ateardown_requestedevent in one transaction.Teardown jobs go to the
active_node_idof each instance. If that node is dead, the jobs wait for it (see the table).
Check it worked
-
The deployment reaches
failed, orteardown_queuedand then every instance isremoved. -
deployment_stuckclears. -
Capacity on the node drops.
pushleft-controller fleet list
Do not
- Do not set
jobs.target_node_id,status,attemptorlease_*by hand. Targeting is the admission decision of the scheduler, and the lease token is the fence for every result. - Do not mark
application_instancesremoved, or releasefleet_allocations, by hand. Only an accepted teardown result may do that, because a container may still run. - Do not delete events, jobs or results. They are the audit trail, and their triggers refuse it.