Discord bot no longer working
amanat361
HOBBYOP

2 months ago

Our Discord bot (discord.js, using Bun runtime) has stopped connecting to the Discord gateway from Railway containers. The bot was working fine for weeks with no code changes.

Symptoms:

- client.login() from discord.js hangs indefinitely — never resolves, never rejects

- The bot token is confirmed valid — the exact same code and token works immediately when run locally

- We've deployed multiple times to try to get a fresh container, same result each time

- Region: us-west2

- Service: fitt-time-tracker

- Project ID: 3a7081d2-cdf1-4ffb-893f-ad6b20317456

Debugging steps taken:

1. Refreshed the Discord bot token and updated Railway env vars — no change

2. Added a 30-second timeout to detect the hang — confirmed login never completes on Railway

3. Verified all env vars are present and correct in deploy logs

4. Ran the bot locally with the same Railway token — connects to Discord gateway instantly

5. Redeployed multiple times — issue persists across deployments

This appears to be a networking issue where Railway containers in us-west2 cannot establish a WebSocket connection to Discord's gateway (gateway.discord.gg). The HTTP API server in the same container starts fine, so the container itself is healthy.

Solved$10 Bounty

1 Replies

Status changed to Awaiting Railway Response Railway 2 months ago


amanat361
HOBBYOP

2 months ago

Switched deployment to us-east and it works fine. us-west-2 was the culprit. Definitely should be investigated


Status changed to Solved 0x5b62656e5d about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...