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 ispl-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 exacttask. - 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_stuckoringress_route_failed.node_heartbeat_stalefor the application node.- External probes of
https://<app>.<base>fail while/readyzis 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 thepl-cpjump host or the server’s Terminal in the Fleet app (operator access). - Get an operator host with
pushleft-controllerand access to the Cloudflare zone for<base>.
Diagnosis
-
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.
-
Check that the node itself is alive. Read its
STATUS,SCHEDandSEEN(s)columns:pushleft-controller fleet list -
On the host, list the routes Caddy holds. Compare them with the
Activeentries under Routes.curl -s http://127.0.0.1:2019/id/pushleft-ingress-router | jq '.handle[0].routes[]."@id"' -
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).
-
Restart Caddy with its last autosaved config. Caddy autosaves admin-API changes to
/var/lib/caddy/caddy/autosave.json, and the unit runscaddy run --resume, so this restores the routes it had.systemctl restart pushleft-ingress-caddy -
Check that the router bucket and the terminal 404 route exist.
-
Check that the route IDs match the
Activeentries under Routes on the deployment pages. -
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):
-
Drain the node, so nothing new is placed there:
pushleft-controller fleet drain <node> -
Provision and admit a replacement application node (
fleet provision --pool application ...on Hetzner Cloud, orfleet enroll-host --pool application ...for a Robot host, thenfleet admit). -
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.jsonand run it withdeploy/systemd/pushleft-ingress-caddy.service. -
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. -
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.
-
Ask them to run
pl upagain. 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. -
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 upagain 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
Activefor the new node.
Do not
- Do not edit
ingress_analytics_routes.statusornode_id. A trigger refuses identity rewrites and backward moves. - Do not insert into
ingress_hostnamesto free or move a hostname. - Do not enable on-demand TLS, or point the wildcard at a host without the terminal 404 route.