R
Railway10mo 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
Percy10mo ago
Project ID: a152df40-b98b-4053-afe7-e4c47c064cca
Brody
Brody10mo ago
before the minute or two, does it work?
Musa
MusaOP10mo ago
no it doesn't
Brody
Brody10mo ago
do you see any logs at all? of any kind
Musa
MusaOP10mo ago
just build logs no deploy logs
Brody
Brody10mo ago
Brody
Brody10mo ago
looks fine, share your repo please
Musa
MusaOP10mo ago
GitHub
GitHub - zachzafar/realestate-app
Contribute to zachzafar/realestate-app development by creating an account on GitHub.
Brody
Brody10mo ago
do you have APP_ENV set to PRODUCTION?
Musa
MusaOP10mo ago
yeah i do in railway
Brody
Brody10mo ago
you have your logger set to output to a file
Musa
MusaOP10mo ago
does writing to storage cause issues ?
Brody
Brody10mo ago
well no but how are you going to see deploy logs if you log to a file
Musa
MusaOP10mo 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
Brody10mo ago
you are using the file based logger for the fatal errors
Musa
MusaOP10mo ago
i'll make the change redeploy and see what i get thanks
Musa
MusaOP10mo ago
its working now I'm just waiting to see if the domain works
No description
Musa
MusaOP10mo ago
I used the wrong URL it seems from the postgres instance i used the private url instead of public
Brody
Brody10mo ago
nothing wrong with the private url
Musa
MusaOP10mo 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
Brody10mo ago
add a 3 second sleep in code before you do anything with the database
Musa
MusaOP10mo 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
Brody10mo ago
your code needs to listen on the environment variable PORT
Musa
MusaOP10mo ago
do i have to set that variable myself ? in the variables section
Brody
Brody10mo ago
nope its set for you, your code just needs to listen on it
Musa
MusaOP10mo ago
its working thanks Bro...dy
Brody
Brody10mo ago
no problem
Want results from more Discord servers?
Add your server