You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found during the review of #180. Not changed there — altering port precedence on a hotfix risked the live deploy.
apps/worker/src/index.ts resolves process.env.PORT ?? process.env.HEALTH_PORT ?? '3003', preferring PORT. Every other health-serving app reads HEALTH_PORT only (apps/discord-bot, apps/slack-bot, apps/teams-bot, apps/linear-sync), reserving PORT for a separate listener. The worker is the outlier, and docs/deployment.md already documents the asymmetry as known.
PORT="" (a cleared platform variable) yields parseInt('') → NaN, and listen(NaN) throws ERR_SOCKET_BAD_PORTsynchronously at module scope — the process dies before binding, producing the same opaque "replicas never became healthy" signal as the original incident.
The code's 3003 fallback disagrees with the Dockerfile's 3005 and collides with teams-bot's port.
Also worth fixing alongside: healthServer has no 'error' listener, so EADDRINUSE/EACCES is an uncaught exception with a bare stack trace.
Found during the review of #180. Not changed there — altering port precedence on a hotfix risked the live deploy.
apps/worker/src/index.tsresolvesprocess.env.PORT ?? process.env.HEALTH_PORT ?? '3003', preferringPORT. Every other health-serving app readsHEALTH_PORTonly (apps/discord-bot,apps/slack-bot,apps/teams-bot,apps/linear-sync), reservingPORTfor a separate listener. The worker is the outlier, anddocs/deployment.mdalready documents the asymmetry as known.Three concrete problems:
PORT, the app binds it whileENV HEALTH_PORT=3005andEXPOSE 3005say otherwise. fix(worker): repair the missing SystemConfig table, guard against schema drift, and gate it in CI #180 made the Dockerfile HEALTHCHECK follow the same precedence as a stopgap, but the underlying disagreement remains.PORT=""(a cleared platform variable) yieldsparseInt('')→NaN, andlisten(NaN)throwsERR_SOCKET_BAD_PORTsynchronously at module scope — the process dies before binding, producing the same opaque "replicas never became healthy" signal as the original incident.3003fallback disagrees with the Dockerfile's 3005 and collides with teams-bot's port.Also worth fixing alongside:
healthServerhas no'error'listener, soEADDRINUSE/EACCESis an uncaught exception with a bare stack trace.