Connection Issue: App Service to MongoDB (ECONNRESET on Public, ENOTFOUND on Private)
riadhbennourdine
HOBBYOP

a month ago

Message:

Hello,

I am experiencing a critical and persistent connection issue between my Node.js application and my MongoDB database, both hosted on Railway.

My users are currently unable to log in to the application.

* ID du projet Railway : 50aae3e7-0dbe-4e7f-9265-435b952bf7fb

* ID du service applicatif (Node.js) : 62330932-50ab-4c64-ba90-e6ce84f0c2a4

* ID du service MongoDB : 394dfbae-1b07-4024-a8d3-1c4a389a60c2

* Nom du service MongoDB : mongodb (ceci est confirmé par les logs et la configuration)

This issue started today around 18:00 UTC (February 11, 2026).

I have performed extensive testing, and here is a summary of my findings:

1. When using the Public Networking address (centerbeam.proxy.rlwy.net:33803) in my MONGO_URL connection string, my application consistently

fails with a network error: MongoServerSelectionError: read ECONNRESET.

2. When attempting to use the Private Networking address (mongodb.railway.internal:27017), my application consistently fails with a DNS

error: MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb.railway.internal.

3. When attempting to use the service name as the hostname (mongodb:27017) for private networking, my application also fails with a DNS

error: MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb.

These tests strongly suggest a fundamental connectivity problem within your platform:

- The public network route appears unstable, leading to connection resets.

- The private network's DNS resolution for my database service is failing.

I have already tried adding robustness options (e.g., retryWrites=true, connectTimeoutMS) to my MongoDB client configuration without success.

Other users on your community forum appear to be experiencing similar issues today.

Could you please urgently investigate the network connectivity (both public and private) for my services? I am completely blocked.

Thank you for your assistance.

Solved

16 Replies

hikieadmin
PRO

a month ago

yes i am gettin this error, i tried everything


a month ago

Hello,

We had an incident earlier that caused deployments to go offline while the status in the UI didn't properly update. This has since been resolved, but in some cases, you may need to redeploy your services.

You can find the post-mortem for the incident here: https://blog.railway.com/p/incident-report-february-11-2026

We are deeply sorry for the impact this incident caused.


Status changed to Awaiting User Response Railway about 1 month ago


riadhbennourdine
HOBBYOP

a month ago

Persistent Connection Issue: Node.js App to MongoDB (ECONNRESET) - Still impacted after Feb 11th incident

Hello,

My Node.js application is still experiencing critical connection issues with its MongoDB database, both hosted on Railway. My users are

currently unable to log in, which is severely impacting my service.

Project ID: 50aae3e7-0dbe-4e7f-9265-435b952bf7fb

App Service ID: 62330932-50ab-4c64-ba90-e6ce84f0c2a4

MongoDB Service ID: 394dfbae-1b07-4024-a8d3-1c4a389a60c2

Despite the incident on Feb 11th being marked as resolved and having manually redeployed both my app and DB services, the problem persists.

The consistent error I'm seeing is MongoServerSelectionError: read ECONNRESET. This happens when my app tries to connect using the public

networking address (centerbeam.proxy.rlwy.net:33803). Attempts to use private networking addresses (mongodb.railway.internal or mongodb as

hostname) result in ENOTFOUND errors.

This suggests a deeper network or DNS resolution issue within the platform affecting my services.

I've already tried various MONGO_URL configurations and client-side robustness options, and have reverted all recent code changes, confirming

the issue is external to my application's code.

Is anyone else still experiencing this specific ECONNRESET or ENOTFOUND issue for MongoDB connections even after redeploying? Any suggestions

or insights would be greatly appreciated.

Thank you.

---


Status changed to Awaiting Railway Response Railway about 1 month ago


a month ago

In some cases, you may need to redeploy your services.


Status changed to Awaiting User Response Railway about 1 month ago


brody

In some cases, you may need to redeploy your services.

riadhbennourdine
HOBBYOP

a month ago

already done, but nothing happens, still app out of service


Status changed to Awaiting Railway Response Railway about 1 month ago


a month ago

I am not seeing any user-initiated redeployments on your end.

I will go ahead and do it for you.


Status changed to Awaiting User Response Railway about 1 month ago


riadhbennourdine
HOBBYOP

a month ago

index-ByIwEsjV-1770839483640.js:12

POST https://newpharmia-production.up.railway.app/api/auth/login 500 (Internal Server Error)

(anonymous) @ index-ByIwEsjV-1770839483640.js:12

LoginView--O6FTdY--1770839483640.js:1 Error: Erreur interne du serveur.


Status changed to Awaiting Railway Response Railway about 1 month ago


riadhbennourdine
HOBBYOP

a month ago

Login error: MongoServerSelectionError: read ECONNRESET

at Topology.selectServer (/app/node_modules/mongodb/lib/sdam/topology.js:327:38)

at async Topology._connect (/app/node_modules/mongodb/lib/sdam/topology.js:200:28)

at async Topology.connect (/app/node_modules/mongodb/lib/sdam/topology.js:152:13)

at async topologyConnect (/app/node_modules/mongodb/lib/mongo_client.js:264:17)

at async MongoClient._connect (/app/node_modules/mongodb/lib/mongo_client.js:277:13)

type: 'Unknown',

