Why stuck CKAN background jobs stop harvests, XLoader loads and emails
A stuck CKAN background job is a harvest, XLoader load or notification email that has been queued or started but never reaches a finished state, so the portal shows no result and no clear error. Bring in outside help when the stall returns after a worker restart, when several job types stop at once, or when nobody on the team can say whether clearing the queue will lose work. Start with the queue itself. CKAN prefixes job queue names with the site ID, and workers can listen to specific queues, so a worker can be healthy and still be watching a queue that does not serve your site. The default job timeout is 180 seconds unless ckan.jobs.timeout or a per-job timeout is set, which means a long harvest can be cut off by a limit nobody chose on purpose. The CKAN background jobs documentation explains these settings and is the first read before changing anything.
Keep the work in-house when one job type stalls, a team member can read worker logs and the CKAN configuration, and the likely fix is a restart, a queue name correction or a timeout change that can be tested on a copy of the portal. A fixed-scope engagement makes sense when harvests, XLoader loads and emails stall together, when workers run on several hosts or containers and nobody can confirm which queue each one serves, or when the organization needs a written record of the investigation for an internal risk review. In that case, agree the scope in writing before work starts. Confirm which queues and workers are inspected, which portal environments are covered, whether a timeout change is part of the fix, and whether the findings come with a retest. A quote should follow from that written scope.
Clearing jobs is a decision you make only after inspection. Before anything is removed, record each queued job's type, the source or resource it refers to, its timeout value, and the worker log lines that show where it stopped. A harvest that stopped partway may have written some datasets and not others, so a rerun can duplicate or skip records. A notification email may be sent twice if a job is retried after the mail server has already accepted it. Name an owner for each job type who confirms it can safely be rerun, and keep a copy of the queue state so the decision can be reviewed later. Ask any partner to show how the inspection will be documented before the fix is applied.
How a CKAN job travels from request to worker and where it stalls
The diagram follows one job from its start in the web application or a scheduled action, through the Redis queue store, to a worker host. Each queue name carries the site ID, so a worker must listen on that exact queue to pick the job up. From there the job either completes, runs past the timeout set by ckan.jobs.timeout or a per-job value, or waits because no worker listens on its queue. A stalled job leads to three checks: the queue, the worker log, and the cause. Retry or clear the job only after the cause is fixed.
Job path from enqueue to completion, with the stall branches and the fix-first step.
Timeout and queue settings that decide when stuck CKAN background jobs fail
This table compares the settings that decide how long a background job may run and which worker picks it up. Read each row by asking where the value is set, which jobs it affects and what a change costs in stalled or wasted worker time. The main takeaway is that a job can look stuck simply because its timeout is too short or its worker listens to a different queue name.
| Setting | Where it is set | What it controls | When to change it and trade-off |
|---|---|---|---|
| ckan.jobs.timeout | CKAN configuration file for the site | Site-wide limit on how long any background job may run | Raise for long harvests or XLoader loads that time out. A high value keeps hung jobs holding a worker longer. |
| Per-job timeout | Argument set by the code that enqueues the job | Limit for one job type, overriding the site-wide value | Set for known long tasks only. Generous values on every job hide genuinely stuck work. |
| Default timeout | Built into CKAN when no timeout is configured | Applies to jobs with no site-wide or per-job timeout, stated as 180 seconds | Treat 180 seconds as the stated default only. Confirm it for your version before tuning. |
| Worker queue list | Arguments given when each worker process starts | The named queues that one worker reads from | Separate slow harvests from emails so one backlog does not block the other. Each queue needs a listening worker. |
| Site ID prefix | Site ID setting shared by the web and worker hosts | Prefix added to every queue name for this portal | Check first when jobs are queued but never run. Mismatched site IDs leave workers watching a queue that receives no jobs. |
| Key names and startup syntax | CKAN background jobs documentation for your version | Exact configuration keys and worker command syntax | Confirm both before editing production. Copy commands from the docs for your version and check them against any older guides. |
Stuck CKAN background jobs by type: harvests, XLoader and email
Harvest jobs fetch metadata from a remote catalog on a schedule and create or update datasets on your portal. The symptom is usually a harvest source whose last successful run stops advancing, or a run that stays marked as in progress long after the remote catalog responded. The CKAN background jobs documentation explains queue names and timeouts.
- Symptom: the source's last successful run is older than its schedule, and the run record shows a start with no finish.
- Timeout: verify whether the run exceeded the default job timeout of 180 seconds. Check whether
ckan.jobs.timeoutor a per-job timeout is set in your configuration, since a full harvest of a large catalog often needs more time than an incremental one. - Remote catalog size: confirm how many datasets the source returns on a full run and whether the remote host throttles requests.
- Worker listening: confirm that a worker is running and listening on the queue whose name carries your site ID. A worker configured for a different site ID leaves these jobs waiting.
- Owner: the data team that manages the harvest source owns its definition and schedule, while the platform team owns workers, timeouts and the queue.
Check the worker log for the harvest queue first, then compare the run's start time with the timeout before you change any setting or clear the job.
XLoader loads uploaded or linked files into the CKAN DataStore and is the officially supported loader, so stuck loads are most often XLoader jobs. The symptom is a resource that stays in a pending or loading state, with no DataStore table behind it, so the Data API returns no rows. A load that fails only after a long wait usually points to the file or the download rather than to the queue itself.
- Symptom: the resource shows a pending or processing status for much longer than similar files, and the Data API returns no rows for it.
- File size and format: verify the file size, row count and encoding. A large or slow file can exceed the job timeout, so check whether the worker log shows the job was stopped or is still running.
- Source server: for linked files, confirm that the remote host responds quickly and that the URL still resolves. A slow download keeps the job open for the whole transfer.
- DataStore capacity: confirm that the DataStore database has free disk space and that the write user can create and populate tables.
- Worker listening: confirm that the XLoader worker is running and listening on the queue for your site ID, since a missing listener leaves every load queued.
- Owner: the publisher owns the file and its link, while the platform team owns the DataStore database, the worker and the timeout settings.
Check the worker log for the XLoader queue first, then confirm the file size and download speed before you resubmit the resource or clear the job.
Email notifications, such as account messages and activity alerts, are sent by background jobs, so a mail problem often shows up as a queue problem first. The symptom is that users report missing messages while the queue holds email jobs that never complete or keep retrying. The web application can look healthy during this failure because the job is accepted and then fails on the worker host.
- Symptom: users do not receive account or notification emails, and email jobs remain queued or repeat without finishing.
- Mail server reachability: verify that the worker host can open a connection to the configured mail server on the expected port. Firewall rules and network zones often differ between the web server and the worker host, so test from the worker host itself.
- Mail configuration: check the mail settings in the CKAN configuration file for host, port, sender address and authentication method, and confirm each value with the team that runs the mail relay.
- Worker listening: confirm that the worker handling mail jobs is running and listening on the queue for your site ID. Without a listener, messages stay queued even when the mail server is healthy.
- Owner: the platform team owns the worker and the mail settings in CKAN, while the IT messaging team owns the relay, its allowlists and its sender authentication.
Check the worker log for mail errors first, then test the connection from the worker host before you change the configuration or clear any queued messages.
How to find stuck CKAN background jobs before clearing anything
This sequence moves from the CKAN version and site ID through the worker, queue, log, connection and timeout checks, so each stuck job is understood before anyone retries, adjusts or clears it. Run the checks in order on the affected portal and record each result. The output is a diagnosis for every job that says whether it is waiting, failing or running past its limit.
Confirm the CKAN version and site ID
Record the CKAN version the portal runs and the site ID set in its configuration file. The site ID prefixes every background job queue name, so a worker listening under the wrong prefix will never pick up the job. Use the commands in the CKAN background jobs documentation for exact syntax. This step is done when you have a written version and site ID that match the configuration file, and you know which queue prefix to search for in the next steps.
Confirm workers are running and listening
Check that a worker process is running for each queue the stuck job uses. Workers can be started to listen to specific queues, so a worker attached to the default queue will not process a job queued elsewhere. Compare the queue named on the job with the queues the worker reports listening to. The check passes when the worker process is up, attached to the job's queue, and not stuck in a restart loop under your process manager.
List queued and active jobs with ages
List every queued and active job on the affected queue, with the time each one was enqueued. Note the job ID, the function it runs, the queue name and its age. A job that has waited far longer than its neighbors points to a worker or connection problem, while a job that has been active for a long time points to a run that has not finished. The check passes when you have a dated list that you can compare against the log and timeout checks that follow.
Read the worker log for errors
Open the worker log for the period between when the job was enqueued and when it started. Search for timeout messages, tracebacks and the job ID. A timeout entry means the worker stopped the job after its limit, while a traceback names the code that failed and the exception it raised. The check passes when every stuck job has either a matching log entry or a recorded absence of one, with the log window noted.
Check Redis and database connections
Confirm that each worker can reach Redis, which holds the job queues, and the CKAN main database, which the jobs read and write. Test each connection from the host where the worker runs, using the database and Redis tools your team already uses. Connection failures can look like jobs that stall without a clear error in the job itself, so check the worker log from the previous step as well. The check passes when the worker reaches both services and the log shows no connection failures in the window you examined.
Compare run time with the timeout
Compare how long the job has been running with the timeout that applies to it. The default job timeout is 180 seconds unless the ckan.jobs.timeout setting or a per-job timeout overrides it. Confirm which value is in effect by checking the configuration file and the job's own settings. The check passes when you can state the timeout for this job and whether its run time has exceeded it, which tells you whether the worker stopped the job or the job is still doing legitimate work.
Decide whether to retry, adjust or clear
Only now decide the action for each job. Retry a job whose failure was transient, such as a connection error that has since been fixed. Adjust the timeout when the job is legitimately slow and its limit is too low for the data it handles. Clear a job only when its cause is understood, its work is no longer needed, and the owner agrees, and record the job ID and reason before you do. The check passes when each job has one recorded decision backed by the evidence from the earlier steps.
Causes behind jobs that never finish
Most stuck jobs trace back to a few causes: a queue with no listening worker, a job cut off by its timeout, a dependency the worker cannot reach, a stopped worker, or queue names that changed with the site ID. Each card lists the symptom, the check that confirms it and the team that owns the fix. Treat a match as a lead to confirm before you change anything.
No worker on the queue
A job waits under a queue name that no running worker listens for, so it stays pending indefinitely with no error. This is common on a new install, because each worker listens only to the queues it was started with. Open the job list, note the queue the stuck job sits on, then confirm that a worker process was started with that exact queue name. A worker started on other queues leaves the job waiting. The platform team that runs CKAN processes owns the fix.
CKAN background jobs docsJob exceeds its timeout
A worker starts the job, then the job is cut off before it finishes, so it appears to hang. The default timeout is 180 seconds unless ckan.jobs.timeout or a per-job timeout is set. Large harvests, XLoader loads of big files and slow remote downloads can run past that limit. Compare the job's runtime in the worker log with the timeout your portal applies, then decide whether to raise the limit for that job type or split the work. The CKAN admin owns the site setting, and the extension developer owns per-job timeouts.
Unreachable dependency or remote source
Jobs that need Redis, a remote catalog, a file host or a mail server stall or fail when the worker cannot reach that service. Test the connection from the host that runs the worker, since a check from an admin laptop proves little. For a harvest, confirm the source URL responds from that network. For email, confirm the SMTP host accepts connections from the worker. Firewall and DNS changes after a network move often cause this. The infrastructure team owns Redis and network paths, and the owner of the source or mail system owns that endpoint.
Worker stopped or restarted
When the worker process stops, its queue has no consumer, so new jobs wait silently. A deploy, a crashed process or a host reboot can leave jobs queued until someone notices. Check the process supervisor, such as systemd or your container orchestrator, for the worker's status and last exit reason. Then confirm that waiting jobs begin running once the worker is back. An alert on worker health shortens the time to detect this gap. The operations team that runs the service owns the supervision configuration.
Queue names after a site ID change
CKAN prefixes job queue names with the site ID, so changing the site ID renames every queue. Jobs queued under the old name stay where they are, while workers started after the change listen to the new name. Compare the site ID in the portal configuration with the prefix on the stuck job's queue. If they differ, restart workers on the queue names that match the current site ID, then decide how to handle the old jobs. The CKAN admin who changed the site ID owns this fix, and the change should be recorded in the portal runbook.
Clearing stuck jobs without losing harvest or load state
Check what clearing does to each job type before you remove anything from the queue. A queued harvest, an XLoader load and an email job leave different traces behind. Clearing a harvest job may stop that run without changing the harvest source configuration, but the source can still show the last run as incomplete, so plan to run the harvest again from its source once the queue is clear. Confirm in the CKAN background jobs documentation which clearing operations exist in your CKAN version and what each one leaves behind, including whether it removes only queued entries or also changes job status records. Test the chosen operation on a staging copy with the same queue names before you run it on production.
Record the queue contents before you clear anything. Save the job identifiers, the queue names (which carry the site ID prefix), enqueue times, job types and the arguments that identify the resource or harvest source. Store this export with the change record so that later questions about which loads or harvests were dropped can be answered from evidence. Also check whether a job is slow rather than stuck. Jobs run under the default 180 second timeout unless ckan.jobs.timeout or a per-job timeout is set, so confirm the timeout values in your environment before you clear a job that may still be running. Clearing a job that is still working can leave a partial result that is harder to trace.
Security and operational risks of job infrastructure
Background job infrastructure holds more than a queue. Four areas decide whether a stuck job stays a support ticket or becomes an exposure: who can see the queue, how Redis is reached, what the logs keep, and how timeouts and restarts are changed. DeployOpen prepares evidence for compliance reviews of these controls but does not issue audit reports or certifications.
Queue visibility and clearing rights
Job arguments can carry more than an ID. A harvest job may include source URLs and configuration, and an email job may include recipient addresses and message content. Before anyone can view or clear the queue, confirm what each job type stores in its arguments and who on your team needs that visibility. Limit clearing to named operators, record who cleared which jobs, and treat queue inspection as access to the data those jobs carry.
CKAN background jobs docsRedis access and network placement
Redis holds the queue that CKAN workers read from, so anyone who can reach it can inspect or change pending jobs. Only web and worker hosts should reach Redis. Keep it on a private network segment, open its port only to those hosts, and enable authentication on the instance. Confirm the exact auth and TLS options in your Redis version's documentation, and check that no admin tool or backup job connects from outside that boundary. Review firewall rules after every network change.
Worker logs and retention
Worker logs can contain personal data. They record job activity, which can include harvest source names, dataset titles, error text that echoes remote content, and email recipients. Decide who may read worker logs, where they are shipped, and how long they are kept, and write those rules down before an incident. Redact personal data from logs attached to tickets or shared with a vendor, and confirm the retention period with your privacy lead before the logs grow.
Change control for timeouts and restarts
Timeout settings and worker restarts both change how jobs finish, so treat them as production changes. The default timeout comes from ckan.jobs.timeout unless a job sets its own, so record the current value, the new value, and every worker that receives it. Schedule restarts outside working hours, check for jobs in progress first, and keep a rollback step for each change. Ask your change board to approve timeout changes that affect harvests or loads.
- Default job timeout
- 180 seconds
What stuck CKAN background job fixes cost and what they need from us
How much does fixing stuck CKAN background jobs cost?
DeployOpen does not publish a price list, and the quote follows from the written scope agreed before work starts. The main cost drivers are the number of job types in use (harvesting, XLoader, email and any extension queues), the number of workers and hosts that run them, the extensions installed alongside CKAN, and whether Redis and the deployment span one server or several. Log access also matters, because a diagnosis that starts with complete logs needs less investigation than one that begins with partial exports. A diagnosis and fix is usually one-time work, while upgrades, monitoring and continuous support are retainers that recur. Ask the quote to show which parts are one-time, which recur, which hosts are covered, and what happens if the root cause sits in a dependency outside the agreed scope.
How long does a stuck CKAN background job fix take?
No fixed duration applies, because the time depends on what is stuck and where it is stuck. The first phase is reproducing the stall: listing queued jobs, checking which workers listen to which queues, and confirming that queue names carry the correct site ID prefix. Duration then grows with the number of job types, the number of worker hosts, how many extensions touch jobs, and whether the cause sits in Redis, PostgreSQL, a remote source such as a harvest target, or CKAN code itself. Access delays add time, since each host, log store and staging copy needs approval and a working connection before the investigation can move forward. Ask for a timeline in the written scope that lists the access needed up front, the checkpoints, and the retest that confirms queued jobs complete.
What do we need to provide before a stuck CKAN job review starts?
The review needs access and evidence from the systems that run CKAN, plus a copy it can test against. Provide shell or read access to the CKAN web and worker hosts, the application and worker logs covering the stall, access to the Redis instance that holds the queues, and the CKAN configuration file, including any ckan.jobs.timeout setting. State the exact CKAN version and patch level, the installed extensions, and the Python, PostgreSQL and Solr versions in use. A staging copy with a recent database dump lets the team reproduce the stall without touching production queues. Confirm with your platform owners that every host sits inside your environment and that credentials can be scoped, time-limited and rotated after the work ends.
Can our in-house team diagnose stuck CKAN background jobs with the official docs?
Yes, a team with CKAN operations experience can work from the official background jobs documentation, which covers queue naming with the site ID, worker queue selection and the default timeout. The docs explain the mechanics but not your topology, so the hard part is correlating queue state, worker logs and the external system each job calls. Your team should be able to list queued jobs, confirm each worker's queues, read timeout errors, and check Redis and PostgreSQL health. Plan time for getting that access working and for a test copy to try fixes against. Bring in outside help when the cause spans several hosts, when a dependency such as a harvest source fails intermittently, or when a deadline makes a second diagnosis worth paying for. Read the background jobs documentation first.
Does raising the CKAN job timeout fix stuck background jobs?
Usually not, because a longer timeout hides the symptom and leaves the cause in place. CKAN's default job timeout is 180 seconds, and it can be changed with ckan.jobs.timeout or set for an individual job. If a job now runs longer, the real question is why: a slow remote server, a large download, a database lock, an overloaded Solr node or a worker blocked on Redis can each stretch a job past any fixed limit. A higher timeout can also let a stuck job hold a worker for much longer, which reduces capacity for other queues such as email. Raise the timeout only as a short, documented step while you measure where the time goes, and record the old value so it can be reverted. Check the worker logs for timeout messages first, then time each stage of the job against its external dependency.
How do the CKAN version and patch level change the fix?
The installed version decides which fixes are available and which advice applies. CKAN 2.12.0 was released on August 26, 2026, together with maintenance releases 2.11.6 and 2.10.11 on the same day. CKAN's release policy supports the latest patch of the current minor version and the previous minor version, and an outdated patch loses support once a newer one is out. Patch releases exclude schema changes and new features, so a patch update is the lower-risk step, but the release notes decide whether a job-related fix applies to your case. A minor move, such as from 2.11 to 2.12, can include backwards-incompatible changes and may require extension updates. Confirm the exact version in your installed environment and review the CKAN releases page before deciding whether a patch or an upgrade belongs in the scope.
Are job logs and Redis contents safe to share with an outside team?
Treat them as sensitive, because job arguments and log lines can contain dataset metadata, user email addresses, API tokens or file URLs. Agree in the written scope how the outside team gets access: scoped accounts, time-limited credentials, read-only access where possible, and a record of who viewed what. Export only the log window that covers the stall, and redact user data before it leaves your network. Ask whether the team can inspect queues without deleting any jobs, since clearing jobs is a separate decision that needs its own change record. Confirm with your security and compliance owners where the logs will be stored during the work and how long copies are kept afterward.
What to confirm in your CKAN version and environment
Five checks decide which fix applies to a stuck job. Each one has an owner who can answer it: the release notes, the extension maintainer, the team that runs the platform, the docs for your version, or the people who read the logs.
CKAN version and patch level
Start with the exact version and patch number, since job handling can change between releases and an older patch may lack a fix. Read the release notes for every version between yours and the target, and check whether any change touches the job queue, worker startup or timeout settings. Patch releases exclude schema changes and new features, but minor releases may include backwards-incompatible changes, so confirm which release line your portal runs and whether it still receives fixes.
CKAN release policyExtensions that enqueue their own jobs
XLoader, harvesters and mail-related settings can add jobs with own timeouts or dedicated queues, so a check based only on core settings may miss them. For each installed extension, ask the maintainer or your vendor which job names it enqueues, what timeout applies, and whether it runs on its own queue. Record the extension version beside each answer, because an upgrade can change behavior that the core documentation does not describe.
Deployment model and worker supervision
Confirm whether CKAN runs from system packages, containers or Kubernetes, since each model starts, restarts and logs workers differently. Ask your platform team to show how workers are supervised, including the supervisor or pod specification, the user each worker runs as, and what happens after a crash or a node drain. A worker that restarts without reconnecting to Redis or the database can leave queued jobs idle while the process appears healthy.
Commands and keys for your version
Read the background jobs page for the version you run and copy every command and configuration key from that page. Confirm the timeout setting ckan.jobs.timeout and whether a per-job timeout overrides it in your version. Ask your team to list the queue names your site uses, since they carry the site ID as a prefix, and to test each command on a staging copy before running it against production data.
Logs and queue monitoring coverage
Check whether worker logs, queue depth and job failures reach a place your team reads, and how long they are kept. Ask whether the worker writes to standard output or a log file, whether the log level records job start and finish events, and whether an alert fires when a queue grows while no worker is active. Without these signals, a stuck harvest often looks like a slow one until someone checks the source days later.
How DeployOpen investigates and clears stuck CKAN jobs
DeployOpen approaches stuck CKAN background jobs by first confirming which queue and worker are involved, then deciding what to clear. Work runs inside the client's own infrastructure, with scope agreed in writing before any job is touched. The result is a documented diagnosis that the portal team can repeat on its own.
How we scope
- The written scope names the portal, its site ID, the job types affected and the worker hosts.
- Engagements are fixed-scope, so deliverables and timelines are agreed in writing before any investigation starts.
- Changes to worker or timeout settings are listed in scope, so the client approves them in advance.
How we build
- Read the queue listing and worker status first, recording each queue name with its site ID prefix.
- Compare job runtimes against the default 180-second timeout and any ckan.jobs.timeout setting in use.
- Test clearing steps on a staging copy where one exists, so each removal is checked before production.
How we hand over
- A written record of the queue names, timeouts, worker configuration and each job removed, with the reason.
- Runbook steps the portal team can repeat to list, inspect and clear jobs for their own site ID.
- Worker and timeout settings changed during the fix, documented with the files or configuration keys touched.
How we support
- Retest after the fix by running a new harvest, XLoader load or email to confirm the job completes.
- Walk the portal team through the runbook before the engagement closes, including how to read the queue listing.
- Retainers can cover ongoing support, upgrades and continuous testing after the stalled jobs are cleared.

