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??

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

1 Answer 1

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 
1
  • i tried this but not working Commented Aug 14, 2019 at 8:04

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.