at async MongoClient.connect (/app/node_modules/mongodb/lib/mongo_client.js:202:13) {

servers: Map(1) { 'centerbeam.proxy.rlwy.net:33803' => [ServerDescription] },

errorLabelSet: Set(0) {},

stale: false,

compatible: true,

reason: TopologyDescription {

heartbeatFrequencyMS: 10000,

commonWireVersion: 0,

localThresholdMS: 15,

logicalSessionTimeoutMinutes: null

[cause]: MongoNetworkError: read ECONNRESET

},

code: undefined,

setName: null,

maxElectionId: null,

maxSetVersion: null,

}

}

}

at Connection.onSocketError (/app/node_modules/mongodb/lib/cmap/connection.js:110:22)

at Socket.emit (node:events:536:35)

Login error: MongoServerSelectionError: read ECONNRESET

at Topology.selectServer (/app/node_modules/mongodb/lib/sdam/topology.js:327:38)

at async Topology._connect (/app/node_modules/mongodb/lib/sdam/topology.js:200:28)

at async Topology.connect (/app/node_modules/mongodb/lib/sdam/topology.js:152:13)

at emitErrorNT (node:internal/streams/destroy:169:8)

at async topologyConnect (/app/node_modules/mongodb/lib/mongo_client.js:264:17)

at emitErrorCloseNT (node:internal/streams/destroy:128:3)

at async MongoClient._connect (/app/node_modules/mongodb/lib/mongo_client.js:277:13)

at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {

errorLabelSet: Set(2) { 'HandshakeError', 'ResetPool' },

at async MongoClient.connect (/app/node_modules/mongodb/lib/mongo_client.js:202:13) {

beforeHandshake: false,

[cause]: Error: read ECONNRESET

at TCP.onStreamRead (node:internal/stream_base_commons:218:20) {

errno: -104,

code: 'ECONNRESET',

syscall: 'read'

errorLabelSet: Set(0) {},

reason: TopologyDescription {

type: 'Unknown',

servers: Map(1) { 'centerbeam.proxy.rlwy.net:33803' => [ServerDescription] },

stale: false,

compatible: true,

heartbeatFrequencyMS: 10000,

localThresholdMS: 15,

setName: null,

maxElectionId: null,

maxSetVersion: null,

commonWireVersion: 0,

logicalSessionTimeoutMinutes: null

},

code: undefined,

[cause]: MongoNetworkError: read ECONNRESET

at Connection.onSocketError (/app/node_modules/mongodb/lib/cmap/connection.js:110:22)

at Socket.emit (node:events:536:35)

at emitErrorNT (node:internal/streams/destroy:169:8)

at emitErrorCloseNT (node:internal/streams/destroy:128:3)

at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {

errorLabelSet: Set(2) { 'HandshakeError', 'ResetPool' },

beforeHandshake: false,

[cause]: Error: read ECONNRESET

at TCP.onStreamRead (node:internal/stream_base_commons:218:20) {

errno: -104,

code: 'ECONNRESET',

syscall: 'read'

}

}

}


Your MongoDB service and Node.js app appear to be in different projects (MongoDB in "insightful-dedication", newpharmia in "helpful-cooperation"), which is why private networking DNS resolution fails - services must be in the same project to use .railway.internal addresses. Both services currently show SUCCESS status after the redeployment at 23:01 UTC.


Status changed to Awaiting User Response Railway about 1 month ago


safecws
FREE

a month ago

Starting Container

npm warn config production Use --omit=dev instead.

Prisma schema loaded from prisma/schema.prisma

Datasource "db": PostgreSQL database "railway", schema "public" at "postgres.railway.internal:5432"

Error: P1001: Can't reach database server at postgres.railway.internal:5432

Please make sure your database server is running at postgres.railway.internal:5432.


Status changed to Awaiting Railway Response Railway about 1 month ago


safecws

Starting Containernpm warn config production Use --omit=dev instead.Prisma schema loaded from prisma/schema.prismaDatasource "db": PostgreSQL database "railway", schema "public" at "postgres.railway.internal:5432"Error: P1001: Can't reach database server at postgres.railway.internal:5432Please make sure your database server is running at postgres.railway.internal:5432.

you will need to restart/redeploy your DB it seems


Status changed to Awaiting User Response Railway about 1 month ago


angelo-railway

you will need to restart/redeploy your DB it seems

safecws
FREE

a month ago

Ive done it several times, got floating trying to connect to database without success.


Status changed to Awaiting Railway Response Railway about 1 month ago


angelo-railway

Your MongoDB service and Node.js app appear to be in different projects (MongoDB in "insightful-dedication", newpharmia in "helpful-cooperation"), which is why private networking DNS resolution fails - services must be in the same project to use .railway.internal addresses. Both services currently show SUCCESS status after the redeployment at 23:01 UTC.

riadhbennourdine
HOBBYOP

a month ago

thanx a lot, it's resolved now !


safecws

Ive done it several times, got floating trying to connect to database without success.

Link?


Status changed to Awaiting User Response Railway about 1 month ago


angelo-railway

Link?

safecws
FREE

a month ago

is there a way I can send it on a DM ? Thx


Status changed to Awaiting Railway Response Railway about 1 month ago


safecws

is there a way I can send it on a DM ? Thx

a month ago

Please open your own private thread.


Status changed to Awaiting User Response Railway about 1 month ago


Status changed to Solved brody about 1 month ago


Loading...