State Store and Gateway listen addresses have no config key #1068

Closed
opened 2026-10-27 13:38:53 +00:00 by sam · 0 comments
Owner

The two gRPC listeners are flag-only; the HTTP listeners are config-only. That asymmetry makes the port pair behind task dev impossible to retarget from configuration.

What IS configurable (the only three toml:"listen" keys in package config):
[web].listen archie-ui dashboard (127.0.0.1:8484, "off" disables)
[health].listen /healthz (127.0.0.1:8485)
[chat.email].listen_addr inbound SMTP

What is NOT:
archie-state-store -listen default 127.0.0.1:9090 (cmd/archie-state-store/main.go:34)
archie-gateway -listen default 127.0.0.1:8585 (cmd/archie-gateway/main.go:27)
archie-state-store -ready-addr (readiness, e.g. :9091)
Vite's own port (no server.port in ui/vite.config.js, so it auto-increments from 5173)
the Vite proxy target 8484, hardcoded in ui/vite.config.js

Root cause is structural: [services.state] and [services.gateway] are CONNECTION entries - config.ServiceConnection carries only target and target_token (internal/config/services.go:19-27) - because the config models how to DIAL the services after the process split (docs/prds/state-store-contract.md). The servers themselves only ever learned a flag. So config can tell a client where the store is, but cannot tell the store where to listen.

Consequence: the port lives in two places that must agree (the binary default or its -listen flag, and the overlay's [services.state].target), and dev:state-store supplies neither. On a machine where another service owns 9090 - cockpit does by default - 'task dev' cannot start and there is no supported knob: the store dies with 'bind: address already in use' and archie-ui then reports 'state store: connection error ... error reading server preface: EOF', which reads like a code fault rather than a port collision. Verifying the dashboard on such a host required passing -listen 127.0.0.1:9191 plus a hand-written overlay with a matching target.

Minimal symmetric fix: add [services.state].listen and [services.gateway].listen, defaulted in internal/infrastructure/configuration/defaults.go beside defaultWebListen, and have each cmd/ prefer the config value over the flag default - exactly how archie-ui already prefers [web].listen. Then deployments/dev.toml names the port once, next to the target it must match, and task dev becomes retargetable by editing one overlay.

Close reason

Closed


Imported from beads archie-core-4rk0 · GitHub #864 · type task · priority P2 · created 2026-09-18 · closed 2026-09-18

The two gRPC listeners are flag-only; the HTTP listeners are config-only. That asymmetry makes the port pair behind task dev impossible to retarget from configuration. What IS configurable (the only three toml:"listen" keys in package config): [web].listen archie-ui dashboard (127.0.0.1:8484, "off" disables) [health].listen /healthz (127.0.0.1:8485) [chat.email].listen_addr inbound SMTP What is NOT: archie-state-store -listen default 127.0.0.1:9090 (cmd/archie-state-store/main.go:34) archie-gateway -listen default 127.0.0.1:8585 (cmd/archie-gateway/main.go:27) archie-state-store -ready-addr (readiness, e.g. :9091) Vite's own port (no server.port in ui/vite.config.js, so it auto-increments from 5173) the Vite proxy target 8484, hardcoded in ui/vite.config.js Root cause is structural: [services.state] and [services.gateway] are CONNECTION entries - config.ServiceConnection carries only target and target_token (internal/config/services.go:19-27) - because the config models how to DIAL the services after the process split (docs/prds/state-store-contract.md). The servers themselves only ever learned a flag. So config can tell a client where the store is, but cannot tell the store where to listen. Consequence: the port lives in two places that must agree (the binary default or its -listen flag, and the overlay's [services.state].target), and dev:state-store supplies neither. On a machine where another service owns 9090 - cockpit does by default - 'task dev' cannot start and there is no supported knob: the store dies with 'bind: address already in use' and archie-ui then reports 'state store: connection error ... error reading server preface: EOF', which reads like a code fault rather than a port collision. Verifying the dashboard on such a host required passing -listen 127.0.0.1:9191 plus a hand-written overlay with a matching target. Minimal symmetric fix: add [services.state].listen and [services.gateway].listen, defaulted in internal/infrastructure/configuration/defaults.go beside defaultWebListen, and have each cmd/ prefer the config value over the flag default - exactly how archie-ui already prefers [web].listen. Then deployments/dev.toml names the port once, next to the target it must match, and task dev becomes retargetable by editing one overlay. ### Close reason Closed --- _Imported from beads `archie-core-4rk0` · GitHub #864 · type task · priority P2 · created 2026-09-18 · closed 2026-09-18_
sam added the mediumtask labels 2026-10-27 13:38:53 +00:00
sam self-assigned this 2026-10-27 13:38:53 +00:00
sam closed this issue 2026-10-27 13:38:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1068