Our API is crashing

hyperswapxPRO

3 days 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

19 Replies

sarahkb125EMPLOYEE

3 days 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[bot] 3 days ago


hyperswapxPRO

3 days ago

Yes, but its still down until now


Status changed to Awaiting Railway Response railway[bot] 3 days ago


hyperswapxPRO

3 days ago

?


railway[bot]

3 days 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[bot] 3 days ago


sarahkb125EMPLOYEE

3 days 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.


hyperswapxPRO

3 days 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[bot] 3 days ago


hyperswapxPRO

3 days ago

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


hyperswapxPRO

3 days ago

I've just push in api-prod as well


hyperswapxPRO

3 days ago

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


railway[bot]

3 days ago

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


hyperswapxPRO

3 days ago

.


3 days ago

Can you send the repository of this project?


hyperswapxPRO

3 days ago

.


3 days ago

I can't access your private repository.


hyperswapxPRO

3 days ago

Can you give me your github handle?


hyperswapxPRO

2 days ago

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


hyperswapxPRO

2 days ago

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


hyperswapxPRO

2 days ago

?


hyperswapxPRO

2 days 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.


chandrikaEMPLOYEE

2 days 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[bot] 1 day ago


Status changed to Solved chandrika 1 day ago