SocketTimeOut exception i am getting
Anonymous
FREEOP

6 months ago

HI. I put my project on railway. Project works with connecting external api. I can able to send request and receive response, but one of the my external apis can not connect . I am getting SocketTimeOut exception even thoug i set 60 seconds connectTimeOutRequest(response). I think railway cannot connect this external api. HOw can i solve it, could u help me

$10 Bounty

3 Replies

Railway
BOT

6 months ago


brody
EMPLOYEE

6 months ago

Hello,

We do not have any kind of connection time limits for external connections, any limitations in this regard would come from your own application, or the service you are trying to connect to.

I'll go ahead and open this up to the community, they may be able to help you debug where your connection time limits are coming from, because they are not on the Railway platform side of things.

Best,

Brody


Status changed to Awaiting User Response Railway 6 months ago


brody
EMPLOYEE

6 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 6 months ago


oko-tester
HOBBY

6 months ago

Hi,

A SocketTimeoutException usually means that your application cannot establish or complete the connection to the external API within the set timeout. Since Railway does not impose connection time limits, the issue is likely due to one of these reasons:

  • The external API might be blocking Railway’s IPs or has regional restrictions.

  • The API response time might be longer than your configured timeouts (make sure to increase both connection and read timeouts).

  • There could be network issues or SSL/TLS handshake problems.

I recommend testing connectivity directly from your Railway deployment shell using a command like:

curl -v https://external-api-url

This helps verify if the API is reachable from Railway’s environment.

If the API is reachable locally but not from Railway, contacting the API provider to whitelist Railway’s IPs or clarify network policies may help.


Loading...