R
Railway•14mo ago
TehCheese

Railway having issues with Mongoose NPM package???

Locally my code works fine, I can connect to Mongo using Mongoose no issues but when on Railway it randomly started timing out instead of connecting!!
26 Replies
Percy
Percy•14mo ago
Project ID: N/A
TehCheese
TehCheese•14mo ago
n/a
Brody
Brody•14mo ago
would you happen to be using the private network?
TehCheese
TehCheese•14mo ago
I'm using a database hosted by MongoDB The connection URI and Mongoose work and connect fine running my code locally, but as soon as I try to use Railway it sends a timeout error And the network settings on the database let Railway connect so
Brody
Brody•14mo ago
that sounds like a no go into the service settings and disable private networking
TehCheese
TehCheese•14mo ago
Nevr was enabled
TehCheese
TehCheese•14mo ago
No description
Brody
Brody•14mo ago
okay thats one possible cause eliminated this database is hosted on railway correct?
TehCheese
TehCheese•14mo ago
no it's not
Brody
Brody•14mo ago
atlas?
TehCheese
TehCheese•14mo ago
Yes
Brody
Brody•14mo ago
have you whitelisted all ips in atlas?
TehCheese
TehCheese•14mo ago
Yes I believe it was a change in my code, cause I made some big changes and it stopped working I tried running older code and it worked fine I'm trying to understand what I need to change to fix it
Brody
Brody•14mo ago
ah then tbh theres not all that much i could do to help here, review your old comments and see what you have changed in your new comments that could effect it
TehCheese
TehCheese•14mo ago
uhugugughu thanks Knew there was prolly nothing you could do
Brody
Brody•14mo ago
yeah sorry 😦 its prob just a typo or something, youll get it soon im sure
TehCheese
TehCheese•14mo ago
It's weird, cause it works no issues locally but now has stopped working with railway
Brody
Brody•14mo ago
maybe you are using the wrong environment variable name when connection to the database?
TehCheese
TehCheese•14mo ago
I pasted the connection URI directly from my local machine into Railway's environment variables
Brody
Brody•14mo ago
show me the logs? maybe something will stick out to me
TehCheese
TehCheese•14mo ago
ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/app/node_modules/undici/lib/core/connect.js:182:24)
at /app/node_modules/undici/lib/core/connect.js:129:46
at Immediate._onImmediate (/app/node_modules/undici/lib/core/connect.js:170:9)
at processImmediate (node:internal/timers:466:21)
ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/app/node_modules/undici/lib/core/connect.js:182:24)
at /app/node_modules/undici/lib/core/connect.js:129:46
at Immediate._onImmediate (/app/node_modules/undici/lib/core/connect.js:170:9)
at processImmediate (node:internal/timers:466:21)
Idk it's just the standard mongoose timing out thing
Brody
Brody•14mo ago
did you update the mongose package?
TehCheese
TehCheese•14mo ago
I did, but I'm pretty sure it started before I updated it I'll try moving it back down to where it was when it was working Downgrading it didn't fix it AAAAA AAA A AA AA I hate HATE weird issues I definitely changed something in my code to stop it from working but I have absolutely no idea what and why did it only stop working with Railway
Brody
Brody•14mo ago
well railway is a whole different environment, docker, ubuntu, default node 16, nix os, etc. not everything will always just work like it does locally, thats not necessarily a platform problem, but just comes with deploying to cloud infrastructure
TehCheese
TehCheese•14mo ago
Well it used to work fine I have no clue why it stopped
Brody
Brody•14mo ago
me neither lol
Want results from more Discord servers?
Add your server