Our API is crashing
hyperswapx
PROOP

9 months ago

Hi Railway team,

I'm experiencing a critical issue with our API hosted on Railway. The service is heavily used right now, but it crashes every 2 minutes without any visible error logs. I have to manually restart it each time.

There doesn't seem to be any attack on the Cloudflare side, and the server is far from hitting its resource limits (we're using less than 10% of the allocated capacity)

Could this be related to a rate limit or some kind of automated shutdown mechanism?

I would really appreciate speaking with a Railway expert to resolve this as soon as possible.
I can give you access to our logs in order to check

Thank you in advance,

Solved$10 Bounty

Pinned Solution

hyperswapx
PROOP

9 months ago

I ended up finding the solution myself, it turns out that your PostgreSQL template doesn't handle connection pooling. I would have appreciated a bit more support, especially when asking straightforward questions, rather than receiving emoji responses

We were considering moving to an enterprise plan, but this kind of experience makes us question whether it's really worth it

Thank you, and have a good day.

19 Replies

sarahkb125
EMPLOYEE

9 months ago

In your metrics tab --> network graph, I'm seeing a big spike in network traffic recently. Does this correspond to when you see it crashing?


Status changed to Awaiting User Response Railway 9 months ago


hyperswapx
PROOP

9 months ago

Yes, but its still down until now


Status changed to Awaiting Railway Response Railway 9 months ago


hyperswapx
PROOP

9 months ago

?


Railway
BOT

9 months ago

Hello!

We've escalated your issue to our engineering team.

We aim to provide an update within 1 business day.

Please reply to this thread if you have any questions!

Status changed to Awaiting User Response Railway 9 months ago


sarahkb125
EMPLOYEE

9 months ago

Here's what I think the issue is:

When you're trying to handle SIGTERM signals in Node.js for graceful shutdowns, but you're running your app through npm commands like npm start, your signal handlers won't work properly. What happens is that your Node.js process actually runs as a child of the npm process, so when the system sends a SIGTERM signal, both npm and your app receive it.

Can you try running with just node not within npm? So instead of having something like web: npm start in your Procfile, you'd change it to web: node index.js. This way, your Node.js application becomes the top-level process and can properly receive and handle SIGTERM signals with whatever grace period you've coded in.


hyperswapx
PROOP

9 months ago

Hey, thank you for your response, I dont have a procfile, i m using the default nixpack

How I'm supposed to do?


Status changed to Awaiting Railway Response Railway 9 months ago


hyperswapx
PROOP

9 months ago

I tried sth on api-staging, could you take a look please ? thank you


hyperswapx
PROOP

9 months ago

I've just push in api-prod as well


hyperswapx
PROOP

9 months ago

the app is still down, we dont understand we dont have any errors


Railway
BOT

9 months ago

✅ The internal ticket npm sigterm error has been marked as completed.


hyperswapx
PROOP

9 months ago

.


9 months ago

Can you send the repository of this project?


hyperswapx
PROOP

9 months ago

.


9 months ago

facepalm emojiI can't access your private repository.


hyperswapx
PROOP

9 months ago

Can you give me your github handle?


hyperswapx
PROOP

9 months ago

We're using typeorm with typescript, does postgres on railway have a connection pool manager system ?


hyperswapx
PROOP

9 months ago

we've just move our database to supabase, we will remove the postgres if supabase is working


hyperswapx
PROOP

9 months ago

?


hyperswapx
PROOP

9 months ago

I ended up finding the solution myself, it turns out that your PostgreSQL template doesn't handle connection pooling. I would have appreciated a bit more support, especially when asking straightforward questions, rather than receiving emoji responses

We were considering moving to an enterprise plan, but this kind of experience makes us question whether it's really worth it

Thank you, and have a good day.


chandrika
EMPLOYEE

9 months ago

Hi HyperSwapX team, apologies about that — we had moved this question to community support as it appeared to be application specific (and not a Railway platform level problem).

Just wanted to mention, as one of the perks of our enterprise plan, you'd get a direct line with our team over Slack and you can reach out to us at anytime. In moments when enterprise users have urgent matters they would like to escalate to us, they can directly page us (yup, anytime - even 3 AM our time, including weekends).

If you're still considering it, I'd be happy to get you connected with our solutions team that would be able to answer any questions you've got to get going on Railway. Once again, sorry for the experience.


Status changed to Awaiting User Response Railway 9 months ago


Status changed to Solved chandrika 9 months ago


Loading...