Connect to MongoDB externally
joselvelez
PROOP

4 months 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

4 months ago

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


joselvelez
PROOP

4 months ago

Below

Attachments


joselvelez

Below

4 months ago

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


joselvelez
PROOP

4 months 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

4 months ago

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


joselvelez
PROOP

4 months 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 })

4 months ago

Did you change the password variable in the variables tab?


joselvelez
PROOP

4 months ago

no, im using the default


joselvelez

no, im using the default

4 months ago

Are you sure you properly copy pasted the MONGOPASSWORD variable?


joselvelez
PROOP

4 months 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.

4 months ago

Do you have data in this database?


joselvelez
PROOP

4 months ago

no, it is a fresh db.


joselvelez

no, it is a fresh db.

4 months ago

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


joselvelez
PROOP

4 months 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 4 months ago


Loading...