R
Railway•15mo 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•15mo ago
Project ID: N/A
TehCheese
TehCheeseOP•15mo ago
n/a
Brody
Brody•15mo ago
would you happen to be using the private network?
TehCheese
TehCheeseOP•15mo 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•15mo ago
that sounds like a no go into the service settings and disable private networking
TehCheese
TehCheeseOP•15mo ago
Nevr was enabled
TehCheese
TehCheeseOP•15mo ago
No description
Brody
Brody•15mo ago
okay thats one possible cause eliminated this database is hosted on railway correct?
TehCheese
TehCheeseOP•15mo ago
no it's not
Brody
Brody•15mo ago
atlas?
TehCheese
TehCheeseOP•15mo ago
Yes
Brody
Brody•15mo ago
have you whitelisted all ips in atlas?
TehCheese
TehCheeseOP•15mo 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•15mo 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
TehCheeseOP•15mo ago
uhugugughu thanks Knew there was prolly nothing you could do
Brody
Brody•15mo ago
yeah sorry 😦 its prob just a typo or something, youll get it soon im sure
TehCheese
TehCheeseOP•15mo ago
It's weird, cause it works no issues locally but now has stopped working with railway
Brody
Brody•15mo ago
maybe you are using the wrong environment variable name when connection to the database?
TehCheese
TehCheeseOP•15mo ago
I pasted the connection URI directly from my local machine into Railway's environment variables
Brody
Brody•15mo ago
show me the logs? maybe something will stick out to me
TehCheese
TehCheeseOP•15mo 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•15mo ago
did you update the mongose package?
TehCheese
TehCheeseOP•15mo 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•15mo 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
TehCheeseOP•15mo ago
Well it used to work fine I have no clue why it stopped
Brody
Brody•15mo ago
me neither lol
Want results from more Discord servers?
Add your server