CronNudge

Published October 21, 2026

How to Monitor Sidekiq Cron and Rails Jobs

A Rails scheduler's job is to enqueue work. A worker's job is to finish perform. If the scheduler process is down, Redis lost the cron rows, the queue is backed up, or the job is retrying an exception it already swallowed in the logs, the web process still returns 200. Nothing outside the app tells you the run never finished.

This is that gap for sidekiq-cron, sidekiq-scheduler, Sidekiq Enterprise periodic jobs, GoodJob cron, Solid Queue recurring tasks, and the whenever gem. The ping goes at the end of perform, after the work succeeds. Behavior below is from those projects' docs as of October 2026. Where a gem's option differs by version, the snippet stays on the part they share.

The same shape on Python is Celery beat. Laravel's schedule:run loop is the Laravel scheduler guide. When that loop is the thing that stopped, the checks are in Laravel scheduler not running.

Schedulers enqueue. Workers run perform

sidekiq-cron, sidekiq-scheduler, and Sidekiq Enterprise periodic jobs do not run the job body. They push a Sidekiq job. GoodJob cron and Solid Queue recurring tasks enqueue an Active Job. whenever does not run anything itself. It writes a crontab, and cron runs whatever that line says.

A healthy scheduler with zero workers fills a queue and still looks idle in the product. A ping inside the scheduler, at enqueue time, stays green while perform never starts. Put the ping at the end of the body.

The scheduler process is down

sidekiq-cron

The poller starts in the Sidekiq server process. A formation that only runs Puma never enqueues. On a platform that scales process types separately, a worker count of zero is the same failure: the web app is up, and the cron file is sitting unread.

Jobs are stored in Redis. Load them when Sidekiq boots so a restart puts the file back:

# config/initializers/sidekiq.rb
schedule_file = Rails.root.join("config/schedule.yml")
if File.exist?(schedule_file) && Sidekiq.server?
  Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
end
# config/schedule.yml
nightly_export:
  cron: "17 3 * * *"
  class: "NightlyExportJob"
  queue: default

Several Sidekiq processes can be running. Read that version's readme before you assume a second process will or will not enqueue a second copy. Zero Sidekiq processes enqueue nothing, and that is the miss this ping is for.

sidekiq-scheduler

The schedule lives under :scheduler: in the Sidekiq config, and the gem stores that schedule in Redis for the web UI. Cron-style entries are pushed once across hosts under normal conditions. every, interval, and in entries are pushed once per host. Their own multiple-host note says to run a single scheduler process when you do not want one copy per machine.

A second Sidekiq process that boots with an empty schedule can overwrite the Redis copy. Disable the scheduler on every process that should not own it:

:scheduler:
  :enabled: false

The cron string is rufus-scheduler's. Six fields start with seconds: 0 * * * * * is every minute at second 0, not "minute, hour, and then a spare star". A timezone can sit on the end, as in 0 * * * * * America/Los_Angeles. Copy the minute, hour, day, month, and weekday onto the check, and drop the seconds field. Put the timezone name on the check.

Sidekiq Enterprise periodic jobs

Register the schedule in Sidekiq.configure_server. Only the leader enqueues, so one process and a hundred processes do not create a hundred copies. The schedule is the leader's code. A new deploy does not replace it until a process with the new code becomes leader. There is no backfill: a shutdown does not enqueue the ticks that were missed. A quiet leader still enqueues until shutdown is signaled.

Sidekiq.configure_server do |config|
  config.periodic do |mgr|
    mgr.register(
      "17 3 * * *",
      "NightlyExportJob",
      tz: ActiveSupport::TimeZone.new("America/New_York"),
    )
  end
end

With no tz:, the cron uses the Ruby process zone, which defaults to the machine zone. mgr.tz = sets the zone for jobs registered after that line. tz: is an ActiveSupport::TimeZone, and it is not copied into the job payload. perform should take no required arguments, or you pass static args at register time. From Sidekiq 7.1.0 the class may be an Active Job.

If every Sidekiq process is down, nothing is enqueued. Leader election uses Redis. A flushed Redis does not delete the registration in your initializer. It can delay the next enqueue until some process is leader again.

GoodJob

config.good_job.enable_cron defaults to false. Set it on a GoodJob process that is actually running, either the CLI or :async mode inside a process you meant to keep up. Enabling cron on several processes does not enqueue duplicates. GoodJob uses a unique index so one interval produces one job, and it has to keep those cron rows to do that. Zero processes with cron enabled enqueue nothing.

# config/environments/production.rb
config.good_job.enable_cron = true
config.good_job.cron = {
  nightly_export: {
    cron: "17 3 * * *",
    class: "NightlyExportJob",
  },
}

Fugit parses the string. It also accepts natural language and a six-field form that starts with seconds. A six-field string is not the five fields to paste into the check. A timezone name at the end (17 3 * * * America/New_York) pins the zone. Without one, Fugit uses the Rails time zone.

