Render cron job not running? Find the cause and get alerted
A Render cron job that stops doing its work does not email you. You find out when the data it was meant to produce is missing. Here is how to find the cause and get an alert on the next missed run.
Updated
Short answer
Render schedules cron jobs in UTC, allows only one run at a time, and stops a run after 12 hours. A command that never exits blocks every later run. Check the Runs page, then add a heartbeat ping to the end of the command and alert when it stops arriving.
Monitor your Render cron jobs freeWhy a Render cron job stops running
A Render cron job service runs your command on a cron schedule. Most "not running" reports come from one of the behaviours below, all taken from the Render cron job docs.
| Cause | How to check | Fix |
|---|---|---|
| Schedule is in UTC | The job fires at an unexpected hour | Render uses UTC for all days and times. Convert your local time, and check the expression in a cron generator |
| Command never exits | The latest run on the Runs page is still going | Render delays the next scheduled run until the active run finishes, so one hung run holds back all later runs. Use a command that exits when it is done |
| Run hit the 12-hour limit | A run ended after 12 hours | Render stops an active run after 12 hours. Split the work, or use a workflow or background worker for long tasks |
| Manual run cancelled a run | You clicked Trigger Run while a run was active | Render cancels the active run, then starts the manual one. Wait for the active run to finish |
| Build did not change the run you expected | You pushed code while a run was in progress | A new build affects only future runs, not runs already in progress |
| Wrong command | The command fails when you run it yourself | The command can be any valid Linux command or an executable bash script. For a Docker job, Render runs the image ENTRYPOINT and CMD unless you set a Docker Command under Advanced |
Render guarantees that at most one run of a cron job is active at a time. A run that comes due during an active run is delayed, not dropped. From the outside that looks like a job that stopped running, because nothing new starts until the stuck run ends.
Check the Runs page
- Open the cron job in the Render dashboard and go to the Runs page. It lists the run history and the logs for each run.
- Look at the latest run. If it is still active long after it should have finished, the command is hanging.
- Open that run's logs for the last line it printed. A stuck run usually stops at an open database connection, an unresolved promise or a network call without a timeout.
- Click Trigger Run to start a run by hand, for example to debug. Only do this when no run is active, since it cancels one that is.
- Check the Builds page if the job runs old code. Builds only affect future runs.
The Runs page only helps once you think to open it. Render does not tell you when a run hangs.
Add a heartbeat to the command
A heartbeat monitor expects a request to a unique URL on a schedule. Send it as the last step of the job, and you get an alert when it does not arrive. A delayed run, a hung run, a crash and a stopped schedule all end the same way: no ping arrives.
Render accepts an executable bash script as the Command, so put the job and the ping in one. set -euo pipefail stops the script at the first failed step, before the ping. Make the file executable with chmod +x and set the Command to ./scripts/nightly.sh.
#!/bin/bash
set -euo pipefail
node dist/sync.js
node dist/cleanup.js
curl -fsS -m 10 --retry 3 https://heartbeat.uptimeio.com/heartbeat/YOUR_HEARTBEAT_TOKEN > /dev/nullYou can also ping from code. This works well when the job already runs in Node and you want the ping to depend on the work finishing.
async function main(): Promise<void> {
await syncData();
// Only reached when syncData() did not throw.
await fetch(process.env.HEARTBEAT_URL!, { signal: AbortSignal.timeout(10_000) });
}
main().then(
() => process.exit(0),
(error) => {
console.error('job failed', error);
process.exit(1);
},
);Store the heartbeat URL as an environment variable on the cron job service. It works like a password, so keep it out of the repository.
Set it up in UptimeIO
- Create a monitor and choose the Heartbeat type.
- Set the interval to match the Render schedule, and a grace period longer than your slowest run, because the ping is sent when the job ends.
- Copy the heartbeat URL into the cron job's command or an environment variable.
- Choose where alerts go: email, Slack, Telegram, Pushover or a webhook.
- Plans: heartbeat monitors are on every plan, including Free. The shortest interval is 5 minutes on Free and 1 minute on Pro and Scale.
- Intervals: 1 minute to 24 hours, with a grace period of 1 second to 1 hour.
- Incidents: an incident opens when a ping is late, and resolves after 3 on-time pings in a row.
Questions
- Why is my Render cron job not running?
- The most common reasons are a UTC schedule that differs from your local time, or a previous run that never exited. Render allows one run at a time and delays the next scheduled run until the active one finishes. Check the Runs page for a run that is still active.
- Does Render skip a cron run if the previous one is still going?
- According to the Render docs it delays the next run until the active run finishes, rather than skipping it. A run that hangs therefore holds back every later run until it ends or reaches the 12-hour limit.
- How long can a Render cron job run?
- Render stops an active run after 12 hours. For longer or continuous work, the Render docs recommend a workflow or a background worker.
- How do I get an alert when a Render cron job fails?
- The Render cron job docs do not describe failure notifications. Add a request to a heartbeat URL at the end of the command, joined with &&, so it is sent only on success, and alert when it does not arrive.
- What time zone do Render cron jobs use?
- UTC. Render states that all day and time ranges use UTC, so convert from your local time when you write the schedule.
Related
- Cron job monitoring - How UptimeIO heartbeat monitoring works and which plans include it.
- Heartbeat monitoring docs - Settings, ping examples, metadata, and rate limits.
- Railway cron job not running - Causes and heartbeat setup for Railway cron services.
- Cron job not running - General causes and the heartbeat pattern for any cron job.