25 days ago
I have a cron job that starts a Node.js process. This process connects to a PostgreSQL database using connection pools, performs some queries, and then closes the pool before calling process.exit(0). However, the dashboard indicates that the process is still running.
1 Replies
23 days ago
This looks like an application-level issue which is beyond the scope of what we directly support, but I can point you in the right direction.
This typically happens when your Node.js app is started via a package manager (npm, yarn, pnpm) rather than directly. When you use npm run start, the package manager becomes the main process and intercepts exit signals, so process.exit(0) doesn't terminate the container as expected.
The fix is to change your start command in your service's Settings > Deploy section from something like npm run start to node index.js (or whatever your entry file is). This ensures Node is PID 1 and can exit cleanly.
Status changed to Awaiting User Response Railway • 23 days ago
16 days ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 16 days ago