MongoDB Connection Issue: Client Disconnects Immediately After Successful Authentication
gitronnie
HOBBYOP

2 months ago

Hello Railway Team,

I am experiencing a persistent connection issue with my MongoDB service and would appreciate your help.

My clients (MongoDB Compass and a local application) are unable to maintain a connection to my database. The server logs show that the connection and authentication are successful, but the client disconnects immediately afterward. The client-side error is usually a generic timeout (read ETIMEDOUT or similar).

Project/Service Information:

  • Service: MongoDB

  • Public TCP Proxy Address:hopper.proxy.rlwy.net:57293

What I've Done (Troubleshooting Steps):

  1. Verified Server Health: I have redeployed the service multiple times. The deployment logs show a successful startup (mongod startup complete) with no crashes or memory errors.

  2. Verified Successful Authentication: The server logs clearly show Connection accepted followed by Successfully authenticated for each of my connection attempts.

  3. Verified Client Disconnection: Immediately after successful authentication, the logs show Connection ended and Interrupted operation as its client disconnected.

  4. Exhaustive Connection String Testing: I have tried connecting with every possible parameter to rule out client-side issues, including:

    • connectTimeoutMS=60000

    • authSource=admin

    • tls=false

    • directConnection=true

Here is the full connection string I am using, which covers all troubleshooting steps: mongodb://mongo:******@hopper.proxy.rlwy.net:57293/?connectTimeoutMS=60000&authSource=admin&tls=false&directConnection=true

Despite all of this, the client still disconnects. This leads me to believe there may be a deeper issue with the TCP proxy or the platform environment that is causing the client driver to fail post-authentication.

Could you please take a look at my service to see if there are any underlying platform issues that could be causing this behavior? I have attached the server logs for your review.

Thank you for your time and assistance.

Solved$10 Bounty

5 Replies

Railway
BOT

2 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


brody
EMPLOYEE

2 months 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 brody 3 months ago


Railway

Hey there! We've found the following might help you get unblocked faster: - [🧵 DEPLOYING WITH MYSQL DATABASE ISSUES](https://station.railway.com/questions/deploying-with-mysql-database-issues-554fc1f5) If you find the answer from one of these, please let us know by solving the thread!

gitronnie
HOBBYOP

2 months ago

its mongodb and not sql


gitronnie
HOBBYOP

2 months ago

This happened after the recent incident . I used to be able to connect with

mongodb://mongo:******@hopper.proxy.rlwy.net:57293/verzemi?authSource=admin

https://status.railway.com/cmfv2ciuy00krz1jvwfghr4gz
September 23, 2025 at 5:27 AM

During the incident, some private networks may have been misconfigured for a small subset of users. We are currently applying fixes retroactively to resolve this. You may see your services redeployed by Railway if you are impacted.


noahd
EMPLOYEE

2 months ago

On a redeploy was this fixed? It does look like its timeframe conflicted with a railway issue.


gitronnie
HOBBYOP

2 months ago

Issue resolved by itself


Status changed to Open brody 2 months ago


Status changed to Solved brody 2 months ago


Loading...