R
Railway9mo ago
Musa

Project deploys successfully then crashes after a minute or 2

Project-id:a152df40-b98b-4053-afe7-e4c47c064cca My Golang application builds and deploys successfully but then suddenly crashes. I don't see any log messages
28 Replies
Percy
Percy9mo ago
Project ID: a152df40-b98b-4053-afe7-e4c47c064cca
Brody
Brody9mo ago
before the minute or two, does it work?
Musa
MusaOP9mo ago
no it doesn't
Brody
Brody9mo ago
do you see any logs at all? of any kind
Musa
MusaOP9mo ago
just build logs no deploy logs
Brody
Brody9mo ago
looks fine, share your repo please
Musa
MusaOP9mo ago
GitHub
GitHub - zachzafar/realestate-app
Contribute to zachzafar/realestate-app development by creating an account on GitHub.
Brody
Brody9mo ago
do you have APP_ENV set to PRODUCTION?
Musa
MusaOP9mo ago
yeah i do in railway
Brody
Brody9mo ago
you have your logger set to output to a file
Musa
MusaOP9mo ago
does writing to storage cause issues ?
Brody
Brody9mo ago
well no but how are you going to see deploy logs if you log to a file
Musa
MusaOP9mo ago
but even if i didn't usually i think if there was a fatal error I would see something in the terminal like exit status 1or something like that
Brody
Brody9mo ago
you are using the file based logger for the fatal errors
Musa
MusaOP9mo ago
i'll make the change redeploy and see what i get thanks
Musa
MusaOP9mo ago
its working now I'm just waiting to see if the domain works
No description
Musa
MusaOP9mo ago
I used the wrong URL it seems from the postgres instance i used the private url instead of public
Brody
Brody9mo ago
nothing wrong with the private url
Musa
MusaOP9mo ago
lool i don't know then ill send the log message now dial tcp: lookup postgres.railway.internal on 8.8.8.8:53: no such host
Brody
Brody9mo ago
add a 3 second sleep in code before you do anything with the database
Musa
MusaOP9mo ago
it worked with the public url though I'll try it right now the only thing is that the domain isn't working
Brody
Brody9mo ago
your code needs to listen on the environment variable PORT
Musa
MusaOP9mo ago
do i have to set that variable myself ? in the variables section
Brody
Brody9mo ago
nope its set for you, your code just needs to listen on it
Musa
MusaOP9mo ago
its working thanks Bro...dy
Brody
Brody9mo ago
no problem
Want results from more Discord servers?
Add your server