We have two projects where the database keeps crashing
pp-tom
PROOP

17 days ago

image.png

Both the RCA and Humanise project on my account have databases that are crashing after around 10 minutes with this error. I'm currently rebooting each crash but is this caused by the outage? What is a more permanent fix here?

Attachments

$20 Bounty

3 Replies

Railway
BOT

17 days ago

The "Connection not authenticating" errors on your RCA and Humanise MongoDB databases were caused by the service disruption on May 20, which ran from 02:25 UTC to 07:57 UTC and affected services platform-wide. Both MongoDB instances were redeployed after the outage resolved and currently show successful deployment status, so they should now be stable without further reboots needed.


Railway
BOT

17 days ago

This thread has been marked as private. Any further activity in this thread will only be visible to you and Railway employees.

Status changed to Awaiting User Response Railway 17 days ago


pp-tom
PROOP

17 days ago

They are still happening now, even after redeployments


Status changed to Awaiting Railway Response Railway 17 days ago


Railway
BOT

17 days 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 Railway 17 days ago


aayankali
FREE

17 days ago

"Connection not authenticating" is not your actual error — it's a normal MongoDB 6.0+ diagnostic log that fires on every new connection before auth completes. It does not mean authentication failed. So this log isn't what's crashing your DB.

The real issue is likely one of these — check them in order:

  1. Out of Memory (most likely cause)

Run this on your server:

dmesg | grep -i "oom|killed"

If you see your mongod process being killed, that's your culprit. Fix: either add a swap file or reduce MongoDB's cache size in mongod.conf:

storage:

wiredTiger:

engineConfig:

  cacheSizeGB: 0.5

2. Disk full

df -h

MongoDB will crash if it runs out of disk space. Clear logs or old data if needed.

  1. Mongoose connection leak (very likely since both projects crash)

Since you're using Node.js/Mongoose and both projects crash on the same account, you may be opening a new DB connection on every request (common in serverless/Next.js). This exhausts the connection pool in ~10 minutes. Fix: use a global cached connection:

let cached = global.mongoose;

if (!cached) { cached = global.mongoose = { conn: null, promise: null }; }

if (!cached.conn) {

cached.promise = mongoose.connect(MONGODB_URI);

cached.conn = await cached.promise;

}

The outage is not related — the current MongoDB Atlas issue is isolated to AWS regions in UAE/Bahrain, which wouldn't affect both of your projects unless they're hosted there.

To narrow it down fast: check your server logs (not MongoDB logs) at the exact time of each crash and look for OOM kills or disk errors."


Welcome!

Sign in to your Railway account to join the conversation.

Loading...