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/ingress-host-failure.md

Ingress host failure

Use this when public hostnames stop answering while /readyz is green, or when ingress_publication_stuck or ingress_route_failed fires.

Ingress design

  • Public traffic enters through the host Caddy on the application node that runs a deployment’s web instances.
  • The agent writes each route into the operator bucket pushleft-ingress-router. The route ID is pl-ingress-<hostname>-g<generation>-o<org>. The organization binding refuses a hostname routed for another organization.
  • The durable record is ingress_analytics_routes: one row per hostname, node and generation, with the exact task.
  • Tenant routes keep open WebSockets for up to 1 h after a Caddy config change (stream_close_delay). A removed route can still serve an open connection for that long.
  • The wildcard *.<base> DNS record points at the ingress host’s public address. The operator manages that record (ingress publication).

Symptoms

  • ingress_publication_stuck or ingress_route_failed.
  • node_heartbeat_stale for the application node.
  • External probes of https://<app>.<base> fail while /readyz is green.
  • Caddy is down on a live node: TLS or connection errors on 443 for every hostname on that node.

Before you start

  • Get a shell on the ingress host (Caddy admin on 127.0.0.1:2019). Use the pl-cp jump host or the server’s Terminal in the Fleet app (operator access).
  • Get an operator host with pushleft-controller and access to the Cloudflare zone for <base>.

Diagnosis

  1. Open the suspect node’s page in the Fleet app. Open each entry under Deployments. Routes on that page shows each hostname, its node and its status.

  2. Check that the node itself is alive. Read its STATUS, SCHED and SEEN(s) columns:

    pushleft-controller fleet list
  3. On the host, list the routes Caddy holds. Compare them with the Active entries under Routes.

    curl -s http://127.0.0.1:2019/id/pushleft-ingress-router | jq '.handle[0].routes[]."@id"'
  4. If the node is healthy, go to case A. If the node is lost, go to case B.

Case A: Caddy lost its config

Routes are pushed once per publication. There is no periodic route reconciliation (gap). A Caddy that restarts with an empty config serves 404 for every Pushleft hostname, while the database says active (ingress returns 404 after a restart).

  1. Restart Caddy with its last autosaved config. Caddy autosaves admin-API changes to /var/lib/caddy/caddy/autosave.json, and the unit runs caddy run --resume, so this restores the routes it had.

    systemctl restart pushleft-ingress-caddy
  2. Check that the router bucket and the terminal 404 route exist.

  3. Check that the route IDs match the Active entries under Routes on the deployment pages.

  4. If the autosave is gone, ask each affected user to redeploy (pl up). This publishes a new generation. There is no supported republish command (gap).

Do not hand-write routes from ingress_analytics_routes.task into Caddy. The agent’s ETag compare-and-swap, the label checks and the readback are the only checks that the upstream is the right container.

Case B: the application node is lost

Since migration 0037, recovery is automatic (node lost). After PUSHLEFT_NODE_LOST_AFTER_SECONDS the scheduler replaces the web instances on another node and publishes a relocation route there. The old route drains only when the new one is active. You still repoint the wildcard DNS record (step 3).

Use all the steps below as the fallback when the deployment is degraded (no eligible node, or the relocation failed):

  1. Drain the node, so nothing new is placed there:

    pushleft-controller fleet drain <node>
  2. Provision and admit a replacement application node (fleet provision --pool application ... on Hetzner Cloud, or fleet enroll-host --pool application ... for a Robot host, then fleet admit).

  3. Give it a host Caddy configured as in architecture.md: router bucket, terminal 404, wildcard certificate, admin on loopback. Write the base config with pushleft-agent ingress-caddy-config > /etc/pushleft/ingress/caddy.json and run it with deploy/systemd/pushleft-ingress-caddy.service.

  4. Without platform DNS (one application node), point the wildcard *.<base> A/AAAA record at the replacement’s public address in Cloudflare. With it (PUSHLEFT_PLATFORM_DNS_ZONE_ID), the controller repoints each hostname’s own record to the node holding its route.

  5. List the affected users. Open Deployments in the Fleet app and find each deployment whose Routes names the node. The page header names the organization.

  6. Ask them to run pl up again. The new deployment reserves capacity on a healthy node, publishes the next route generation for the same hostname, and supersedes the old deployment. Hostname ownership is per environment, so the same hostname is accepted.

  7. Leave the old routes and instances on the dead node. They do not block the new deployment.

The old routes and instances stay active/draining. Their remove_ingress/stop_application jobs stay targeted at that node, and only that node can lease them. fleet decommission refuses while the node’s allocations stay active. The dead node stays draining until a fenced teardown releases those allocations (gap for an unrecoverable host).

Status update for users

The server hosting your application’s public route failed. Run pl up again from the same commit to move it to a healthy server; the URL stays the same. Data in managed databases is not on this server.

Check it worked

  • curl -sI https://<app>.<base> returns the application’s response from the new node.
  • Routes on the deployment’s page in the Fleet app shows Active for the new node.

Do not

  • Do not edit ingress_analytics_routes.status or node_id. A trigger refuses identity rewrites and backward moves.
  • Do not insert into ingress_hostnames to free or move a hostname.
  • Do not enable on-demand TLS, or point the wildcard at a host without the terminal 404 route.
Rendered from the repository at build time. Edit docs/runbooks/ingress-host-failure.md to change it.