A heartbeat job reported a failure
Your job told DownBad it failed. DownBad doesn’t know why: only the job does. This page helps you find the failure in the job, and confirm the heartbeat goes back to Up once it’s fixed.
What you’re seeing
Section titled “What you’re seeing”The heartbeat shows Down, its last ping is marked reported a failure, and DownBad opened an incident with this reason:
Your job reported a failureIt means the job sent a request to its ping URL with /fail on the end. The
snippets DownBad gives you send /fail when the job exits with an error, so
this is almost always the job’s own failure, not DownBad’s.
Is it you or us?
Section titled “Is it you or us?”It’s the job. DownBad only records a /fail ping when one arrives, and only
your job, or someone with the ping URL, can send one. To rule out a stray
ping, check the job’s log for a run at the time the incident opened.
Check it yourself
Section titled “Check it yourself”Read the log of the run that failed. Where it is depends on where the job runs:
- Shell / cron: wherever the cron line sends the job’s output. With no redirect, cron mails it to the user that owns the crontab.
- systemd: run
journalctl -u your-job.service -n 50on the machine, which shows the last 50 lines the service wrote. - Kubernetes CronJob: run
kubectl get jobsto find the job that ran, thenkubectl logs job/<job name>. - GitHub Actions: open the run on the repository’s Actions tab. The step that failed is marked with a red cross.
- WP-Cron: your site’s PHP error log. The snippet rethrows the error after
it pings
/fail, so it’s logged as usual.
Without a terminal: GitHub Actions shows its logs in the browser. For the others, your hosting provider’s dashboard often shows the logs of scheduled tasks.
Fix it
Section titled “Fix it”The causes below run from most to least likely, so start with the first.
The job itself failed
Section titled “The job itself failed”The log shows an error from the job: a backup target that’s full, a database that refused the connection, an expired credential.
-
Fix the error the log names.
-
Run the job by hand and check it finishes without one.
The job’s environment is different when it runs on schedule
Section titled “The job’s environment is different when it runs on schedule”The job works when you run it by hand but fails on schedule. Schedulers run
jobs with a short PATH, as another user, in another directory, and without
the variables your login shell sets.
-
Use full paths for every program and file the job uses.
-
Set the variables the job needs in the scheduler itself: in the crontab, the systemd unit’s
Environment=line, the CronJob’senv, or the workflow’senv.
Something besides the job sends /fail
Section titled “Something besides the job sends /fail”The job’s log shows a run that succeeded at the time the incident opened, yet
DownBad recorded /fail. Another script or machine has the ping URL.
-
Search your scripts, crontabs and workflows for the ping URL.
-
If you can’t find it, replace the URL: open the heartbeat, press Regenerate, and put the new URL in the job. The old URL stops working at once.
Confirm DownBad sees the fix
Section titled “Confirm DownBad sees the fix”-
Fix the cause first.
-
Run the job by hand, or wait for its next scheduled run.
-
Wait up to 30 seconds. When the run succeeds and pings, the heartbeat’s page shows Up and the incident closes. One successful ping is enough.
If the job pings nothing at all after the fix, the heartbeat goes Late instead: see A heartbeat ping didn’t arrive.
Still stuck
Section titled “Still stuck”Before you ask for help, collect:
- the link to the heartbeat or its incident, and the reason it shows, word for word
- the lines from the job’s log for the run that failed
- the scheduler’s entry for the job, such as the cron line or the workflow file, with the ping URL taken out
Then send all of it to us through Contact Us.