Python Telegram bots timing out on Railway while Node.js bot works fine
abm1982
PROOP

10 days ago

Hello Railway team,

I’m experiencing a consistent networking issue affecting only my Python Telegram bots on Railway.

Summary

  • I have multiple Telegram bots deployed on Railway

  • All Python-based bots stopped working at the same time

  • A Node.js Telegram bot in the same account/project continues to work normally

  • The issue only happens on Railway — everything works locally

This strongly suggests a platform-level networking or routing issue affecting Python HTTP clients, not an application bug.

Symptoms

All Python bots fail to connect to Telegram’s API:

  • TelegramNetworkError: HTTP Client says - Request timeout error

  • httpx.ConnectError: All connection attempts failed

  • aiohttp / httpcore timeout errors

  • Fails on api.telegram.org:443

The bots enter infinite retry loops and never receive updates.

What I’ve verified

  • white_check_mark emoji Same code works locally

  • white_check_mark emoji Bot tokens are valid

  • white_check_mark emoji Old commits that previously worked now fail

  • white_check_mark emoji FastAPI / databases work normally

  • white_check_mark emoji Node.js Telegram bot on Railway works without issues

  • x emoji Only Python bots fail, and only on Railway

Awaiting User Response

8 Replies

hellomynot
HOBBY

10 days ago

Hello, I have the same problem



pouyan2211
PRO

10 days ago

I have this problem, too.


We're aware that Telegram bots deployed on Railway are currently experiencing connectivity issues due to Telegram blocking our IP range. We understand how critical this is for your service, and we sincerely apologize for the disruption.

We've immediately escalated this to the Telegram team and are actively working toward a resolution. In the meantime, if you need to restore service urgently, you may want to explore temporary routing options (like using a proxy or alternative deployment) while we work this out on our end.

We'll update you as soon as we have more information from Telegram. Thank you for your patience.


Status changed to Awaiting User Response Railway 9 days ago


sardor01
PRO

9 days ago

angelo-railway These type of issues must be included in your status updates! This issue affected a lot of my users and I spent far too much time before I landed in this thread!


Status changed to Awaiting Railway Response Railway 9 days ago


Railway
BOT

9 days ago

Hello!

We're acknowledging your issue and attaching a ticket to this thread.

We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.

Please reply to this thread if you have any questions!


chandrika
EMPLOYEE

9 days ago

Hi all, we're still waiting to hear back from Telegram. In the meantime, sharing this workaround that a user posted that has been helpful to other users (while we sort this out in case it helps you) https://station.railway.com/questions/bot-error-ef3e0945#nrsa

We're really very sorry for the inconvenience here


Status changed to Awaiting User Response Railway 9 days ago


chandrika

Hi all, we're still waiting to hear back from Telegram. In the meantime, sharing this workaround that a user posted that has been helpful to other users (while we sort this out in case it helps you) https://station.railway.com/questions/bot-error-ef3e0945#nrsaWe're really very sorry for the inconvenience here

Update: the Railway team is still trying to get in contact with the TG team. You can use the above workaround or use the one-click deploy that uses CF Workers to set up a proxy to allow you to proxy requests to get around the connection issue.

https://railway.com/deploy/tg-cloudflare-worker-proxy-workaround?referralCode=N8f7Nb&utm_medium=integration&utm_source=template&utm_campaign=generic


Loading...