7 months ago
Hi team! I have a Bun project that can do exit with code 1 (or 0). And I want to restart a deployment in this case. I changed restart policy to “Always”, but I don’t think it restarts a deployment.
Is there a good way I/you can debug why its not working? Or even check if its not working at all or just flaky?
5 Replies
7 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!
7 months ago
Apologies but this looks like an issue with the application level code. Due to volume, we can only answer platform level issues.
I've made this thread public so that the community might be able to help with you query.
Status changed to Awaiting User Response Railway • 7 months ago
7 months ago
Hi @jake! Thank you for the response. I guess I will keep this thread open if someone else see this issue later with their projects.
I'm not sure that's an application code issue since I do just "process.exit(0)", so I will see if this will occur again
yashko
Hi @jake! Thank you for the response. I guess I will keep this thread open if someone else see this issue later with their projects.I'm not sure that's an application code issue since I do just "process.exit(0)", so I will see if this will occur again
7 months ago
The 0 passed as an argument in the exit code indicates a successful execution or no errors so may be that's why the restart doesn't happen.
Try non-zero values.
7 months ago
@smolpaw That's not quite right according to this documentation: https://docs.railway.com/guides/restart-policy .
>Always: Railway will automatically restart your service every time it stops, regardless of the reason.
I just had this happen one more time, my deployment had status "Completed" and not restarting. But my restart policy is set to "Always".
UPD:
Just tried it with another deployment by doing "process.exit(0)" on purpose and it seems to restart it as expected.
I wonder why its not working for my main deployment with same configuration and showing instance just as "completed" 
Attachments