TheDMSGroup / mautic-eb

Mautic + Elastic Beanstalk = Scalable marketing automation
https://www.mautic.org
GNU General Public License v3.0
105 stars 27 forks source link

Deploy command 74_mautic_plugins fails due to non-existing tables #109

Open miickel opened 5 years ago

miickel commented 5 years ago

What type of report is this:

Q A
Bug report? x
Feature request?
Enhancement?

Description:

Would love to see some more detailed install/deploy instructions for us new to AWS EBS. I had to guess quite a bit, and I still can't get mautic-eb to install properly. First it failed because EC2 wasn't able to connect to EFS, then same with RDS. Setting up a new security group with some options solved this.

Now however, the command 74_mautic_plugins errors because the mautic tables have not been added in the database.

Disclaimer: first time ever using AWS EBS.

Thanks for creating this project!

If a bug:

Q A
Mautic version origin/dev
PHP version 7.1

Steps to reproduce:

  1. eb init php 7.1, etc.
  2. eb create + envvars as in documentation. -> fails due to no access to EFS.
  3. add security group to environment to give access to EFS and RDS.
  4. eb deploy

Log errors:

[2019-06-04T15:27:21.998Z] INFO  [347]   - [Application update app-2_14_0-399-g3cbd-190604_172253@4/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_5_remente_email_mautic/Command 74_mautic_plugins] : Activity execution failed, because: 

  [Doctrine\DBAL\Exception\TableNotFoundException]
  An exception occurred while executing 'SELECT p0_.id AS id_0, p0_.name AS name_1, p0_.description AS description_2, p0_.is_missing AS is_missing_3, p0_.bundle AS bundle_4, p0_.version AS version_5, p0_.author AS author_6 FROM plugins p0_ ORDER BY p0_.name ASC':

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.plugins' doesn't exist

  Exception trace:
  () at /var/app/ondeck/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:53
  Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException() at /var/app/ondeck/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
  Doctrine\DBAL\DBALException::driverExceptionDuringQuery() at /var/app/ondeck/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:855
  Doctrine\DBAL\Connection->executeQuery() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php:50
  Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:321
  Doctrine\ORM\Query->_doExecute() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:962
  Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:917
  Doctrine\ORM\AbstractQuery->execute() at /var/app/ondeck/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:720
  Doctrine\ORM\AbstractQuery->getResult() at /var/app/ondeck/mautic/app/bundles/CoreBundle/Entity/CommonRepository.php:368
  Mautic\CoreBundle\Entity\CommonRepository->getEntities() at /var/app/ondeck/mautic/app/bundles/PluginBundle/Entity/PluginRepository.php:51
  Mautic\PluginBundle\Entity\PluginRepository->getEntities() at /var/app/ondeck/mautic/app/bundles/CoreBundle/Model/AbstractCommonModel.php:226
  Mautic\CoreBundle\Model\AbstractCommonModel->getEntities() at /var/app/ondeck/mautic/app/bundles/PluginBundle/Model/PluginModel.php:108
  Mautic\PluginBundle\Model\PluginModel->getInstalledPlugins() at /var/app/ondeck/mautic/app/bundles/PluginBundle/Facade/ReloadFacade.php:44
  Mautic\PluginBundle\Facade\ReloadFacade->reloadPlugins() at /var/app/ondeck/mautic/app/bundles/PluginBundle/Command/ReloadCommand.php:44
  Mautic\PluginBundle\Command\ReloadCommand->execute() at /var/app/ondeck/vendor/symfony/console/Command/Command.php:245
  Symfony\Component\Console\Command\Command->run() at /var/app/ondeck/vendor/symfony/console/Application.php:853
  Symfony\Component\Console\Application->doRunCommand() at /var/app/ondeck/vendor/symfony/console/Application.php:185
  Symfony\Component\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/framework-bundle/Console/Application.php:84
  Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/app/ondeck/vendor/symfony/console/Application.php:117
  Symfony\Component\Console\Application->run() at /var/app/ondeck/mautic/app/console:41
heathdutton commented 5 years ago

The database hasn't had the install ran yet... Try setting MAUTIC_INSTALL to 1 for one deployment.

totalcaos commented 5 years ago

I have the same issue, MAUTIC_INSTALL is set to 1,

totalcaos@build-host:~/Documents/mautic-eb$ eb printenv Environment Variables: APP_URL = mauticebtest.xxxx.com REDIS_HOST = mautic-eb-redis.xxxx.apse2.cache.amazonaws.com DB_HOST_RO = clientclusterxxxx-ap-southeast-2.rds.amazonaws.com MAUTIC_INSTALL = 1 EFS_DNS_NAME = fs-xxxx.efs.ap-southeast-2.amazonaws.com MAUTIC_WORKERS = 1 DB_PORT = 3306 MAILER_FROM_EMAIL = xxxx@xxxx.com DB_USER = xxxx DB_PASSWD = xxxx DB_NAME = mauticebdb DB_HOST = clientclusterxxxx.ap-southeast-2.rds.amazonaws.com SECRET_KEY = xxxx MAILER_FROM_NAME = xxxx

However, when I look at the eb logs: [2019-07-05T04:29:05.471Z] INFO [3169] - [Application deployment app-2_14_0-420-ge77d-190705_042547@18/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_5_mautic_eb/Command 72_mautic_install] : Completed activity. Result: [2019-07-05 04:29:03] Database mauticebdb for connection named default already exists. Skipped. Installing mautic This will replace all of the data currently in Mautic's tables. Are you sure you want to continue? [0] No [1] Yes

Output from aurora (db name = mauticebdb)

mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mautic_eb_multi | | mauticebdb | | mysql | | performance_schema | | tmp | +--------------------+ 6 rows in set (0.00 sec)

mysql> use mauticebdb; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed mysql> show tables; +----------------------+ | Tables_in_mauticebdb | +----------------------+ | migrations | +----------------------+ 1 row in set (0.00 sec) `