Any ideas how to resolve below error please?

Installing schema... Upgrading schema... SQLSTATE[42S02]: Base table or view not found: 1146 Table 'm2.email_template' doesn't exist, query was: SELECT COUNT(*) FROM `email_template` WHERE (template_code = :template_code)

Using Magento 2.4.1 currently. Error occurs when running setup:upgrade command.

I can manually add the table in the database, but this doesn't resolve the error.

Perhaps permissions error where a module install doesn't have permission to create the table in database?

Any help greatly appreciated.

  • check this table exist or not "email_template" ?? – Rk Rathod Dec 31 '20 at 13:50
  • I've updated my description to say that I've manually added the table. Which works fine. Then when I run setup:upgrade the newly added table is deleted and the error appears again. – MagentoMac Dec 31 '20 at 13:58

Worked out our issue...... we had edited the config.php file directly. Which was suggested in a post here, but upon reading other posts, this is not a great idea and you should run commands to disable/enable modules, which we'll do from now on. Leaving this here in case others have the same issue in future. Limited information online on this it seems for the error messages generated.

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.