Repository navigation
Description
On the local cluster (ax local start, Kind), new workspaces stay in Preparing forever after Substrate's atenet-router container restarts once. Its Envoy sidecar is left in the DRAINING state, so the pod never becomes ready again and the atenet-router Service has no endpoints until someone restarts the pod. It has happened several times; this report is from one occurrence, and it is likely a Substrate bug that ax local hits often.
Symptoms
ax get workspacesshows new workspaces stuck inPreparing, andax describe workspaceshows no conditions. Tasks that need a fresh setup hang the same way.- ax-server keeps retrying setup with a new actor, and every push times out:
workspace setup attempt failed, retrying with a fresh setup actor ... error: running workspace setup: pushing /runner/v1alpha1/setup to actor default/ax-ws-setup-...: context deadline exceeded (last error: Post "https://atenet-router.ate-system.svc.cluster.local:443/runner/v1alpha1/setup": context deadline exceeded (Client.Timeout exceeded while awaiting headers)) kubectl -n ate-system get podsshowsatenet-routerat1/2with 1 restart;envoyis the container that is not ready, and it has 0 restarts.kubectl -n ate-system get endpoints atenet-routeris empty.- The
envoyreadiness probe (GET :9901/ready) returns 503 with bodyDRAINING./server_inforeportsstate: DRAININGand/statshasserver.state: 1. The newatenet-routercontainer logsRouter dataplane health check failed ... unexpected status code 503every second, indefinitely. - Connections opened before the restart (e.g. a long-lived
ax sshstream) keep working, which hides the problem until something opens a new connection.
What happened (timeline, UTC)
- 09:16–09:20: the whole node stalled. The router's health checks against the ATE API, the Kubernetes API (
https://10.96.0.1:443/version) and Envoy (localhost:9901/ready) all time out. Around the same time,postgres-0(09:16:57) andate-idp-server(09:20:39) inate-systemalso exit and restart, and Postgres logsterminating connection due to administrator command (SQLSTATE 57P01). - 09:20:36: the
atenet-routercontainer gets SIGTERM (Shutdown signal received; draining), most likely from kubelet after the/healthzliveness probe (timeout 1s, period 10s, 3 failures) failed during the stall. - 09:20:49: during graceful shutdown it drains the dataplane (
Draining dataplane window=15s→Dataplane drained→Drain-complete marker written path=/var/run/atenet/drain-complete→Shutdown complete, exit 0). - kubelet restarts only the
atenet-routercontainer.envoyhas no liveness probe, so it is never restarted and staysDRAINING(uptime 139093s,hot_restart_generation: 1). The new router container does not take Envoy out of drain, and nothing else recovers it.
So the trigger is a temporary stall (likely the host VM being starved or paused, e.g. the laptop sleeping), but the bug is that it never recovers: draining is meant for pod shutdown, yet it runs on every router container restart, and the restarted router never undoes it.
How to reproduce (hints, not yet verified)
- Restart only the router container while Envoy keeps running, e.g. from the Kind node:
docker exec ax-local-control-plane crictl ps --name atenet-router -q | xargs docker exec ax-local-control-plane crictl stop. Then watchkubectl -n ate-system get pod -l <router selector> -wandax get workspacesafterax applying a new Workspace. - Or stall the node long enough for the
/healthzliveness probe to fail:docker pause ax-local-control-plane, wait 2–3 minutes,docker unpause ax-local-control-plane. Sleeping the laptop with the cluster running is likely the most common real-world trigger. - Check with
kubectl -n ate-system port-forward pod/<atenet-router pod> 9901andcurl localhost:9901/ready(expectDRAINING).
Workaround
kubectl -n ate-system rollout restart deploy/atenet-router. Workspaces stuck in Preparing recover on ax-server's next setup retry or have to be re-created.
Possible fixes
- Substrate: don't drain Envoy on a router container restart (only on pod termination), or have the router call Envoy's
/healthcheck/okand clear the drain marker on startup; or give theenvoycontainer a liveness probe that fails while it isDRAININGwithout a router shutdown in progress. - AX: have
ax local status/ax local startdetect an unreadyatenet-routerand say how to fix it, and have workspace setup report the router's unreachability as a condition on the Workspace rather than leaving it silently inPreparing.
Environment
ax version dev+3ec184a(ax local start), Kind v0.33.0, Kubernetes v1.36.1, single nodeax-local-control-plane, macOS arm64 host with a 4 CPU / 8 GB VM.- Substrate images
ghcr.io/agent-substrate/substrate/atenet:v1.0.0andenvoy-dataplane:v1.0.0.
Activity
rakyll commentedon Nov 25, 2026
Duplicate of #755.
install: name unavailable Substrate workloads in ax local status (#758)