25 days ago
First I tried just right clicking > Database > MongoDB, the database starts but doesn't work, the logs show:
MongoDB cannot start: Linux kernel versions 6.19 and newer has a known incompatibility with this version of MongoDB. See https://jira.mongodb.org/browse/SERVER-121912 for more information.
Based on the link provided I updated to 8.3.2 from 8 and it's still giving me the same error.
2 Replies
Status changed to Open Railway • 25 days ago
25 days ago
This is a known incompatibility between Linux kernel 6.19 and the version of TCMalloc bundled with MongoDB 8.0+. Running MongoDB 8.0 or newer on kernel 6.19 causes it to crash on startup. This affects all MongoDB packages — from the official website, package managers, and Docker. MongoDB
Upgrading to 8.3.2 won't help because the issue is in TCMalloc, not MongoDB's version number — all current MongoDB 8.x releases are affected.
Option 1 — Downgrade your Linux kernel (most reliable)
To resolve the crash, downgrade to Linux Kernel 6.18 or earlier. This is MongoDB's official recommended workaround for now
Option 2 — Fix the GLIBC_TUNABLES environment variable (systemd installs)
The mongodb service file ships with Environment="GLIBC_TUNABLES=glibc.pthread.rseq=0", which disables restartable sequences in glibc. But the TCMalloc bundled inside mongod requires rseq to work correctly — without it, memory gets corrupted after ~1 minute, causing a SEGV crash
fix 2-
Fix: Edit the service file to re-enable rseq:
sudo systemctl edit mongodb
Add the following override:
[Service]
Environment="GLIBC_TUNABLES=glibc.pthread.rseq=1"
Then reload and restart:
sudo systemctl daemon-reload
sudo systemctl restart mongodb
25 days ago
On Railway you cannot downgrade the host kernel or use systemctl edit inside the managed MongoDB template, so the usual VM workaround does not apply here.
The error is coming from MongoDB itself:
MongoDB cannot start: Linux kernel versions 6.19 and newer has a known incompatibility with this version of MongoDB.
Since Railway’s Mongo template currently deploys mongo:8.0, upgrading within 8.x may not help if the image still hits SERVER-121912 on the host kernel.
Practical Railway options:
- Try a MongoDB image tag known not to hit this issue, for example a 7.x tag, and keep the same
/data/dbvolume mount. - If you need MongoDB 8.x specifically, this likely needs Railway to move/fix the host/runtime side or update the template image once MongoDB publishes a working fix.
- Do not delete the volume while testing image tags. If this is an existing DB, take/keep a snapshot first.
The public Railway Mongo template currently shows mongo:8.0 with /data/db as the volume path:
https://railway.com/deploy/mongo
The MongoDB issue referenced by the log is: