I am getting the following error during setup:upgrade:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'NEW', query was: CREATE TRIGGER trg_catalog_product_entity_int_after_insert AFTER INSERT ON catalog_product_entity_int FOR EACH ROW

Can anyone please help me to know how to resolve this error.
Thanks in advance.

  • are u devloping a custom module??
    – Waqar Ali
    Commented Aug 30, 2019 at 6:47
  • No, actually I disabled some of the modules of enterprise edition and run setup:upgrade command. Commented Aug 30, 2019 at 7:15
  • maybe you have disabled any core module which in used in another module so don't disable core module..
    – Waqar Ali
    Commented Aug 30, 2019 at 7:16
  • See magento.stackexchange.com/questions/134667/…
    – kirkmadera
    Commented Apr 5, 2021 at 15:02

2 Answers 2

  • Please check the module which throws this error.
  • Check its update/upgrade scripts.
  • Try to disable a module if it's not necessary.
  • Check DB integrity. (the module may expect that the column exists)
  • Try to downgrade the module version in module_setup table and see which version adds the column in the setup script/patch and run setup:upgrade again

Some modules have a folder called Setup. The files in Setup modify the database in some way and are run during magento setup:upgrade.

In your case if you have a new installation make sure you have an available database server and that it is accessible. Also check that app/etc/env.php reference that server.

If you had a working installation then check any newly installed modules. You can disable them with magento module:disable module_name and then run magento setup:upgrade to see if it works better.

You could also search for the error in the code but 'entity_id' and 'NEW' is just too common. If you have more information it would be easier to give an advice.

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.