a month ago
Hey,
I have been getting deployment crashing emails for a cron job for several months. EverytimeI check nothing seems to be wrong.
I noticed another thread: https://station.railway.com/questions/getting-false-deploy-crashed-emails-d-f2823405
The suggestions in that thread are for a node app but I'm using bun. I also haven't anything meaning in this service in that time. I've attached a screenshot of the crash warning with the logs showing no errors.
Attachments
3 Replies
a month ago
Your cron job logs show the task completing successfully, but a "Crashed" status means the process exited with a non-zero exit code or was force-terminated due to open resources (like database connections) preventing a clean shutdown. Per our cron job docs, cron services must close all connections and exit cleanly after the task finishes, and explicitly exiting with code 0 (e.g., process.exit(0)) at the end of your script will ensure Railway recognizes the completion as successful rather than a crash.
Status changed to Awaiting User Response Railway • about 1 month ago
Railway
Your cron job logs show the task completing successfully, but a "Crashed" status means the process exited with a non-zero exit code or was force-terminated due to open resources (like database connections) preventing a clean shutdown. Per our [cron job docs](https://docs.railway.com/cron-jobs), cron services must close all connections and exit cleanly after the task finishes, and explicitly exiting with code 0 (e.g., `process.exit(0)`) at the end of your script will ensure Railway recognizes the completion as successful rather than a crash.
a month ago
This did not solve my problem, but I found a solution. I use Neon for DB as a service. It automatically scales down to zero when not in use. When I created a connection pool I had a timeout of about 2 seconds, which sometimes was not enough time to connect to the DB given, network latency and cold start times. I increased the connection timeout time.
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Glad you found it. Neon's scale-to-zero cold starts can definitely exceed a 2-second connection timeout, so increasing that makes sense.
Status changed to Awaiting User Response Railway • about 1 month ago
Status changed to Solved sam-a • about 1 month ago