Common Issues of Data Synchronization in M2

Issue: Prices and stock are not updating

# Possible Reasons Solutions
1 Magento Cron is not working. If there are some issues with Magento Cron, please setup external Cron (independent of Magento Cron) by following the below guide: https://support.klevu.com/knowledgebase/run-klevu-cron-independent-of-magento-2-cron/
2 Magento Indexers are not up to date. Please make sure to rebuild Magento Indexers before syncing data to Klevu.
3 The website is using some third-party tool to update the prices and Stock. This involves the execution of direct database queries. As Klevu module relies on updated_at feild of the catalog_product_entity table, In this case, updated products are not synced to Klevu. Please enable the MySQL trigger by following the guide: https://support.klevu.com/faq/faqs/how-to-update-stock-and-prices-while-using-third-party-tool-or-erp/
The immediate solution: Rebuild the Magento Indexers and perform the full Catalog sync to Klevu by executing the below command on the Magento root:
php bin/magento klevu:syncdata --alldata

 

Issue: Catalog rule taking much time to update from admin

# Possible Reasons Solutions
1 This happens because Klevu module uses the observer to get the products data and change its properties so that it will be synced to Klevu. Time is taken while loading the product data. Please follow the steps given below.

  1. Go to the file <magento-root>/vendor/klevu/module-productsearch/etc/events.xml
  2. Comment the below code:
    <event name="catalogrule_rule_save_commit_after">
          <observer name="RuleUpdate" instance="Klevu\Search\Model\Observer\RuleUpdate" />
      </event>
       <event name="catalogrule_rule_delete_before">
          <observer name="RuleUpdate" instance="Klevu\Search\Model\Observer\RuleUpdate" />
      </event>
    
  3. Please enable the MySQL trigger by following the guide: https://support.klevu.com/faq/faqs/how-to-update-stock-and-prices-while-using-third-party-tool-or-erp/

 

Issue: Images are not updating

# Possible Reasons Solutions
1 It can be the issue with data sync. Please check if the Cron is running or not, and perform full Catalog sync to Klevu after rebuilding the Magento Indexers.
2 The product images are directly replaced on the server and have the same name as that of the previous image. Please follow the steps given below.

  1. Please download ImageGeneration.zip file, extract it and put ImageGeneration.php file at the directory location <magento-root>/vendor/klevu/productsearch/Console/Command/.
  2. Open the file <magento-root>/vendor/klevu/productsearch/etc/di.xml
  3. Add the below line in the XML section <argument name=”commands” xsi:type=”array”>
    <item name="ImageGeneration" xsi:type="object">Klevu\Search\Console\Command\ImageGeneration</item>
    
  4. Run setup upgrade, DI compile, static deployment.
    execute the following command:

    php bin/magento klevu:images --regenerate

 

Issue: Preserve layout search relevancy

# Possible Reasons Solutions
1 There is some confliction of third party module with Klevu module on Catalog Search Result page Please follow the steps given in the below guide to trouble shoot the issue:
https://support.klevu.com/knowledgebase/troubleshooting-preserve-layout-conflict/

 

Issue: Smart category navigation issue

# Possible Reasons Solutions
1 The website is using an older version of Smart Category Navigation. In our latest release, we have optimised the code to display the products according to Klevu relevancy in case of larger data.

 

Issue: Large catalog sync issue

# Possible Reasons Solutions
1 The website is using product Object method to sync the data to Klevu which consumes a lot of memory and very slow in case of larger data. Please use the collection method to sync data to Klevu. Here is the guide for the same: https://support.klevu.com/knowledgebase/enabling-collection-method-to-sync-data-magento-2/.
Please note, as collection method relies on Magento Indexers, you need to make sure Magento Indexers are up to date while syncing products to Klevu.