magento-2-smtp icon indicating copy to clipboard operation
magento-2-smtp copied to clipboard

Magento 2.4.2 installation fails with module

Open rk-mxp opened this issue 3 years ago • 36 comments

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

  1. remove mageplaza/module-smtp from my composer.lock
  2. install magento
  3. revert composer.lock with git
  4. composer install
  5. bin/magento setup:upgrade

rk-mxp avatar Jun 17 '21 06:06 rk-mxp

Hi,

Please let me know what version of the SMTP module you are using. Thank you!

HuyPhuc98 avatar Jun 17 '21 06:06 HuyPhuc98

The most current version: 4.4.0

rk-mxp avatar Jun 17 '21 06:06 rk-mxp

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!

HuyPhuc98 avatar Jun 17 '21 06:06 HuyPhuc98

I tried, but I get the same error. Would have been stange if not.

rk-mxp avatar Jun 17 '21 09:06 rk-mxp

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

HuyPhuc98 avatar Jun 19 '21 15:06 HuyPhuc98

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.

rk-mxp avatar Jun 21 '21 05:06 rk-mxp

+1

lorenzofaresin avatar Jun 21 '21 08:06 lorenzofaresin

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!

HuyPhuc98 avatar Jun 22 '21 03:06 HuyPhuc98

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.

rk-mxp avatar Jun 22 '21 05:06 rk-mxp

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.

damienwebdev avatar Jun 23 '21 17:06 damienwebdev

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.

aeroflowdev avatar Jun 23 '21 18:06 aeroflowdev

A dependency to Magento_Customer should be added in https://github.com/mageplaza/magento-2-smtp/blob/2.4/etc/module.xml

owebia avatar Jul 02 '21 19:07 owebia

This also happens with 2.3.6-p1 with version 1.8.1

PauloPhagula avatar Jul 10 '21 16:07 PauloPhagula

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

falconDive avatar Jul 13 '21 03:07 falconDive

@HuyPhuc98 I noticed a new release (1.9.0 ) was issued yesterday. I wanted to know the release covers this issue?

PauloPhagula avatar Jul 14 '21 13:07 PauloPhagula

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": ""
            },
...            

aeroflowdev avatar Jul 14 '21 15:07 aeroflowdev

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

owebia avatar Jul 15 '21 08:07 owebia

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 avatar Jul 15 '21 10:07 HuyPhuc98

@HuyPhuc98 Is there any update on this? The issue still persists.

torhoehn avatar Aug 11 '21 06:08 torhoehn

Our workaround is to use the following in composer.json

        "mageplaza/module-smtp": "dev-master",

which works fine.

riconeitzel avatar Sep 06 '21 08:09 riconeitzel

Hi @HuyPhuc98 I'm facing issue on Magento version 2.4.2 - Community Edition

ngtuan96lc avatar Nov 30 '21 08:11 ngtuan96lc

Faced error when install 2.4.3-p1

Solution: Disable 2 module Mageplaza Core + SMTP -> Continue install -> Enable 2 module disable before

tuanhaviet22 avatar Dec 01 '21 03:12 tuanhaviet22

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.

rafczow avatar Dec 06 '21 14:12 rafczow

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 avatar Jan 06 '22 15:01 pisicabogdan

@pisicabogdan Could you please create a PR for that?

torhoehn avatar Jan 06 '22 18:01 torhoehn

Still having this issue and it also destroys our deployment process.

mobweb avatar Jan 25 '22 06:01 mobweb

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?

Maksold avatar Mar 17 '22 13:03 Maksold

I can confirm that the problem still persists with Magento 2.4.3-p1 and mageplaza/modul-smtp 4.7.0

jean-bernard-valentaten avatar Mar 30 '22 19:03 jean-bernard-valentaten

Same problem here... :/ magento 2.4.3, when is this gonna be fixed?

robinjoh avatar Apr 05 '22 14:04 robinjoh

Will probably never install this extension on my projects anymore :)

novikor avatar Apr 21 '22 14:04 novikor

@novikor Do you have any alternative to the Mageplaza module?

Maksold avatar Apr 22 '22 05:04 Maksold

https://github.com/mageplaza/magento-2-blog/issues/337#issuecomment-1140956455

vasylmalanka avatar May 30 '22 10:05 vasylmalanka

@novikor Do you have any alternative to the Mageplaza module?

Magepal, is also free and available on Github

novikor avatar Jun 01 '22 12:06 novikor

@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 :(

Maksold avatar Jun 01 '22 12:06 Maksold

@HuyPhuc98 @Victor-Mageplaza @Shinichi69 @phuc @imsamthomas @haitv282 Please check pull request to finally close this issue?

Maksold avatar Jul 29 '22 07:07 Maksold

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

UNCErickSaravia avatar Aug 30 '22 20:08 UNCErickSaravia