The dashboard can disable a key. enabled_by_default can leave a task off outside production. cron_graceful_restart_period is how long, after a restart, GoodJob tries to enqueue ticks that were due during the boot. It is not an alert.

Solid Queue

Recurring tasks are config/recurring.yml. The scheduler process reads that file. Rails 8's default config/puma.rb loads the Solid Queue plugin only when SOLID_QUEUE_IN_PUMA is set. The other way to run it is bin/jobs. A web process with neither one serves requests and never enqueues the file. SOLID_QUEUE_SKIP_RECURRING=true, or bin/jobs --skip-recurring, turns recurring tasks off while workers still run.

# config/recurring.yml
production:
  nightly_export:
    class: NightlyExportJob
    schedule: "17 3 * * * America/New_York"

Fugit parses schedule. A zone on the string wins. Otherwise Solid Queue uses config.time_zone. config.solid_queue.time_zone overrides that default, and setting it to nil falls back to the machine's local time. class enqueues that job. command is eval'd inside a recurring job on the solid_queue_recurring queue. Either way, the ping belongs at the end of the work, not in the YAML.

whenever

whenever writes crontab lines from config/schedule.rb. It does not execute them. The machine needs a cron daemon, and the deploy has to run whenever --update-crontab or the lines never land. A container image without cron, or a release phase that stopped calling whenever, looks the same from the outside as a deleted schedule. The crontab not running checks apply to the file whenever wrote.

# config/schedule.rb
env :TZ, "America/New_York"

every 1.day, at: "3:17 am" do
  runner "NightlyExportJob.perform_now"
end

at: becomes an hour and minute in that crontab. The zone is the crontab environment (TZ above), not Rails config.time_zone, unless you set them to the same value. Cron in a zone that observes daylight saving can skip the missing spring hour and repeat the autumn hour. UTC does not shift. Compare the five fields on the cron tool before you trust a 2am line.

Redis, deploys, and a schedule that disappeared

sidekiq-cron and sidekiq-scheduler keep the schedule in Redis. FLUSHDB, a new empty instance, or a restore that did not include those keys removes it. sidekiq-cron jobs come back when a Sidekiq process loads the YAML again. Jobs that existed only because someone created them in the web UI, with no file to reload, stay gone. A sidekiq-scheduler process that boots without :scheduler: :enabled: false can replace a good Redis schedule with an empty one.

Enterprise periodic jobs, GoodJob's cron hash, and config/recurring.yml are code. A deploy that deletes the register call, the hash key, or the YAML key stops future enqueues and raises nothing. Enterprise keeps using the leader's old code until leadership moves. Solid Queue picks up the file when the scheduler process reloads it.

whenever's crontab is whatever the last whenever --update-crontab wrote. A rollback of the app image does not roll the crontab back unless that command runs again.

GoodJob and Solid Queue store jobs in Postgres. A Redis flush does not remove them. A Postgres you cannot connect to does: the scheduler cannot enqueue, and the workers cannot perform.

The job is queued, retrying, or swallowed

The scheduler is finished when the job is on the queue. A worker started without that queue, a process scaled to zero, or a queue buried under a backlog never reaches perform. The success ping never runs. sidekiq-scheduler's :listened_queues_only defaults to false, so it can push a job onto a queue nobody is consuming.

Sidekiq retries a raised error. The default is a long series of attempts, and the job looks busy rather than failed until those attempts are exhausted. Active Job retry_on does the same for GoodJob and Solid Queue. Solid Queue does not add a second retry layer of its own. GoodJob's retry_on_unhandled_error is a separate switch and defaults to false. The GoodJob readme warns that turning it on can retry an unhandled error without a limit.

A body that rescues, logs, and returns is a success to the worker. The next tick is enqueued on time. The log line is the only record. Re-raise, or call /fail, when the work did not happen.

Ping after perform succeeds

Call https://cronnudge.com/ping/<check-id> after the work returns. GET, POST, and HEAD all count. The response is text/plain ok with Cache-Control: no-store. The ping id is not the badge id.

Net::HTTP is in the standard library. Timeouts raise. A non-2xx response does not, unless you add that check yourself. Five seconds keeps a dead network from holding the worker. Rescue StandardError so a monitoring failure cannot fail the job. Leave Exception alone so a real shutdown still stops the process.

require "net/http"
require "uri"

module CronNudge
  module_function

  def ping(path = "")
    raw = ENV["CRONNUDGE_URL"]
    return if raw.nil? || raw.empty?

    uri = URI(raw + path)
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = uri.scheme == "https"
    http.open_timeout = 5
    http.read_timeout = 5
    http.request(Net::HTTP::Post.new(uri))
  rescue StandardError
    nil
  end
end

class NightlyExportJob < ApplicationJob
  def perform
    export_rows
    CronNudge.ping
  end
end

