npm error command sh -c node src/main.js - Container died - Cron JOB Railway

joao-edutecHOBBY

9 months ago

container event container died

npm error path /app

npm error command failed

npm error signal SIGTERM

npm error command sh -c node src/main.js

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-09T13_51_24_316Z-debug-0.log

8 Replies

9 months ago

You should not be using a CRON scheduler on a web server, Please remove the CRON schedule.


joao-edutecHOBBY

9 months ago

You should not be using a CRON scheduler on a web server, Please remove the CRON schedule.

I wasnt using it before, but my container died using Cron Jobs in nodejs (Croner lib). So I tried using Railway Cron, but it still dies.

joao-edutecHOBBY

9 months ago

Ok, I removed the Cron Schedule and web server but it still dies (I added the Cron - Croner - again)


9 months ago

May I ask why a web server is using CRON at all?


joao-edutecHOBBY

9 months ago

May I ask why a web server is using CRON at all?

The container was dying for some reason, so I thought it was the Cron Job from the Croner lib, so I removed it. I created a web server with an endpoint to perform the work I wanted, so I could configure another cron job service to hit this endpoint, but it didn't work and the container continued to die. So I put the railway's CRON Schedule on, but it kept dying.


9 months ago

I understand your container is dying but I'm failing to see how CRON comes into play for a web server?

Please help me to understand that aspect of your setup.


joao-edutecHOBBY

9 months ago

I understand your container is dying but I'm failing to see how CRON comes into play for a web server?

Please help me to understand that aspect of your setup.

I had forgotten to remove the web server when I added cron schedule... sorry


9 months ago

Very good information to know.

The title is watcher, watchers are typically long running processes, you wouldn't want to use this with a CRON either.

Please help me to understand what this service actually does.

As for the errors, your most recent deployment is green.