pushleft
Deploy your first app
Manual contents
Handbook
HandbookPushleftArchitecture
Operate
Install the control planeYour own serversFleetOperations and alertsAuthenticationAccess gateDomains and DNSUsage and budgetsScheduled jobsAbuse controlsAI provider proxyCustomer mailErrors and performanceLogs and metricsRetentionObject storageContainer registryGit server
Develop
The .pl.yaml manifestOnboard with an AI agentThe pl up demoBuild executorSource ingestionAgent gatewayManaged databasesSecurity findingsTunnels and shellsDev workspacesPrivate hostnamesMesh coordinatorsDesign baseline
Runbooks
Control-plane host failoverControl-plane PostgreSQL failoverControl-plane PostgreSQL restoreCustom domains and certificatesGateway key compromiseIngress host failureNode busyNode disk fullNode drain and replacementNode lostRegistry outageHetzner Robot hostsSecret rotationSecurity incidentStaging fleet on ProxmoxStaging build cacheStuck deploymentVault/OpenBao backup and recovery
More
CI pipelines
Manual · docs/runbooks/stuck-deployment.md

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, $D is that id.
  • Open Deployments in the Fleet app and open the deployment’s page.
  • The break-glass steps need an operator host with pushleft-controller and DATABASE_URL set to the pushleft_controller role.

Find the cause

  1. 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.

  2. 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>
  3. Check the source, the artifact, the instances, the reservations and the routes:

    • What happened: source_verified means the source arrived, build_completed means 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.
  4. Check the nodes involved. Read their STATUS, SCHED and SEEN(s) columns:

    pushleft-controller fleet list
  5. Find your result in this table and do the next step.

What you seeCauseNext step
A build stays Queued in Pipeline, no source_verified event in What happenedSource never uploaded (CLI interrupted), or source ingestion is not configuredThe user runs pl up again. Fail the stale one (below).
A build stays Queued in Pipeline, source_verified presentNo active, schedulable build node seen in the last 60 s with oci_build/isolated_build/vm_isolated_buildFix 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/retiredTargeted 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 ReservedWaiting for network admission (ready_network_attachments) or capacityCheck 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 capacityNo 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 PublishingThe node is not leasing, or an upstream instance is no longer readyIngress host failure.
PUSHLEFT_PREVIEW_BASE_DOMAIN unset on the schedulerNothing is published, so no deployment reaches liveSet 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).

  1. Decide which case applies:

    • Nothing was dispatched: Deployments shows Not placed yet, Pipeline does not show the build as Building, and Build output is empty. Do step 2.
    • Something was dispatched: anything else. Do step 3.
  2. 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, building or deploying deployment. It sets failed and appends an operator_failed event in one transaction.

  3. 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_queued or destroyed. It sets teardown_queued and appends a teardown_requested event in one transaction.

    Teardown jobs go to the active_node_id of each instance. If that node is dead, the jobs wait for it (see the table).

Check it worked

  • The deployment reaches failed, or teardown_queued and then every instance is removed.

  • deployment_stuck clears.

  • Capacity on the node drops.

    pushleft-controller fleet list

Do not

  • Do not set jobs.target_node_id, status, attempt or lease_* by hand. Targeting is the admission decision of the scheduler, and the lease token is the fence for every result.
  • Do not mark application_instances removed, or release fleet_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.
Rendered from the repository at build time. Edit docs/runbooks/stuck-deployment.md to change it.