fix(web,api): fix orchestrator proxy 502 connectivity #542
Reference in New Issue
Block a user
Delete Branch "fix/orchestrator-connectivity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Changes
Root cause 1: Orchestrator binds to 127.0.0.1 (unreachable from Docker network)
The orchestrator
main.tsreadsHOSTenv var (defaults to127.0.0.1). AddedHOST=0.0.0.0to all three compose files so the orchestrator listens on all interfaces and is reachable by container name.Root cause 2: Web server missing ORCHESTRATOR_URL
docker-compose.ymlanddocker-compose.coolify.ymlweb services were missingORCHESTRATOR_URL=http://orchestrator:3001. The server-side proxy fell through toNEXT_PUBLIC_API_URL(the public API URL) which has no/agents,/health/ready,/queue/*endpoints.Root cause 3: Web service network isolation (docker-compose.yml)
The web service was only on
mosaic-publicwhile the orchestrator was only onmosaic-internal— they could not communicate by service name. Added web tomosaic-internal.Root cause 4: Orchestrator missing ORCHESTRATOR_API_KEY
docker-compose.ymlanddocker-compose.swarm.portainer.ymldid not passORCHESTRATOR_API_KEYto the orchestrator service. TheOrchestratorApiKeyGuardwould reject all authenticated requests.Test plan
/api/orchestrator/healthreturns 200 instead of 502Closes SS-ORCH-001 (issue #534)