R
Railway•10mo 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•10mo ago
Project ID: N/A
Brody
Brody•10mo 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
CloudRendrOP•10mo ago
It is a private repo, but if there is away to share, please let me know.
Brody
Brody•10mo ago
add me to it?
CloudRendr
CloudRendrOP•10mo ago
On github itself? Your details?
Brody
Brody•10mo ago
brody192
CloudRendr
CloudRendrOP•10mo ago
I can send an email invite from Github. Need an email?
Brody
Brody•10mo ago
my username works the same way
CloudRendr
CloudRendrOP•10mo ago
Invite sent.
Brody
Brody•10mo ago
looking
CloudRendr
CloudRendrOP•10mo 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•10mo 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
CloudRendrOP•10mo 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•10mo ago
you have misconfigured something else, i think it would be best for you to delete that service and make a new one
CloudRendr
CloudRendrOP•10mo ago
Is there a way a can share the configuration,because I cannot see what else could be wrong.
Brody
Brody•10mo ago
i think it would be best for you to delete that service and make a new one
CloudRendr
CloudRendrOP•10mo ago
Hi Brody I removed the service, started a clean one and did minimal config settings as per you input. Same problem.
Brody
Brody•10mo ago
build logs again please
Brody
Brody•10mo ago
something is being misconfigured, what have you changed besides the build and start commands i gave you?
CloudRendr
CloudRendrOP•10mo ago
The root directory: /automation/api
Brody
Brody•10mo ago
dont do that please
CloudRendr
CloudRendrOP•10mo ago
Ok, let me remove.
Brody
Brody•10mo 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
CloudRendrOP•10mo ago
Will do
Brody
Brody•10mo 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
CloudRendrOP•10mo ago
This time the build worked, but crashed after a few minutes.
Brody
Brody•10mo ago
^
CloudRendr
CloudRendrOP•10mo ago
Thanks, I made the tweak and pushed it again. Hi Brody Still crashing after the build. Cannot find /server
Brody
Brody•10mo ago
please see my build and start commands here
CloudRendr
CloudRendrOP•10mo ago
I missed that . in front of /server. But now it crashes because of missing .env.
Brody
Brody•10mo ago
^
CloudRendr
CloudRendrOP•10mo 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•10mo ago
see the go section at the bottom of the page https://docs.railway.app/guides/fixing-common-errors
CloudRendr
CloudRendrOP•10mo ago
Hi Brody Thanks for all the help, and patience. All sorted now.
Brody
Brody•10mo ago
happy to help! feel free to remove me from the repo!
Want results from more Discord servers?
Add your server