Railway not connecting to AWS on startup
theodormarcu
PROOP

a year ago

Issue Description

Our service is experiencing intermittent database connection failures on deployment, occurring in approximately 80% of deploy attempts. The service fails to establish a connection with our RDS database instance, though it eventually succeeds after multiple redeploy attempts.

Symptoms

  • Database connection errors during service startup

  • Error message indicates failure to reach database at [redacted].us-west-1.rds.amazonaws.com:[redacted]

  • Service requires multiple redeploy attempts to successfully connect

  • Affects only one specific service; other services using the same Prisma connector and database connection remain functional

Error Logs

Copy

2024-12-12 01:18:15 [server] error: Error connecting to database: Can't reach database server at [redacted]

Additional Context

  • Issue is new; service previously deployed without connection problems

  • Success rate: ~20% of deploys succeed on first attempt

  • Other services in the same project connecting to the same database are unaffected

  • Using Prisma as the database connector

Impact

  • Delays in deploying new commits

  • Requires manual intervention (multiple redeploys) to get the service online

  • Affects deployment reliability but not runtime stability once connected

Environment

  • Platform: Railway

  • Database: AWS RDS

  • ORM: Prisma

  • Node.js (also seeing Buffer deprecation warnings, though likely unrelated)

Solved

14 Replies

a year ago

Hey,

It looks like that service is on the outdated Legacy runtime still, would you mind switching it to the V2 runtime in it's service settings and let us know if that fixes this!


Status changed to Awaiting User Response Railway over 1 year ago


theodormarcu
PROOP

a year ago

It worked! But would be curious to learn why


Status changed to Awaiting Railway Response Railway over 1 year ago


a year ago

Known issue with the Legacy runtime, DNS takes ~3 seconds to become available after container start, this is entirety been fixed on the V2 runtime.


Status changed to Awaiting User Response Railway over 1 year ago


Status changed to Solved brody over 1 year ago


Status changed to Awaiting Railway Response theodormarcu about 1 year ago


theodormarcu
PROOP

a year ago

Just checked this again. I can't seem to be able to toggle the V2 runtime for the service.

My account is in priority boarding and I already toggled the new builder, but I don't see feature flags or anything else I can use.


a year ago

If you don't see the runtime selector it means you are already on the V2 runtime.

We also don't recommend using the new builder right now as that project has been put on pause for the time being.

What issue are you running into?


Status changed to Awaiting User Response Railway about 1 year ago


theodormarcu
PROOP

a year ago

Same issue as above - need many redeploys for railway to find AWS - never an issue locally or when i connect to the same DB from tableplus etc


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

Can you link me to a specific deployment with the issue?


Status changed to Awaiting User Response Railway about 1 year ago



Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

That service is still on the Legacy runtime, can you switch it to V2?


Status changed to Awaiting User Response Railway about 1 year ago


theodormarcu
PROOP

a year ago

I just told you above I don't see how to change the runtime and you told me that means it's already on V2 then - can you help me figure that out then
?


Status changed to Awaiting Railway Response Railway about 1 year ago


theodormarcu
PROOP

a year ago

It actually finally showed up again so switched it!


a year ago

Apologies for the confusion, when I sent that message the runtime selector was visible.

It would have also disappeared for admins if already V2, so you could see it as long as I can see it.


Status changed to Awaiting User Response Railway about 1 year ago


theodormarcu
PROOP

a year ago

No worries! Thank you - was able to migrate successfully and I haven't encountered the AWS error yet grinning emoji Thanks!!!


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

Awsome, going to mark this as solved then!


Status changed to Awaiting User Response Railway about 1 year ago


Status changed to Solved brody about 1 year ago


Loading...