A Sidekiq::Job worker uses the same ending inside perform. One check per job. A shared URL stays up while any other job still pings.

Faraday is the same helper if the app already depends on it. Faraday::Error covers connection failures and timeouts. Faraday 2 does not raise on an HTTP error status unless the connection uses the :raise_error response middleware (Faraday.new { |f| f.response :raise_error }), which raises Faraday::ClientError or Faraday::ServerError, both subclasses of Faraday::Error. The block below is Faraday 2's request options and does not add that middleware, so a non-2xx response does not raise.

def ping(path = "")
  raw = ENV["CRONNUDGE_URL"]
  return if raw.nil? || raw.empty?

  Faraday.post(raw + path) do |request|
    request.options.timeout = 5
    request.options.open_timeout = 5
  end
rescue Faraday::Error
  nil
end

Optional /start and /fail

/start and /fail are paths on the same ping id. /fail marks the check down and alerts immediately when it was not already down. A later /fail while it is down does not send a second alert. /start records a start. It is not a success. While that run is open, the deadline is the earlier of the next schedule and the grace period after the start, and that run window is at least 60 seconds. A perform that hangs then alerts on the shorter clock. The success URL is what finishes the run.

A scheduler that never enqueues never calls either URL. The missing success ping is the backstop: one alert down, one when it recovers. Max runtime, when run tracking is on, is in assertions, runs, and agents.

class NightlyExportJob < ApplicationJob
  def perform
    CronNudge.ping("/start")
    export_rows
    CronNudge.ping
  rescue StandardError
    CronNudge.ping("/fail")
    raise
  end
end

Use this block or the success-only perform, not both, or a success pings twice. Re-raise. An exception you swallow is a successful job, and /fail is the only signal left. Sidekiq will run perform again on each retry, so /fail runs on each failed attempt and the alert still goes out once. Skip /fail if you would rather wait out those retries and alert only when the success ping never arrives.

Schedule and grace

Copy the five fields the scheduler actually evaluates, and the timezone from the section above. A whenever line is the crontab it wrote. A Solid Queue or GoodJob string with a zone on the end uses that zone. Enterprise uses tz: or mgr.tz, or the process zone when neither is set.

An interval schedule, if the gem uses one instead of cron, is an interval check. The form lists 5 minutes, 15 minutes, 30 minutes, 1 hour, 6 hours, 1 day, and 1 week. The API accepts any whole number of seconds from the plan minimum through 31 days.

Default grace is 5 minutes. The form offers none, 1 minute, 5 minutes, 15 minutes, and 1 hour. The API accepts 0 seconds through 7 days. The ping is at the end, so grace covers queue time plus runtime. A short daily export fits 15 minutes. A 20 minute body needs the 1 hour option. Every minute needs Pro. Free's shortest interval is 5 minutes.

Free is 10 checks, with email and one Slack or Discord channel. Pro is $12 a month for 100 checks, a 1 minute minimum, signed webhooks, and the API. There is no yearly price. The numbers are on pricing.

A growing queue with a fresh enqueue time is a worker problem. An enqueue time that stopped moving is a dead scheduler, a disabled row, or a schedule the last deploy removed. Two log lines per tick, for a gem that does not elect a single enqueuer, is a second scheduler.

FAQ

Does Sidekiq alert when the scheduler process stops? No. A dead poller, a missing GoodJob cron process, or a Solid Queue supervisor that never booted enqueues nothing. There is no exception to page on. An alert happens when something outside the app expected a ping.

Does a Redis flush delete the cron jobs? sidekiq-cron and sidekiq-scheduler store the schedule in Redis, so a flush removes it until a process loads the file again. Jobs created only in the web UI do not come back. Enterprise periodic jobs, GoodJob, and Solid Queue keep the schedule in code or Postgres.

The job is in the queue. Why is the check late? The body has not finished, so the success ping has not run. The usual causes are a worker on the wrong queue, a backlog, or a retry loop that has not succeeded yet.

Which timezone goes on the check? The zone the scheduler uses to read the expression. That is tz: or the process zone for Enterprise, the zone on a Fugit string for GoodJob and Solid Queue, the zone written into the crontab for whenever, and the zone appended to a sidekiq-scheduler cron string. A six-field rufus or Fugit string includes seconds. Paste the other five fields.

Should the ping run at the start of perform? The success ping runs after the work. /start only records that the body began. A ping at enqueue time stays green when the worker never runs the job.

Does a failed ping fail the job? Not with the helper above. StandardError from the HTTP call is swallowed, the job stays successful, and the check alerts after grace because the ping never arrived.


The scheduler enqueues on time, once. The worker finishes. The ping is how you hear about the ticks where that chain stopped. Create the check, or compare the five fields on the cron tool. Related: how to monitor cron jobs, crontab not running, cron expression examples, Render, Railway, and Fly.io when the schedule is the platform's, not Ruby's, and Heroku Scheduler when the clock is the Scheduler add-on.