Skip to main content
Configure HumHub documentation

HumHub cron jobs and queue: when background jobs never run

Half of what HumHub does happens in the background: notification emails, email summaries, search indexing, directory syncs, cleanups. Two scheduled tasks drive it, the cron and the queue. When either stops, nothing looks broken, but nothing is sent.

Last updated: .

In shortHumHub needs two tasks started every minute on its server: the queue, which runs the waiting jobs, and the cron, which starts the hourly and daily tasks. Administration → Information → Background Jobs shows whether they run. A growing Waiting count, or "Never" in red, is the answer to most "emails never arrive" questions.

What each one does

CronQueue
RoleStarts the periodic tasksRuns the jobs waiting in line, one after the other
RhythmHourly tasks once an hour; daily tasks once a day, after 18:00 server time by defaultAs soon as a job is waiting
ExamplesQueues the email summaries, the hourly LDAP sync, the marketplace update check, daily cleanupsSends each notification and summary, updates the search index, runs the LDAP sync, module jobs

The two depend on each other: the cron mostly puts jobs in the queue, and the queue does them. A cron without queue fills a line nobody empties; a queue without cron never receives the periodic jobs.

The daily run happens at the first cron tick after the time set in HumHub's configuration (18:00 by default). Weekly summaries leave on Sunday's daily run, monthly ones on the 1st of the month.

How they are started

On a self-hosted HumHub, two entries in the server's task scheduler (crontab) start HumHub's command-line tool every minute: one for the queue, one for the cron. The installer's last step shows the two lines with the right paths for your server, and HumHub's documentation (cron jobs) explains them, with the alternative of a permanent queue worker for busy communities.

They must run as the same system user as the web server, so that the files they create stay readable by the site.

Read the Background Jobs page

Administration → Information → Background Jobs has two panels:

  • CronJob Status: Last run (hourly) and Last run (daily), as "5 minutes ago" or Never in red.
  • Queue Status: the Driver, then the number of jobs Waiting, Delayed (scheduled for later), Reserved (being run) and Done.

A healthy community shows an hourly run less than an hour old and a waiting count close to zero that does not grow.

The Background Jobs page: last hourly and daily cron runs, and the queue's waiting, delayed, reserved and done jobs

A fresh installation shows "Never" for the hourly run but a date for the daily run: HumHub records the installation time as the last daily run, so the daily line looks fine even if the cron was never set up. Trust the hourly line.

The dashboard warning

Administrators see a Warning incomplete setup! panel on their dashboard when HumHub detects a problem:

  • "The cron job for the background jobs (queue) does not seem to work properly." when a job has been waiting for more than 20 minutes.
  • "The cron job for the regular tasks (cron) does not seem to work properly." when the cron has not run for more than an hour.

Each line links to HumHub's documentation. The warning disappears by itself once the task runs again.

Symptoms and causes

SymptomLikely cause
The E-Mail page's test arrives, notifications do notQueue not running (email delivery)
No email summaries, notifications fineCron not running, or a summary interval set to Never
Summaries arrive in the eveningNormal: the daily run starts at 18:00 by default
New content missing from searchQueue not running or late
LDAP changes not reflectedCron not running, or automatic fetching off in the LDAP settings
Waiting count grows during the day, falls at nightQueue too slow for the load: run a permanent worker or more workers
Jobs stay Reserved for hoursA job crashed mid-run; read Administration → Information → Logging

The Clear queue button

With the database queue driver, the Queue Status panel has a Clear queue button. It deletes the jobs in line: the notifications and summaries they would have sent are lost. Use it only when a broken job blocks everything and you have read the logs; after a long outage, a large waiting count is better left to drain.

Hosts without a scheduler

Some shared hosting plans cannot run a task every minute. The free CUZY module Cron Daemon lets an external cron service call a URL instead; it is a workaround for small communities, not a replacement for a real scheduler.

On a CUZY hosted community

The cron and the queue workers are part of the hosting and are watched by CUZY: there is nothing to set up, and the Background Jobs page is there for you to look at. Each community's daily run has its own time slot, so that the communities of a server do not run their daily tasks at the same minute. More queue workers are available on quote on the Team plan and the Business plan (limits). Compare the plans or start a trial.

Read next

Try HumHub with your own content

A hosted community in two minutes, all paid CUZY modules included, no card asked. Keep everything when you subscribe.

Loading...