Standalone: site audits freeze mid-crawl - celld handler budget, denoland/celld#299
What happens
On the standalone Docker edition every site audit of a site with more than a few hundred pages stops partway through the crawl and never finishes. The audit row stays running / crawling, pagesCrawled stops moving (in my case 241/1500 for 12 hours), and nothing is logged. Restarting the runtime gets it going for about four more crawl chunks, then it stops again.
This is the site-audit sibling of #485 and has the same root cause in celld: denoland/celld#299. celld 0.5.1 drives a Workflow instance's steps inside one alarm handler until the instance waits. When the steps add up to more than CELLD_HANDLER_BUDGET_S (default 300 s), the in-flight step is cancelled, status() keeps reporting running and the instance never continues.
runCrawlPhase runs crawl-chunk-N steps back to back. Each takes about 90 s (the soft crawl deadline), and there's no step.sleep between them unless the site throttles. So the fourth chunk after any (re)start crosses 300 s and the audit freezes.
Environment
ghcr.io/every-app/open-seo-standalonev0.1.19 and v0.1.20 (f24a833), celld 0.5.1, RustFS, single node (Synology NAS)- Site: WooCommerce, about 1,350 sitemap URLs,
maxPages1500, no JS rendering
Evidence
The Workflow cell's SQLite (/data/__Workflow.openseo-standalone:<hash>/ltx/eN/db.sqlite) while stuck:
_cf_KVstepcrawl-chunk-3hasstatus: running, whilecrawl-chunk-1and-2arecompleted._cf_ALARM.retrygrows about 4 times per minute (2,911 after 12 h) withcounted_retry = 0.- There are no runtime→crawl-gateway connections while it's stuck, so the step isn't waiting on a fetch.
CRAWL_CHUNK_STEP's 5-minute timeout never fires.- With
CELLD_HANDLER_BUDGET_S=420, the instance again advanced exactly 4 chunks (≈ 360 s + startup) after the restart before it froze. The freeze tracks the handler budget, not specific pages. - With
CELLD_HANDLER_BUDGET_S=14400, the same instance ran chunks 13–18 back to back without stalling and went from 631 to 1,003 pages in about 10 minutes. The workaround below holds.
The audit reconciler (auditReconciler.ts) can't reap these, because the instance reports running. The same happens to audits whose row was deleted: their workflow cells keep retrying their alarm.
Workaround
Set a larger budget on the runtime service, e.g. in a compose override:
services:
runtime:
environment:
CELLD_HANDLER_BUDGET_S: "14400"
Suggestions
- Ship a larger
CELLD_HANDLER_BUDGET_Sindeploy/standalone/compose.yamluntil celld#299 is fixed. Or yield between crawl chunks (a shortstep.sleep), so each chunk gets a fresh handler. The same applies to the Lighthouse loop and toAiVisibilityWorkflow(#485). - Give the audit watchdog a maximum age for audits whose instance still reports
running, so a frozen instance is terminated and the row is failed instead of hanging forever.
I ran into the same problem on my site and this issue saved me a lot of time, thanks @alficzech for the detailed write-up. Sharing what I saw in case it helps with the fix.
My setup: standalone v0.1.19, celld 0.5.1, a much larger site than yours (~50k discovered pages, maxPages 60000).
Before the workaround, the audit froze every 15-20 minutes. I had a small script restarting the runtime whenever the crawl went idle, and it needed 37 restarts in about 21 hours. The audit got through roughly 800 pages/hour.
I then set CELLD_HANDLER_BUDGET_S=14400 on the runtime container only, and the audit resumed from where it was. In the next 4 hours it went from 11,773 to 25,900 pages (~3,500 pages/hour) with no restarts.
One extra observation: the crawl froze again almost exactly 4 hours after the runtime started, which is the 14400 s budget I set. So raising the budget works, but it seems to only push the limit further out. On large sites a periodic runtime restart is still needed until the underlying issue is fixed.
Thanks, your diagnosis was exactly right. Fixed in v0.1.22: workflows now pause for a second after two minutes of steps, so celld starts a fresh handler, and the image's budget now covers the longest step timeout. After updating you can drop your CELLD_HANDLER_BUDGET_S override.