magento-2-smtp
magento-2-smtp copied to clipboard
Magento 2.4.2 installation fails with module
When installing Magento 2.4.2 with bin/magento setup:install
the installation fails with
Module 'Mageplaza_Smtp':
Installing schema...
In Config.php line 449:
Invalid entity_type specified: customer
As a workaround I have to
- remove
mageplaza/module-smtp
from my composer.lock - install magento
- revert composer.lock with git
- composer install
- bin/magento setup:upgrade
Hi,
Please let me know what version of the SMTP module you are using. Thank you!
The most current version: 4.4.0
Try reinstalling the SMTP module manually by placing the SMTP module in the app/code/Mageplaza directory. Then run the command setup and deploy.
Try it and let me know the results. Thank you!
I tried, but I get the same error. Would have been stange if not.
Have you tried deleting the SMTP module, then installing Magento 2.4.2, when the Magento 2.4.2 installation is successful, then you proceed to reinstall the SMTP module? Thank you
Yes, that is exactly the workaround I described. I am able to install Magento 2.4.2 that way but cannot do it with the SMTP Module present during installation.
+1
Please try to install Magento 2.4.2 without the appearance of the SMTP module. After successfully installing Magento 2.4.2, please try to install the SMTP module. Thank you!
Like I said in several comments, this DOES work (and I already did that). The bug is that I cannot install Magento with the module present. Yes i CAN remove the module, install Magento and then install the module (I wrote that in the initial comment already). But this will break all kinds of automated scripts and make installation more complicated. Not being able to install Magento with the module is very clearly a bug and I kindly ask to check what the bug is and to fix it.
To reiterate: Yes, you CAN install Magento by removing the module first but it is a WORKAROUND that should be fixed.
Confirming that this is still an issue in v4.4.1. @Barakur is correct. Having this module installed should not prevent me from installing Magento 2.
While we all appreciate the suggested workaround, it is not a sufficient solution here.
We essentially run setup:install on every Magento deployment in our automated deployment pipeline regardless if it is a new install or updating an existing system. This is a show stopper for us until we are able to run setup:install with this module installed. This issue is currently preventing us from upgrading Magento to 2.4.2-p1. Please advise.
A dependency to Magento_Customer
should be added in https://github.com/mageplaza/magento-2-smtp/blob/2.4/etc/module.xml
This also happens with 2.3.6-p1 with version 1.8.1
Same issue in Mag 2.4, Tried adding "magento/module-customer" but it seems to throw another error and break : have Invalid Argument supplied for foreach()
for anyone facing this issue , fixed the issue by downgrading to version 4.3.2 , issue is specific to later versions
@HuyPhuc98 I noticed a new release (1.9.0 ) was issued yesterday. I wanted to know the release covers this issue?
We just tried to install the latest module version released yesterday (4.5.0) and this issue persists.
bin/magento setup:install:
Module 'Mageplaza_Smtp':
Installing schema...
In Config.php line 449:
Invalid entity_type specified: customer
composer.lock:
...
{
"name": "mageplaza/module-smtp",
"version": "4.5.0",
"source": {
"type": "git",
"url": "https://github.com/mageplaza/magento-2-smtp.git",
"reference": "85c389b2ecf565e5d704131c6c2fbef4d40c9815"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mageplaza/magento-2-smtp/zipball/85c389b2ecf565e5d704131c6c2fbef4d40c9815",
"reference": "85c389b2ecf565e5d704131c6c2fbef4d40c9815",
"shasum": ""
},
...
I made some tests and it seems that adding a sequence in etc/module.xml is not enough.
The installation process fails when trying to instantiate Setup\UpgradeSchema.php
.
One solution is to always use $setup->getConnection()
instead of getting the connection from different resource models (currently Magento\Quote\Model\ResourceModel\Quote
, Magento\Sales\Model\ResourceModel\Order
, Magento\Customer\Model\ResourceModel\Customer
, Magento\Newsletter\Model\ResourceModel\Subscriber
).
@HuyPhuc98 is there a particular reason why you get the connection from the resource models?
The other solution is to move to Declarative Schema
Sorry for the late response!
We are still in the process of checking this issue and will notify you when the check is complete. Thank you!
@HuyPhuc98 Is there any update on this? The issue still persists.
Our workaround is to use the following in composer.json
"mageplaza/module-smtp": "dev-master",
which works fine.
Hi @HuyPhuc98 I'm facing issue on Magento version 2.4.2 - Community Edition
Faced error when install 2.4.3-p1
Solution: Disable 2 module Mageplaza Core + SMTP -> Continue install -> Enable 2 module disable before
Its not a solution. Module breaks magento installation and all CI/CD pipelines. You shouldnt expect people to disable it everytime you run install command.
Until its fixed we decided to downgrade like @falconDive suggested:
composer require mageplaza/module-smtp:4.3.2
Magento 2.4.3 installation completes.
Hello! The problem still persists in the 4.7.2 module version and the 2.4.3-p1 magento version. I found the problem and the solution. The getContactCount() function in the EmailMarketing class is given a $customerSetup->getEavConfig()->getEntityType('customer') but without a condition whether it exists or not; I started from the assumption that Magento does not end up creating entity_type customer (in eav_entity_type table) when the module is installed and I put a check that if it exists, then create the attribute. @Victor-Mageplaza
@pisicabogdan Could you please create a PR for that?
Still having this issue and it also destroys our deployment process.
I still can't install the project without disabling your module. Each time faced with this bug is very annoying and makes a bad reputation to MagePlaza. ;((
@HuyPhuc98 @Victor-Mageplaza @Shinichi69 @phuc @imsamthomas @haitv282 Could you please check PR?
I can confirm that the problem still persists with Magento 2.4.3-p1 and mageplaza/modul-smtp
4.7.0
Same problem here... :/ magento 2.4.3, when is this gonna be fixed?
Will probably never install this extension on my projects anymore :)
@novikor Do you have any alternative to the Mageplaza module?
https://github.com/mageplaza/magento-2-blog/issues/337#issuecomment-1140956455
@novikor Do you have any alternative to the Mageplaza module?
Magepal, is also free and available on Github
@novikor Do you have any alternative to the Mageplaza module?
Magepal, is also free and available on Github
Unfortunately magepal module doesn't have a "Email logging" feature :(
@HuyPhuc98 @Victor-Mageplaza @Shinichi69 @phuc @imsamthomas @haitv282 Please check pull request to finally close this issue?
Our workaround is to use the following in composer.json
"mageplaza/module-smtp": "dev-master",
which works fine.
My solution:
composer remove mageplaza/module-smtp
composer require mageplaza/module-smtp:dev-master
bin/magento setup:install ...