# Drain members and handle failures

Source: https://usecns.dev/thalamus-topic-drain-members-and-handle-failures/

[Start here](https://usecns.dev/manual-thalamus/)
[CLI commands](https://usecns.dev/commands-thalamus/)
[Configuration & integration](https://usecns.dev/thalamus-topics/)

Before maintaining a member, run `thalamus drain` or POST `/admin/v1/members/{name}/drain`. This marks it draining and evicts its pins. Existing streams are not cancelled; subsequent requests select elsewhere. DELETE `/admin/v1/members/{name}` removes a member and its pins. Missing names return 404. Re-registering the member replaces its runtime record and can clear draining; there is no separate undrain CLI.

An unhealthy/draining pinned target is excluded and the next turn re-pins to an eligible target. This does **not** replay an already-started generation on another member. A proxy connection failure returns 502; upstream statuses and streaming bodies are passed through. Endpoint fallback is discovery-level reachability selection, not a general retry loop for failed inference. Clients must decide whether retrying a failed generation is safe.

| Observation | Meaning / next action |
| --- | --- |
| `/health` is 200, `healthy_members: 0`, `total_members: 0`, `members: "none configured"` | Process is alive but unconfigured. Supply config or registration. Startup also logs `NO MEMBERS CONFIGURED`. |
| Zero members and `/v1/*` returns 503 `error.type: thalamus_no_members_configured` | Explicit empty-registry condition, including model-list and plane aliases. Not a successful empty model list. |
| Members exist; no eligible healthy member for requested plane/model/capability | 503 `no healthy member available for plane ...`; examine health, draining, capabilities, active filter and model table. |
| Members exist but all unhealthy; `/v1/models` gives an empty list | Model listing aggregates healthy, nondraining members, not configured capacity. |
| Admission queue timeout | Eligible intelligence capacity remained occupied; inspect inflight/open streams before raising limits. |
| 502 upstream error | Proxy transport/body failure after selection; examine active endpoint and backend. |