Solving the Mystery of Vanishing Products in Magento 2 Elasticsearch
We’ve encountered an intriguing predicament on our Magento 2 site running Elasticsearch 7.x and Elasticsuite 6.xâsuddenly, all catalog_product indices have gone missing their documents! After hours of troubleshooting, we’re still baffled by this ghostly disappearance.
The Current State of Affairs
Our server’s indices currently look like this:
[
{
"green": {
"open": true,
"index_name": "fblive_en_catalog_category_20230309_095846",
"doc_count": 1,
"health": "good"
}
},
//... (remaining indices with doc_count: 0)
]
As you can see, the catalog_product indices have no documentsâan eerie silence in what should be a bustling digital market. We’ve reinstalled Elasticsuite and reindexed until our fingers went numb, but to no avail.
The Culprits We’ve Eliminated
Before we dive deeper into the rabbit hole, let’s clear away some potential suspects:
- Memory issues: The server has ample RAM for our current load.
- Log files: Both system.log and elasticsearch.log remain stubbornly silent about any misdeeds.
- Settings: We’ve double-checked every configuration file that comes to mind.
Possible Hypotheses
Given the lack of errors or clues in the logs, we’re left with a few unnerving possibilities:
- A rogue cron job silently deleting our indices in the dead of night.
- An Elasticsuite bug triggered by an undocumented interaction between Magento 2.3.6 and Elasticsearch 7.x.
- Ghosts haunting our server room, which would explain a lot.
Next Steps to Solve the Mystery
-
Enable debug logging: Ramp up your logging verbosity in both Magento and Elasticsearch. This might uncover those elusive error messages we’ve been missing.
php bin/magento config:set dev/log/active 1 php bin/magento config:set dev/log/disable 0 -
Check for cron jobs: Sift through your server’s crontab files to ensure no unauthorized index-murdering scripts are at play.
-
Update and verify: Make sure all your extensions, including Magento itself, Elasticsearch, and Elasticsuite, are up-to-date with the latest stable versions. If updating doesn’t help, try rolling back to a previous stable version.
-
Inspect the data flow: Confirm that data is being written correctly from Magento to Elasticsearch during indexing processes.
-
Review your customizations: If you’ve made any recent changes or added custom code, examine those for any potential index-clearing mishaps.
Stay Tuned for Further Developments
As we continue our investigation into this baffling case of the vanishing products, we’ll keep you posted on any breakthroughs or new suspects that arise. In the meantime, if you have any insights or suggestions, please don’t hesitate to shareâthe more minds working on this mystery, the better chance we have of catching the culprit.
Happy sleuthing!
Conclusion
The disappearance of our catalog_product indices remains an unsolved riddle. However, with a systematic approach combining log-level debugging, cron job auditing, software verification, and data flow inspection, we’re confident that we’ll crack this case wide open.
Remember to always keep your systems updated and maintain vigilant oversight of any customizations or extensions you introduce into the mix. Until next time, happy hunting!