R
Railway10mo ago
badcom

Can't connect to MongoDB via the MongoDB service > Data or via MongoDB Compass

I keep getting the attached error message when I try to connect to MongoDB via the Railway dashboard. If I try to connect via MongoDB Compass the connection times out and it never connects. What am I missing? Project ID: 2c41e4bd-c910-4316-8e83-f0c3b6c63eab
No description
Solution:
mongo listens on 27017 by default, not 27021
Jump to solution
14 Replies
Percy
Percy10mo ago
Project ID: 2c41e4bd-c910-4316-8e83-f0c3b6c63eab
Brody
Brody10mo ago
is the deployment active?
badcom
badcom10mo ago
Yes. My application which is on the same project can access the DB
Brody
Brody10mo ago
try redploying the database
badcom
badcom10mo ago
Same thing =/
Brody
Brody10mo ago
send the deploy logs for mongo please https://bookmarklets.up.railway.app/log-downloader/
badcom
badcom10mo ago
Do I need to expose it somehow?
Brody
Brody10mo ago
is your app connecting to the database via its public url ?
badcom
badcom10mo ago
No. Via the private one
Brody
Brody10mo ago
do you have a tcp proxy on the database?
badcom
badcom10mo ago
Is this what you're referring to?
No description
Solution
Brody
Brody10mo ago
mongo listens on 27017 by default, not 27021
badcom
badcom10mo ago
Yes, that seemed to be the issue. I had to delete the service and recreate it as deleting the TCP proxy and recreating it with the right port wasn't working. Thanks for your help!
Want results from more Discord servers?
Add your server