R
Railway•9mo ago
CloudRendr

Deployments keep crashing

Hi I'm a new user of Railway, so perhaps the problem I'm experiencing is related to incorrect configuration. I'm deploying two golang services for a monorepo. But, deployments take a long time, and then when done, it crashes within a few minutes. I'm using custom build and run commands (go build server.go and run server.go), but this is about the only thing that is out of the ordinary. Is there any way to determine what may be the problem?
40 Replies
Percy
Percy•9mo ago
Project ID: N/A
Brody
Brody•9mo ago
there is an incident related to slow builds right now, check #🚨|incidents but those build and start commands are likely wrong, if you share your repo I could advise on the correct build and start commands
CloudRendr
CloudRendr•9mo ago
It is a private repo, but if there is away to share, please let me know.
Brody
Brody•9mo ago
add me to it?
CloudRendr
CloudRendr•9mo ago
On github itself? Your details?
Brody
Brody•9mo ago
brody192
CloudRendr
CloudRendr•9mo ago
I can send an email invite from Github. Need an email?
Brody
Brody•9mo ago
my username works the same way
CloudRendr
CloudRendr•9mo ago
Invite sent.
Brody
Brody•9mo ago
looking
CloudRendr
CloudRendr•9mo ago
The one service's code is under /automation/api and the other under automation/w-jobalert The API needs to run server.go (#1 above) and the workflow worker needs to run worker.go
Brody
Brody•9mo ago
for the api your build command should be go build automation/api/server.go and the start command should be ./server. the worker app will need another railway service, and that service will use the build command go build automation/w-jobalert/worker.go and the start command ./worker
CloudRendr
CloudRendr•9mo ago
Thanks. Will make the mods. Hi Brody Made the changes, but no joy yet. This time it fails to build within a few seconds.
Brody
Brody•9mo ago
you have misconfigured something else, i think it would be best for you to delete that service and make a new one
CloudRendr
CloudRendr•9mo ago
Is there a way a can share the configuration,because I cannot see what else could be wrong.
Brody
Brody•9mo ago
i think it would be best for you to delete that service and make a new one
CloudRendr
CloudRendr•9mo ago
Hi Brody I removed the service, started a clean one and did minimal config settings as per you input. Same problem.
Brody
Brody•9mo ago
build logs again please
Brody
Brody•9mo ago
something is being misconfigured, what have you changed besides the build and start commands i gave you?
CloudRendr
CloudRendr•9mo ago
The root directory: /automation/api
Brody
Brody•9mo ago
dont do that please
CloudRendr
CloudRendr•9mo ago
Ok, let me remove.
Brody
Brody•9mo ago
you have misconfigured something else, i think it would be best for you to delete that service and make a new one you only need to set the service variables your app needs, the build and start commands, and then attach your repo
CloudRendr
CloudRendr•9mo ago
Will do
Brody
Brody•9mo ago
oh also, not that it would effect the build, but dont log.Fatal on the error from godotenv, that will just crash loop your app
CloudRendr
CloudRendr•9mo ago
This time the build worked, but crashed after a few minutes.
Brody
Brody•9mo ago
^
CloudRendr
CloudRendr•9mo ago
Thanks, I made the tweak and pushed it again. Hi Brody Still crashing after the build. Cannot find /server
Brody
Brody•9mo ago
please see my build and start commands here
CloudRendr
CloudRendr•9mo ago
I missed that . in front of /server. But now it crashes because of missing .env.
Brody
Brody•9mo ago
^
CloudRendr
CloudRendr•9mo ago
Hi Brody I got everything running. Understanding the monorepo deployment scenario much better now. The last issue I'm having is not bein able to connect to API server. Is there a specific port I must use for the server?
Brody
Brody•9mo ago
see the go section at the bottom of the page https://docs.railway.app/guides/fixing-common-errors
CloudRendr
CloudRendr•9mo ago
Hi Brody Thanks for all the help, and patience. All sorted now.
Brody
Brody•9mo ago
happy to help! feel free to remove me from the repo!
Want results from more Discord servers?
Add your server