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 🤔
30 Replies
Project ID:
N/A
can you show me a screenshot of your service variables?
this is the backend
this is my Postgres service
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?
on the backend? yes!
I'll let you know when the re-deploy finishes
and just as a sanity check, mind sharing your new start command / script?
Of course, I'm not sure if I did it correctly 😂
sleep 5 && medusa migrations run && medusa start
sleep 5 && medusa migrations run && medusa start
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
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)
can you show me how you are connecting to redis?
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
can you expand the error starting server log?
click the far left of that log line
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?node v18.10.0
this is de devlop run mode
build logs please?
ooo´ps
did i already ask what node version you use locally?
yes, node v18.10.0
and railway is using node 18 as well
gonna be honest, im stumped
what version of medusa are you using?
AHHHH BRODY YOU ARE A GENIUSSSSSS
IT WAS THAAAT!!!!! THANK YOU SO MUCH
THANKS THANKS THANKS
bro I just googled the error lol
hahahhaha I failed as a developer 😂
anyways, thank you so much for the help and the dedication!
no problem 🙂