Connect to MongoDB externally
joselvelez
PROOP

a month ago

I am trying to connect to my MongoDB service externally but every time I run

npx prisma db push

i get this error:

Error: MongoDB error
Kind: Server selection timeout: No available servers. Topology: { Type: Unknown, Servers: [ { Address: yamanote.proxy.rlwy.net:41075, Type: Unknown, Error: Kind: I/O error: Connection reset by peer (os error 54), labels: {}, source: None } ] }, labels: {}, source: None

is there a guide/tutorial on getting MongoDB setup on railway? i want to move my instance over from digital ocean, but this is too confusing. if i cant figure it out, i'll just leave it on DO.

Solved$10 Bounty

14 Replies

Can you screenshot the public networking part of your mongoDB service?


joselvelez
PROOP

a month ago

Below

Attachments


joselvelez

Below

Please create a TCP proxy that points to port 27017, and use the information that it gives you for that.


joselvelez
PROOP

a month ago

i have this now

When I use the copy button, i get this: caboose.proxy.rlwy.net:11514

When I try this on my local machine, it fails still:

MONGODB_URL=mongodb://mongo:<password_removed>@caboose.proxy.rlwy.net:11514/gridlv1?tls=true&authSource=admin

Attachments


joselvelez

i have this nowWhen I use the copy button, i get this: caboose.proxy.rlwy.net:11514When I try this on my local machine, it fails still:MONGODB_URL=mongodb://mongo:<password_removed>@caboose.proxy.rlwy.net:11514/gridlv1?tls=true&authSource=admin

Can you please remove ?tls=true&authSource=admin from the end.


joselvelez
PROOP

a month ago

I did that and got this error:

Error: MongoDB error

Kind: SCRAM failure: Authentication failed., labels: {}, source: Some(Error { kind: Command(CommandError { code: 18, code_name: "AuthenticationFailed", message: "Authentication failed.", topology_version: None }), labels: {}, wire_version: None, source: None })


joselvelez

I did that and got this error:Error: MongoDB errorKind: SCRAM failure: Authentication failed., labels: {}, source: Some(Error { kind: Command(CommandError { code: 18, code_name: "AuthenticationFailed", message: "Authentication failed.", topology_version: None }), labels: {}, wire_version: None, source: None })

Did you change the password variable in the variables tab?


joselvelez
PROOP

a month ago

no, im using the default


joselvelez

no, im using the default

Are you sure you properly copy pasted the MONGOPASSWORD variable?


joselvelez
PROOP

a month ago

yes, i just copy + pasted it again to be sure. still not working.


joselvelez

yes, i just copy + pasted it again to be sure. still not working.

Do you have data in this database?


joselvelez
PROOP

a month ago

no, it is a fresh db.


joselvelez

no, it is a fresh db.

Can you please try wiping the volume, redeploying, and then connecting again?


joselvelez
PROOP

a month ago

i gave up. i'll stay on digital ocean. this was too confusing and taking too long to get working. you can close this. thx.


Status changed to Solved samgordon 27 days ago


Loading...