0

I have copied my Magento 2 backup to my new server

now I am getting

all product page showing 404 and I could not access admin pages magento 2

exception.log

main.CRITICAL: Unique constraint violation found {"exception":"[object] (Magento\Framework\Exception\AlreadyExistsException(code: 0): Unique constraint violation found at /public_html/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php:425, Magento\Framework\DB\Adapter\DuplicateException(code: 1062): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO mg_report_event (logged_at, event_type_id, object_id, subtype, store_id) VALUES ('2019-08-14 07:24:45', ?, ?, ?, ?) at public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:580, Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO mg_report_event (logged_at, event_type_id, object_id, subtype, store_id) VALUES ('2019-08-14 07:24:45', ?, ?, ?, ?) at public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' at /vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

I have tried this answer but not working

https://stackoverflow.com/a/49789752

Does anyone know how to solve this??

  • are you using any custom module? if yes show your installSchema.php file – Mohit Rane Aug 14 at 7:58
  • im using many custom module... – prabhakaran7 Aug 14 at 7:59
  • can you check from which module is using this table mg_report_event? – Mohit Rane Aug 14 at 8:01
  • how i can check... – prabhakaran7 Aug 14 at 8:02
  • in your terminal use this command grep -rr1 "mg_report_event" – Mohit Rane Aug 14 at 8:03
0

If the values inside mg_report_event table is not so important. You may truncate the table. Login into your database and run

TRUNCATE TABLE mg_report_event
  • i tried this but not working – prabhakaran7 Aug 14 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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