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