Skip to content

Troubleshooting

  1. cronbeat check validates the key and shows where it came from. Run it as the same user that runs the job: cron and systemd do not see your shell’s environment.
  2. Run the job by hand with --verbose: cronbeat run --name my-job --schedule "0 2 * * *" --verbose -- /path/to/job.sh. It prints the steps (never the key) and every warning, which are otherwise shown once per kind every 6 hours.
  3. Look at the Agents page (Last run reported …) and at the ping history of the monitor.

Remember: whatever is wrong with CronBeat, the job itself ran and its exit code was not changed.

Message Cause and fix
no API key configured, the command runs without monitoring No key in the four places (see the API key). Cron has a minimal environment, so an export in your shell does not help. Run cronbeat configure as the user that owns the crontab, or put a CRONBEAT_API_KEY= line at the top of that user’s crontab.
key file ... has mode 0644, expected 0600 Run chmod 600 on the file. Files that group or others can read are refused on purpose. Secrets mounted by Docker or Kubernetes (often 0444) need chmod 0400 or the environment variable instead.
key file ... does not contain a valid API key The first line must be the key (starts with cb_agent_), no spaces.
CRONBEAT_API_KEY is not a valid API key The variable contains whitespace or control characters, for example a trailing newline copied with the key.
CronBeat rejected the API key (HTTP 401) The key is wrong, revoked or deleted. Check with cronbeat check, create a new key in the app if needed.
CronBeat refused this job (HTTP 403) Read the text after it. plan_limit_exceeded means the plan has no room for another monitor (“Monitor limit reached for your plan (N)”) or the host is outside the plan after a downgrade (“This host agent is outside your plan”). This key cannot be used for this endpoint means a Kubernetes agent key: create a Linux server (cron jobs) key. The job runs; only the monitoring is missing.
CronBeat rejected the report (HTTP 400) The data was invalid. The usual causes: no --schedule the first time a job is reported, a cron expression CronBeat cannot read, an unknown time zone, --grace over 7 days or --max-runtime over 24 hours.
CronBeat is rate limiting this host (HTTP 429) More than 600 requests per minute with this key, or 3000 per minute from this IP address. Every run is 2 requests, so this is more than 300 runs per minute: wrap fewer jobs per key or spread them.
CronBeat had a server error (HTTP 5xx) A problem on the CronBeat side. The result was retried up to 3 times; check the CronBeat status.
could not reach CronBeat (...) DNS, firewall, proxy (HTTPS_PROXY is used) or time out. Allow outbound HTTPS to api.cronbeat.dev.
could not reach CronBeat (... certificate ...) A minimal image without CA certificates (install the ca-certificates package), a clock that is far off, or a TLS inspecting proxy.
the API URL must use https CRONBEAT_API_URL or --api-url is a plain http URL. Only localhost, 127.0.0.1 and ::1 may use http.

The monitor is late or down but the job ran

Section titled “The monitor is late or down but the job ran”

A monitor goes late and then down when the event that would make it healthy did not arrive.

  • The result was lost. If the server could not reach CronBeat when the job ended, the succeeded event is gone and nothing is queued for later. The monitor shows running (if the started event arrived) and goes down at its deadline: too_long when a maximum runtime is set, otherwise missed (“started but never finished”). One missed report is enough. Fix the network, and the next run recovers the monitor.
  • Wrong time zone. The monitor judges the schedule in its time zone. Check the zone on the monitor against the server (timedatectl). Detection and what to pass are described in Time zones. A container without /etc/localtime is UTC.
  • Schedule and crontab disagree. The schedule on the monitor comes from --schedule. If you edited the crontab timing but not --schedule, the monitor still expects the old time. The crontab helper copies the schedule from the line, a hand written line needs both changed.
  • The grace period is too short. It is set when the monitor is created. Raise it in the app under the monitor’s settings; a changed --grace flag does not change an existing monitor.
  • A second job uses the same name. The name is the identity of the monitor. Two different jobs with one name overwrite each other’s schedule and results.
  • The key belongs to another project. The monitor appears in the project of the key, which may not be the one you are looking at.
  • A maintenance window or a paused monitor. See Maintenance windows. Covered and paused monitors are not judged.
  • The monitor is created by the first event, which needs --schedule. Without it the report is refused with HTTP 400 and the warning says so.
  • Your plan’s monitor limit is reached (HTTP 403 plan_limit_exceeded), see Plans and limits.
  • The job did not run yet. Run the wrapped line once by hand.
  • You deleted the monitor in the app: the next wrapped run with a schedule creates it again, as a new monitor. To stop monitoring a job permanently, remove cronbeat run from its line (or the line) and delete the monitor.
  • Deleting a cron line does not delete the monitor: it goes late, then down, because the job stopped reporting. Delete or pause the monitor too.

The installer used ~/.local/bin because /usr/local/bin was not writable, and that directory is not on your PATH. Add it permanently with echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && . ~/.bashrc (see Install), or install with sudo.

  • PATH. Cron’s PATH is usually /usr/bin:/bin. A command not found (exit 127) in cron usually means a relative command. Use absolute paths, both for cronbeat and for your command.
  • A different user. The root crontab, a user crontab and /etc/cron.d files run as different users and read different key files. Run cronbeat configure (or cronbeat check) as the user that runs the job.
  • No variables from your shell. export in your terminal is invisible to cron. Set variables in the crontab or the script. Variables set in the crontab (NAME=value) are passed on to your command. The only variable cronbeat takes away is CRONBEAT_API_KEY.
  • % in a crontab line is a newline to cron; escape it as \%. The crontab helper skips such lines.
  • MAILTO. Cron mails everything a job prints, including cronbeat: warning: ... lines (they go to stderr), to the owner or to MAILTO. Warnings are limited to one per kind every 6 hours. MAILTO="" turns cron mail off.
  • A job that redirects its own output to a file (> job.log 2>&1 in the line or inside the script) leaves nothing for cronbeat to capture, so a failure arrives without an output tail. Let the job write to stdout and stderr (or use tee) if you want the tail.
  • systemd needs %% for %, see systemd timers and Docker.
  • SELinux or other policies may stop cron from running a binary in a home directory. Install cronbeat to /usr/local/bin. Such setups were not tested for this documentation.
  • Time on the server. Keep NTP running; CronBeat measures deadlines with its own clock, but a server clock that is hours off makes your cron schedule fire at the wrong time.
  1. Remove the wrappers from your crontab. If you used the helper, restore the backup: cronbeat crontab undo (add --file /etc/cron.d/myapp --cron-d for a system file; --force if the crontab changed since). Otherwise delete cronbeat run --name ... --schedule ... -- from each line by hand.

  2. Remove systemd units or Docker entrypoints that call cronbeat.

  3. Delete the binary and the key file:

    Terminal window
    sudo rm /usr/local/bin/cronbeat # or ~/.local/bin/cronbeat
    sudo rm -f /etc/cronbeat/key # or ~/.config/cronbeat/key
    rm -rf ~/.cache/cronbeat ~/.local/state/cronbeat # warning state and crontab backups (optional)
  4. Revoke the key in the app under Agents (it stops working at once), and delete the host agent permanently if you want it gone from the list. Revoking frees the place in your plan.

  5. Delete or pause the monitors of the jobs you no longer want. They are not removed automatically: a job that no longer reports goes late, then down.

Collect the output of cronbeat version, cronbeat check and one run with --verbose (none of them contains the key) and use the support form.