Skip to content

fix(consumers): serve /health on the Bolt receiver for Railway healthcheck#266

Merged
LeonardoVieira1630 merged 2 commits into
devfrom
fix/consumer-healthcheck-bolt-port
Jun 23, 2026
Merged

fix(consumers): serve /health on the Bolt receiver for Railway healthcheck#266
LeonardoVieira1630 merged 2 commits into
devfrom
fix/consumer-healthcheck-bolt-port

Conversation

@LeonardoVieira1630

Copy link
Copy Markdown
Member

Problema

Deploys do consumer no ambiente dev do Railway falhavam (1/1 replicas never became healthy), enquanto a prod seguia de pé. Todos os PRs recentes pra dev quebravam no deploy.

Causa raiz

O healthcheck do Railway bate em $PORT/health (doc: "This variable's value is also used when performing health checks on your deployments"). No consumer, PORT=3004 é a porta do Slack Bolt, que não tinha rota /health. O endpoint /health real vive no webhook server (WEBHOOK_API_PORT=3003), que o Railway não sonda.

Resultado: a sonda tomava 404 (Unhandled HTTP request (GET) made to /health) e o deploy nunca ficava healthy. A config é antiga (healthcheck /health existe desde abr/2026); o dev só passou a exercê-la recentemente. A prod sobrevivia rodando um deployment que não reexecutava a sonda /health.

Fix

Adiciona uma rota /health ao HTTPReceiver do Bolt (a porta que o Railway sonda), retornando 200. Assim o healthcheck passa independente de qual porta o Railway resolver.

Verificação

  • tsc (build do consumer) passa limpo.
  • Deploy em dev: o log para de mostrar Unhandled /health, o healthcheck fica verde e o deploy completa.

Follow-up (não incluso neste PR)

Hardening do 409 Conflict do Telegram: telegramBotService.launch() é fire-and-forget; um conflito de poller pode crashar o processo em loop e derrubar deploys. Tratar a rejeição evita isso.

🤖 Generated with Claude Code

…check

Railway gates deploys by probing $PORT/health, and the Slack Bolt receiver is
the server bound to $PORT (3004). The /health endpoint only existed on the
separate webhook server (WEBHOOK_API_PORT, 3003), which Railway never probes,
so the healthcheck 404'd and dev deploys failed (replicas never became healthy).

Add a /health custom route to the Bolt HTTPReceiver so the probe on $PORT
returns 200 and deploys can complete.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flow-editor Ready Ready Preview, Comment Jun 22, 2026 10:36pm
notification-system-dashboard Ready Ready Preview, Comment Jun 22, 2026 10:36pm

Request Review

@LeonardoVieira1630 LeonardoVieira1630 merged commit 8519959 into dev Jun 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants