Skip to main content
All Case Studies
Magento 1 Cron Indexer Error Handling

Dynamic Category Indexer: Cron Stability & Error Reporting

Challenge

A nightly cron job responsible for re-indexing rule-based dynamic categories was crashing with a PHP fatal error. The crash left the indexer half-run, silently showing incorrect product assignments in affected categories. Root cause: a corrupted attribute condition on one dynamic category rule caused getAllAttributeValues() to return false, which the indexer had no guard for, aborting the entire run rather than skipping the broken category.

What Was Built

A resilience layer around the indexer: broken categories are now caught at the rule evaluation stage and skipped rather than aborting the entire run. The last known good product assignment for skipped categories is preserved, so no incorrect products appear in the frontend as a result of the partial run. All skipped categories and their error details are collected and sent via email to configured admin addresses after each run. Admins can then correct the bad rule conditions at their own pace without any user-facing impact.

Outcome

Cron job runs reliably every night regardless of broken category configurations. Admins receive an actionable email digest of anything that needs fixing. No silent data corruption in the catalog.

Have a similar challenge?

Get in touch - no sales pitch, just a straightforward conversation.

Contact me