I am trying to upgrade m2epro extension with php bin/magento setup:upgrade, exception occur when command is executed. The Exception

I found, exception seems not from m2epro extension because when I disable m2epro, exception is still there. Does anyone has ideas how to fix it ?

Actually our current catalog_url_rewrite_product_category does not have that problem fk. Actually our current catalog_url_rewrite_product_category does not have that problem fk.

  • Can you check for Magento_CatalogUrlRewrite in setup_module table? Is schema_version equal at 2.0.0? – Jonathan Ribas Feb 10 '17 at 14:02
  • Thanks for your response Jonathan. Yes, its schema_version and data_version are both 2.0.0. – elias du Feb 10 '17 at 20:14

1/ Drop index


2/ Run php bin/magento setup:upgrade again

  • Thanks Jonathan! Since currently the website is still working fine, I was told to leave the issue there until we have to fix it. But I will keep your solution in mind and hopefully it works! Could you explain how and why this exception happened? – elias du Feb 12 '17 at 2:57
  • You welcome! Maybe you have a mistake in your composer.lock as your database has the right version of the module, then your installation thinks it needs to run updaters again. – Jonathan Ribas Feb 12 '17 at 11:01
  • We just tried this solution but it doesn't work. We found actually the failure of creating CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID foreign key was occurred in "_catalog_url_rewrite_product_category" instead of "catalog_url_rewrite_product_category", is the table with underscore is a auto backup and will replace the table without underscore after updating successfully? – elias du Mar 7 '17 at 23:54
  • We have tried to access catalog_url_rewrite_product_category table and remove existed records whose fks are not in primary tables. The exception still occurred. Also we have checked that there is no other constraint using this fk's name. – elias du Mar 8 '17 at 4:34
  • Can you drop the FK as suggested in my answer on your test environment please? – Jonathan Ribas Mar 8 '17 at 7:44

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.