#mongodb

31 messages · Page 1 of 1 (latest)

somber phoenix
#

Can't connect to mongodb using connect URL. It times out.

#

MongooseServerSelectionError: connection timed out

hidden spruce
#

.

somber phoenix
#

@hidden spruce mongodb://mongo:[code]@containers-us-west-91.railway.app:[morecode]

#

mongoose.connect('mongodb://mongo:[code]@containers-us-west-91.railway.app:[morecode]', {
useNewUrlParser: true,

})
const db = mongoose.connection
db.on('error', error => console.error(error))
db.once('open', () => console.log("Connected to mongoose"))

#

MongoNetworkError: failed to connect to server [containers-us-west-91.railway.app:27017] on first connect [MongoNetworkTimeoutError: connection timed out

#

it's actually giving failed to connect error

#

@thorn rivet

hidden spruce
#

Does using that URL locally work?

somber phoenix
#

@hidden spruce nope

hidden spruce
#

Not sure then sorry. Not used mongo. Altho whever connection issues come up here it's usually the users code so maybe Google around for mongo stuffs

somber phoenix
#

Yeah Im trying. Thanks tho

somber phoenix
#

@hidden spruce is it possible that I need to whitelist my IP?

hidden spruce
#

Nope

#

Not used mongo on railway but Ive never heard anything like this

#

Have you tried deploying the service on railway?

somber phoenix
#

Yeah but I don't wanna use up more free resources

#

ok wait it works locally now

#

It seems there was a typo in the url

#

im so stupid 😣

#

but it's still not working on heroku

hidden spruce
#

😆 rip
Time to ditch heroku

somber phoenix
#

yeah I guess xD

hidden spruce
#

Sounds good

somber phoenix
#

hey I just deployed on railway

#

how do I see the url of my app

#

lol sorry if that's dumb

#

ok got it I had to generate a domain

#

THANKS a lot dude you really helped

hidden spruce
#

I'm not sure I did. But your welcome lol 👍