2 days ago
Hello Railway Support,
My Python bot deployed on Railway cannot connect to the Rubika Bot API.
Service: GemShopTrixBot
Environment: production
Region: US West (California)
Start command: python main.py
Python: 3.12
Rubka: 8.1.11
I tested the network connection from inside the Railway container.
DNS TEST:
DNS_OK
DNS resolution works successfully.
HTTPS TEST:
HTTPS_FAILED
URLError:
DNS resolution works, but HTTPS requests to botapi.rubika.ir:443 time out from my Railway service.
The application then reports:
InvalidTokenError: Failed to validate bot token due to an unexpected error.
It also reports:
RuntimeError: no running event loop
I have verified that the BOT_TOKEN environment variable exists in Railway. I also updated Rubka from 8.1.10 to 8.1.11, but the HTTPS timeout remains.
Could you please check whether there is an outbound networking, routing, firewall, or egress issue preventing my Railway service from reaching botapi.rubika.ir:443?
Thank you.
5 Replies
2 days ago
Your GemShopTrixBot deployment is crashing at startup because the Rubka client's token-validation request to the Rubika API fails, and the "no running event loop" error is raised by the library while it handles that failure, so both errors come from the same failed request rather than from your token variable.
We have no record of a platform fault affecting outbound traffic from this service. A timeout to one specific destination, while DNS resolution works, is most often the destination not answering traffic from that network, not a Railway egress problem. A host-level egress fault would make every outbound destination fail at once.
The check that tells these apart is running the same HTTPS test from your container against a different external host, such as any public API you know is up. If that succeeds while botapi.rubika.ir:443 still times out, the route out of Railway is working and the timeout comes from the Rubika side, which you would need to raise with Rubika. For help with the bot's own connection handling, you can post in our community.
Status changed to Awaiting User Response Railway • 2 days ago
2 days ago
I ran the requested comparison from the same Railway container.
HTTPS_OK
STATUS: 200
TIME: 0.04 seconds
HTTPS_FAILED
URLError:
So outbound HTTPS works from the container, but the Rubika API endpoint specifically times out.
Status changed to Awaiting Railway Response Railway • 2 days ago
2 days ago
Your comparison matches what our network records show for GemShopTrixBot: outbound traffic leaves the container normally, with zero dropped packets on any connection. The connections to example.com complete and exchange data. The connections to the Rubika API addresses send only a handful of small packets per attempt and never move any real data before your client gives up, so the Rubika side is not completing the connection with traffic from our network.
Since other destinations work over the same route, this is not an egress, routing, or firewall fault on our side, and redeploying or changing region will not change how the Rubika servers respond. Whether those servers accept connections from hosting-provider or non-Iranian networks is something only Rubika can confirm.
Status changed to Awaiting User Response Railway • 2 days ago
2 days ago
Thank you. I understand.
I will contact Rubika to ask whether their Bot API accepts HTTPS connections from Railway/cloud hosting or non-Iranian networks.
I will provide them with the connection timeout details.
Status changed to Awaiting Railway Response Railway • 2 days ago
Status changed to Awaiting User Response Railway • 2 days ago
Status changed to Solved reza1356md-oss • 2 days ago
2 days ago
Thank you. I understand.
I will contact Rubika to ask whether their Bot API accepts HTTPS connections from Railway/cloud hosting or non-Iranian networks.
I will provide them with the connection timeout details.
Status changed to Awaiting Railway Response Railway • 2 days ago
Status changed to Awaiting User Response Railway • 2 days ago