0

I have migrated my Magento store 2.3.1 from the server. I have migrated database and folder with all files. What do I have to do with cron jobs? This is my error in logs:

[2019-11-19 11:21:16] main.ERROR: Cron Job indexer_update_all_views has an error: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`). Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":170131456,"emalloc_start":157612720} [] []
[2019-11-19 11:21:16] main.CRITICAL: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) at /var/www/magento/app/code/Bss/MultiStoreViewPricingPriceIndexer/Model/Indexer/Product/Price/Action/Rows.php:51, Magento\\Framework\\DB\\Adapter\\DeadlockException(code: 1213): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) at /var/www/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:589, Zend_Db_Statement_Exception(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) at /var/www/magento/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /var/www/magento/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

Any idea to fix that? Thanks!

1 Answer 1

3

First, you need to install cron in your server by executing the below command.

bin/magento cron:install [--force]

After installing cron in your server you need to truncate the cron_schedule table flush the cache.

After flush cache, you need to run cron with executing the below command.

bin/magento cron:run [--group="<cron group name>"]

Where --group specifies the cron group to run (omit this option to run cron for all groups)

To run the indexing cron job, you can execute the below command.

bin/magento cron:run --group index

To run the default cron job, you can execute the below command.

bin/magento cron:run --group default
4
  • Thank you very much!
    – Despotars
    Commented Nov 21, 2019 at 7:13
  • 1
    Most welcome if you face any type of issue contact me on skype
    – Tushar
    Commented Nov 26, 2019 at 15:24
  • Thanks! but I can't find you on Skype!
    – Despotars
    Commented Nov 26, 2019 at 15:35
  • tusharlathiya1996 This is my skype id
    – Tushar
    Commented Nov 26, 2019 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.