Commit 185cd42
fix(consul-postgres-ha): wire SERVICES_JSON to coordinator env
Found during live verification on 2026-05-14: coord-0's config-entry
writer only emitted `proxy-defaults/global` and quit, leaving the
cluster with no per-service `service-resolver` entries or
intentions. Replicas downstream saw "server closed the connection
unexpectedly" on every pg_basebackup attempt — Envoy's
postgres-master upstream had no resolver, so EDS returned empty,
and the listener closed connections on accept.
Root cause: `local.services_json` was only set in `phala_app.worker`
env, not `phala_app.coordinator`. Coord-0's
`mesh-sidecar/entrypoint.sh` reads `SERVICES_JSON` to drive the
service-resolver + intentions writer (entrypoint.sh:384, 409, 424),
and an empty/unset value made every jq pipeline iterate over no
rows. Symptom verified by counting emitted "Config entry written:"
lines: 1 (only proxy-defaults) BEFORE the fix, 6 (proxy-defaults +
service-resolver/{demo,postgres-master,postgres-replica} +
service-intentions/{demo,webdemo}) AFTER applying it.
Two-file change: add `SERVICES_JSON = local.services_json` to
`phala_app.coordinator`'s env block, and the matching
`SERVICES_JSON=${SERVICES_JSON}` env line in
`compose/coordinator.yaml`.
A residual issue remains downstream (the standalone connect-proxies
that the platform sidecar registers fail their service-http-checks
watch with "service '' not in agent state", and replicas still
can't pg_basebackup with this fix alone — probably needs
DestinationServiceID set on the Pattern-B connect-proxy
registration); filing as a separate punch-list item.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 48b1b0d commit 185cd42
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
279 | 282 | | |
280 | 283 | | |
281 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
| |||
0 commit comments