2 months ago
A Railway service which contains a Laravel app stuck in the "complete" state after deploy.
It's green, but never goes "Online". I noticed in the Build logs it is locked on the "image push" task (see image attached).
If I try to access the public URL I get a 502 HTTP error.
Attachments
Pinned Solution
2 months ago
I found the problem following the documentation for Laravel deployment (https://docs.railway.com/guides/laravel). The initial script after every deployment must run as pre-deploy command for the http service and as start command for cron and queue worker services. I had configured the script as start command for all. Moving the script from start command to pre-deploy command in app service solved the problem.
8 Replies
2 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
2 months ago
There are no solutions in these posts other than retry later.
2 months ago
Even after several retry, the service still stuck in "complete" status, and the public URL returns a 502 HTTP error. I have other 2 services with the same application code, one for the cron scheduler, and another for the workers, and they are correctly Online.
In Build Logs, the "image push" task still running indefinitely (see the image attached in the first message of this thread).
2 months ago
Could I get a link to the service thats stuck? All appear online at an initial glance.
Status changed to Awaiting User Response Railway • 2 months ago
noahd
Could I get a link to the service thats stuck? All appear online at an initial glance.
2 months ago
And also this
They are two app services in two different projects, same status, same 502 error
Status changed to Awaiting Railway Response Railway • 2 months ago
2 months ago
The image push finished, and your app started without issue. It's just a rounding error for the progress and us not switching from a spinner to a check, purely a UI quirk.
Completed means your app has exited. It wouldn't be a problem with our platform or product, so I have opened this thread up to the community so they can help you debug why your application may be exiting.
2 months ago
Yeah as brody said, I've only ever seen the completed status when a job exits with a exit code of 0 (success). Basically means that your services process just finished running and closed.
I'm not familiar with laravel so can't help too much there but are you able to start the apps in production mode with the same configuration on localhost?
Seems like the app is building and then the deploy step exits immediately. I would start by checking if your start command matches what you would expect
2 months ago
I found the problem following the documentation for Laravel deployment (https://docs.railway.com/guides/laravel). The initial script after every deployment must run as pre-deploy command for the http service and as start command for cron and queue worker services. I had configured the script as start command for all. Moving the script from start command to pre-deploy command in app service solved the problem.
Status changed to Solved brody • 2 months ago
