R
Railway13mo ago
fvr1

New environment can't connect to database

my backend it's not connecting to the db in railway so the start fails, but locally it does… like from the cli I can run the migrations and it works. I also have an production env with the same code that I deployed last week and works perfectly, but now this other environment it's having issues 🤔
No description
No description
30 Replies
Percy
Percy13mo ago
Project ID: N/A
Brody
Brody13mo ago
can you show me a screenshot of your service variables?
fvr1
fvr1OP13mo ago
this is the backend
No description
fvr1
fvr1OP13mo ago
this is my Postgres service
No description
Brody
Brody13mo ago
are you using v2 databases? oh well that answers my question, a legacy database wouldn't have a raw editor can you try to add a 3 second sleep to the beginning of your start command / script?
fvr1
fvr1OP13mo ago
on the backend? yes! I'll let you know when the re-deploy finishes
Brody
Brody13mo ago
and just as a sanity check, mind sharing your new start command / script?
fvr1
fvr1OP13mo ago
Of course, I'm not sure if I did it correctly 😂
sleep 5 && medusa migrations run && medusa start
Brody
Brody13mo ago
that's a 5 second sleep, you'd only need 3 but obviously it would work be sure to use a healthcheck so that railway knows when your app has actually started https://docs.railway.app/deploy/healthchecks
fvr1
fvr1OP13mo ago
yes, just to make sure I'm still having the same issue, the postgres service its fine (I can see the data from the dashboard)
Brody
Brody13mo ago
can you show me how you are connecting to redis?
fvr1
fvr1OP13mo ago
at the moment it's a dummy connection, it's not really connecting jeje but it shouldnt be an issue bc on my production env it's the same "config" for redis
Brody
Brody13mo ago
can you expand the error starting server log? click the far left of that log line
fvr1
fvr1OP13mo ago
No description
No description
Brody
Brody13mo ago
do you not get the TypeError: (0 , modules_sdk_1.registerModules) is not a function locally? what version of node are you using locally? and can you send me the build logs?
fvr1
fvr1OP13mo ago
node v18.10.0
No description
fvr1
fvr1OP13mo ago
this is de devlop run mode
No description
Brody
Brody13mo ago
build logs please?
fvr1
fvr1OP13mo ago
ooo´ps
Brody
Brody13mo ago
did i already ask what node version you use locally?
fvr1
fvr1OP13mo ago
yes, node v18.10.0
Brody
Brody13mo ago
and railway is using node 18 as well gonna be honest, im stumped what version of medusa are you using?
fvr1
fvr1OP13mo ago
AHHHH BRODY YOU ARE A GENIUSSSSSS IT WAS THAAAT!!!!! THANK YOU SO MUCH THANKS THANKS THANKS
Brody
Brody13mo ago
bro I just googled the error lol
fvr1
fvr1OP13mo ago
hahahhaha I failed as a developer 😂 anyways, thank you so much for the help and the dedication!
Brody
Brody13mo ago
no problem 🙂
Want results from more Discord servers?
Add your server