Undefined variable $projectRoot in /app/config/paths.php on line 15

Hi,

I just tried to install mautic5 locally. I’m getting this error, when trying to start it up for the first time (loading the installer page):

/var/www/mautic5/httpd_server.log

[Tue Nov 28 12:12:03.072004 2023] [proxy_fcgi:error] [pid 46050] [client 127.0.0.1:37314] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $projectRoot in /var/www/mautic5/app/config/paths.php on line 15'

Installation via composer install ran through without problems.

I didn’t touch any config files.

From looking at the config files it seems $projectRoot should be set automatically in /var/www/mautic5/app/config/config.php (L12)

Is there anything that I missed to set up?


local set-up

I’m running apache on Linux

$ php81 -v
PHP 8.1.26 (cli) (built: Nov 26 2023 15:30:56) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.26, Copyright (c) Zend Technologies

Apache - httpd-vhosts.conf

<VirtualHost *:80>
  DocumentRoot "/var/www/mautic5/"
  ServerName m5.local
  ErrorLog "/var/www/mautic5/httpd_server.log"

  <Directory /var/www/mautic5>
    AllowOverride All
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php81-fpm/php-fpm.sock|fcgi://localhost"
    </FilesMatch>
  </Directory>
</VirtualHost>

Is there a full stack trace bellow that error? It may be coming from other place than from the config.php. For example, I found that the $projectRoot var is not set in https://github.com/mautic/mautic/blob/a5be677a3389d2cee556b2a92d495e4c7683a6c5/app/bundles/CoreBundle/ErrorHandler/ErrorHandler.php#L494

So if it’s coming from there it may be the right place.

Unfortunately no. I had included it.

The /installer page simply says:

The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.

httpd.log holds the line above. PHP log doesn’t log any additional errors.

php.ini has error logging enabled:

display_errors = On
display_startup_errors = On
log_errors = On
ignore_repeated_errors = Off
error_reporting = E_ALL
error_log = syslog

Syslog just has the same line without any further back trace.

The problem is: paths.php#L15

if (file_exists($projectRoot.'/config/paths_local.php')) {

It seems that projectRoot hasn’t been set by config.php#L12 at that point. Or it is null for some reason.

$projectRoot = $container->getParameter('kernel.project_dir');

edit: created a .env.local:

APP_ENV=dev
APP_DEBUG=1

Basically the same result, now the error shows up on the webpage, too. But also /wo stack trace.

Is there a config file that I need to create before running the installer web-flow?

what about logs under /var/logs?

The error above can also happen if there are errors in plugins.

What happens if you run php bin/console mautic:plugins:reload --env=dev

Does it output any other errors? The output is generally more useful then the one displayed in browser.

Also, I would suggest installing mautic via CLI instead of Web UI.

Regards, M.

missing php extensions

Found one problem. php uses php82 by default. I ran php composer install. It didn’t complain, but it failed to tell me that I forgot to install certain needed php81 extensions.

I just ran php81 /usr/bin/composer update and it told me that php81-zip and two other extensions were missing.

Installed them, ran php81 /usr/bin/composer update again. Every dependency is now installed for php81, too.

“db_driver” under “fos_oauth_server” must be configured

Web installer shows the same error message. php81 bin/console mautic:plugins:reload is different.

$ php81 bin/console mautic:plugins:reload

In ArrayNode.php line 226:
                                                                             
  The child config "db_driver" under "fos_oauth_server" must be configured. 

.env.local

APP_ENV=dev
APP_DEBUG=1

DB_HOST=localhost
DB_PORT=3306
DB_NAME=mautic
DB_USER=mautic
DB_PASSWD=REDACTED

./app/config/config_local.php

<?php
    $parameters = array(
        'db_driver' => 'pdo_mysql',
        'db_host' => 'localhost',
        'db_table_prefix' => null,
        'db_port' => '3306',
        'db_name' => 'mautic',
        'db_user' => 'mautic',
        'db_password' => 'REDACTED',
);

Make sure you have mysql php extension installed for 8.1

Double-checked. I just installed any php81 extensions I could find, just to make extra sure. Same error.

Cleared cache, multiple times.

Local MySQL server is mariaDB. Might that be the problem?

$ php81 -info | grep mysql

/etc/php81/conf.d/10-mysqlnd.ini,
/etc/php81/conf.d/20-mysqli.ini,
/etc/php81/conf.d/20-pdo_mysql.ini,
mysqli
Client API library version => mysqlnd 8.1.26
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => /run/mysqld/mysqld.sock => /run/mysqld/mysqld.sock
mysqli.default_user => no value => no value
mysqli.local_infile_directory => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 8.1.26
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password
API Extensions => mysqli,pdo_mysql
mysqlnd => enabled
PDO drivers => dblib, firebird, mysql, odbc, pgsql, sqlite, sqlsrv
pdo_mysql
Client API version => mysqlnd 8.1.26
pdo_mysql.default_socket => /run/mysqld/mysqld.sock => /run/mysqld/mysqld.sock

Something strange is happening here.

You should have to change any db_driver. Can you clear the cache with the rm -rf var/cache/dev/* var/cache/prod/*

and run plugins:reload with -vv flag?

How did you install mautic exactly? The local config in mautic 5 should be under /config/local.php.

Regards, M.

Absolutely. Thank your for your help and patience so far.

I wiped the installation and redid it to better document what I did. Here’s how I tried to install:

  1. download the RC zip and unzip it
  2. cd’ed into mautic dir and installed it via composer
$ cd /var/www/mautic5
$ php81 /usr/bin/composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 49 installs, 0 updates, 0 removals
  - Downloading phpstan/phpstan (1.10.30)
  - Downloading phpstan/extension-installer (1.3.0)
  - Downloading friendsofphp/php-cs-fixer (v3.14.1)
  - Downloading symfony/browser-kit (v5.4.21)
  - Downloading sebastian/type (3.0.0)
  - Downloading sebastian/recursion-context (4.0.4)
  - Downloading sebastian/exporter (4.0.4)
  - Downloading sebastian/environment (5.1.4)
  - Downloading sebastian/comparator (4.0.6)
  - Downloading phpunit/php-code-coverage (9.2.15)
  - Downloading phpspec/prophecy (v1.15.0)
  - Downloading myclabs/deep-copy (1.11.0)
  - Downloading phpunit/phpunit (9.5.20)
  - Downloading liip/functional-test-bundle (4.9.0)
  - Downloading phpstan/phpstan-deprecation-rules (1.1.3)
  - Downloading phpstan/phpstan-doctrine (1.3.40)
  - Downloading phpstan/phpstan-phpunit (1.3.13)
  - Downloading phpstan/phpstan-symfony (1.3.2)
  - Downloading rector/rector (0.18.0)
  - Downloading symfony/phpunit-bridge (v5.4.23)
  - Downloading symfony/web-profiler-bundle (v5.4.21)
  - Installing phpstan/phpstan (1.10.30): Extracting archive
  - Installing phpstan/extension-installer (1.3.0): Extracting archive
  - Installing sebastian/diff (4.0.4): Extracting archive
  - Installing friendsofphp/php-cs-fixer (v3.14.1): Extracting archive
  - Installing http-interop/http-factory-guzzle (1.2.0): Extracting archive
  - Installing symfony/dom-crawler (v5.4.22): Extracting archive
  - Installing symfony/browser-kit (v5.4.21): Extracting archive
  - Installing sebastian/version (3.0.2): Extracting archive
  - Installing sebastian/type (3.0.0): Extracting archive
  - Installing sebastian/resource-operations (3.0.3): Extracting archive
  - Installing sebastian/recursion-context (4.0.4): Extracting archive
  - Installing sebastian/object-reflector (2.0.4): Extracting archive
  - Installing sebastian/object-enumerator (4.0.4): Extracting archive
  - Installing sebastian/global-state (5.0.5): Extracting archive
  - Installing sebastian/exporter (4.0.4): Extracting archive
  - Installing sebastian/environment (5.1.4): Extracting archive
  - Installing sebastian/comparator (4.0.6): Extracting archive
  - Installing sebastian/code-unit (1.0.8): Extracting archive
  - Installing sebastian/cli-parser (1.0.1): Extracting archive
  - Installing phpunit/php-timer (5.0.3): Extracting archive
  - Installing phpunit/php-text-template (2.0.4): Extracting archive
  - Installing phpunit/php-invoker (3.1.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  - Installing theseer/tokenizer (1.2.1): Extracting archive
  - Installing sebastian/lines-of-code (1.0.3): Extracting archive
  - Installing sebastian/complexity (2.0.2): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  - Installing phpunit/php-code-coverage (9.2.15): Extracting archive
  - Installing webmozart/assert (1.11.0): Extracting archive
  - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  - Installing phpdocumentor/type-resolver (1.7.1): Extracting archive
  - Installing phpdocumentor/reflection-docblock (5.3.0): Extracting archive
  - Installing phpspec/prophecy (v1.15.0): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.11.0): Extracting archive
  - Installing phpunit/phpunit (9.5.20): Extracting archive
  - Installing liip/functional-test-bundle (4.9.0): Extracting archive
  - Installing liip/test-fixtures-bundle (2.6.0): Extracting archive
  - Installing mautic/transifex (5.0.0): Extracting archive
  - Installing phpstan/phpstan-deprecation-rules (1.1.3): Extracting archive
  - Installing phpstan/phpstan-doctrine (1.3.40): Extracting archive
  - Installing phpstan/phpstan-php-parser (1.1.0): Extracting archive
  - Installing phpstan/phpstan-phpunit (1.3.13): Extracting archive
  - Installing phpstan/phpstan-symfony (1.3.2): Extracting archive
  - Installing rector/rector (0.18.0): Extracting archive
  - Installing symfony/maker-bundle (v1.48.0): Extracting archive
  - Installing symfony/phpunit-bridge (v5.4.23): Extracting archive
  - Installing symfony/web-profiler-bundle (v5.4.21): Extracting archive
Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
Package phpstan/phpstan-php-parser is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
150 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
> composer/composer: installed
> phpstan/phpstan-deprecation-rules: installed
> phpstan/phpstan-doctrine: installed
> phpstan/phpstan-php-parser: installed
> phpstan/phpstan-phpunit: installed
> phpstan/phpstan-symfony: installed
> php -r "if(file_exists('./.git')&&file_exists('./build/hooks/pre-commit'.(PHP_OS=='WINNT'?'.win':''))){copy('./build/hooks/pre-commit'.(PHP_OS=='WINNT'?'.win':''),'./.git/hooks/pre-commit');} if(file_exists('./.git')&&file_exists('./build/hooks/post-checkout')){copy('./build/hooks/post-checkout','./.git/hooks/post-checkout');}"
> php -r "if(file_exists('./.git/hooks/pre-commit')&&(PHP_OS!='WINNT')){chmod('./.git/hooks/pre-commit',0755);} if(file_exists('./.git/hooks/post-checkout')&&(PHP_OS!='WINNT')){chmod('./.git/hooks/post-checkout',0755);}"
> find . -mindepth 2 -type d -name .git | xargs rm -rf
> npm ci --prefer-offline --no-audit
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

> mautic@0.0.0 postinstall
> node_modules/modernizr/bin/modernizr -c modernizr-config.json -d node_modules/modernizr/modernizr-mautic-dist.js & npm run build

Modernizr build saved to node_modules/modernizr/modernizr-mautic-dist.js

> mautic@0.0.0 build
> webpack --mode production  --config webpack.config.js

asset ckeditor.js 1.24 MiB [compared for emit] [minimized] [big] (name: main) 2 related assets
asset translations/bn.js 14.9 KiB [emitted] [minimized]
asset translations/th.js 14.7 KiB [emitted] [minimized]
asset translations/el.js 13.7 KiB [emitted] [minimized]
asset translations/ru.js 13.4 KiB [emitted] [minimized]
asset translations/bg.js 13.2 KiB [emitted] [minimized]
asset translations/uk.js 13 KiB [emitted] [minimized]
asset translations/sr.js 12 KiB [emitted] [minimized]
asset translations/ar.js 11.2 KiB [emitted] [minimized]
asset translations/he.js 10.5 KiB [emitted] [minimized]
asset translations/ja.js 10.1 KiB [emitted] [minimized]
asset translations/vi.js 9.89 KiB [emitted] [minimized]
asset translations/it.js 9.68 KiB [emitted] [minimized]
asset translations/lt.js 9.55 KiB [emitted] [minimized]
+ 56 assets
orphan modules 4.94 MiB [orphan] 1529 modules
runtime modules 919 bytes 5 modules
cacheable modules 4.87 MiB
  modules by path ./node_modules/@ckeditor/ 398 KiB 74 modules
  modules by path ./node_modules/color-convert/*.js 20.5 KiB
    ./node_modules/color-convert/index.js 1.67 KiB [built] [code generated]
    ./node_modules/color-convert/conversions.js 16.6 KiB [built] [code generated]
    ./node_modules/color-convert/route.js 2.2 KiB [built] [code generated]
  modules by path ./node_modules/css-loader/dist/runtime/*.js 3.84 KiB
    ./node_modules/css-loader/dist/runtime/cssWithMappingToString.js 2.27 KiB [built] [code generated]
    ./node_modules/css-loader/dist/runtime/api.js 1.57 KiB [built] [code generated]
  ./app/assets/libraries/ckeditor/src/ckeditor.ts + 1016 modules 4.45 MiB [built] [code generated]
  ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js 6.67 KiB [built] [code generated]
  ./node_modules/color-name/index.js 4.51 KiB [built] [code generated]
webpack 5.88.2 compiled successfully in 19326 ms

added 597 packages in 28s

73 packages are looking for funding
  run `npm fund` for details
> npx patch-package
patch-package 7.0.2
Applying patches...
at.js@1.5.4 ✔
chosen-js@1.8.7 ✔
> bin/console mautic:assets:generate
Production assets have been regenerated.
  1. set vars in .env.local
/var/www/mautic5 $ echo "APP_DEBUG=1" > .env.local 
/var/www/mautic5 $ echo "" >> .env.local
/var/www/mautic5 $ echo "DB_HOST=localhost" >> .env.local 
/var/www/mautic5 $ echo "DB_PORT=3306" >> .env.local 
/var/www/mautic5 $ echo "DB_NAME=mautic" >> .env.local 
/var/www/mautic5 $ echo "DB_USER=mautic" >> .env.local 
/var/www/mautic5 $ echo "DB_PASSWD=REDACTED" >> .env.local 
  1. create /var/www/mautic5/config/config_local.php
<?php
$parameters = array(
    'db_host' => 'localhost',
    'db_table_prefix' => null,
    'db_port' => '3306',
    'db_name' => 'mautic',
    'db_user' => 'mautic',
    'db_password' => 'REDACTED',
);
  1. load web installer ⇒ Error 500
  2. run plugin reload:
$ php81 bin/console mautic:plugins:reload -vv

In ExceptionConverter.php line 101:
                                                                                                                          
  [Doctrine\DBAL\Exception\ConnectionException (1045)]                                                                    
  An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)  
                                                                                                                          

Exception trace:
  at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:101
 Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1935
 Doctrine\DBAL\Connection->handleDriverException() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1884
 Doctrine\DBAL\Connection->convertException() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:377
 Doctrine\DBAL\Connection->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1652
 Doctrine\DBAL\Connection->getWrappedConnection() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1079
 Doctrine\DBAL\Connection->executeQuery() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php:31
 Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:325
 Doctrine\ORM\Query->_doExecute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1212
 Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1166
 Doctrine\ORM\AbstractQuery->execute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:901
 Doctrine\ORM\AbstractQuery->getResult() at /var/www/mautic5/app/bundles/CoreBundle/Entity/CommonRepository.php:389
 Mautic\CoreBundle\Entity\CommonRepository->getEntities() at /var/www/mautic5/app/bundles/PluginBundle/Entity/PluginRepository.php:42
 Mautic\PluginBundle\Entity\PluginRepository->getEntities() at /var/www/mautic5/app/bundles/CoreBundle/Model/AbstractCommonModel.php:138
 Mautic\CoreBundle\Model\AbstractCommonModel->getEntities() at /var/www/mautic5/app/bundles/PluginBundle/Model/PluginModel.php:106
 Mautic\PluginBundle\Model\PluginModel->getInstalledPlugins() at /var/www/mautic5/app/bundles/PluginBundle/Facade/ReloadFacade.php:34
 Mautic\PluginBundle\Facade\ReloadFacade->reloadPlugins() at /var/www/mautic5/app/bundles/PluginBundle/Command/ReloadCommand.php:37
 Mautic\PluginBundle\Command\ReloadCommand->execute() at /var/www/mautic5/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/www/mautic5/vendor/symfony/console/Application.php:1058
 Symfony\Component\Console\Application->doRunCommand() at /var/www/mautic5/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/mautic5/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /var/www/mautic5/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/mautic5/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/www/mautic5/bin/console:16

In Exception.php line 28:
                                                                                     
  [Doctrine\DBAL\Driver\PDO\Exception (1045)]                                        
  SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)  
                                                                                     

Exception trace:
  at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28
 Doctrine\DBAL\Driver\PDO\Exception::new() at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:40
 Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29
 Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Logging/Driver.php:34
 Doctrine\DBAL\Logging\Driver->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29
 Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect() at /var/www/mautic5/vendor/symfony/doctrine-bridge/Middleware/Debug/Driver.php:41
 Symfony\Bridge\Doctrine\Middleware\Debug\Driver->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:375
 Doctrine\DBAL\Connection->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1652
 Doctrine\DBAL\Connection->getWrappedConnection() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1079
 Doctrine\DBAL\Connection->executeQuery() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php:31
 Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:325
 Doctrine\ORM\Query->_doExecute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1212
 Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1166
 Doctrine\ORM\AbstractQuery->execute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:901
 Doctrine\ORM\AbstractQuery->getResult() at /var/www/mautic5/app/bundles/CoreBundle/Entity/CommonRepository.php:389
 Mautic\CoreBundle\Entity\CommonRepository->getEntities() at /var/www/mautic5/app/bundles/PluginBundle/Entity/PluginRepository.php:42
 Mautic\PluginBundle\Entity\PluginRepository->getEntities() at /var/www/mautic5/app/bundles/CoreBundle/Model/AbstractCommonModel.php:138
 Mautic\CoreBundle\Model\AbstractCommonModel->getEntities() at /var/www/mautic5/app/bundles/PluginBundle/Model/PluginModel.php:106
 Mautic\PluginBundle\Model\PluginModel->getInstalledPlugins() at /var/www/mautic5/app/bundles/PluginBundle/Facade/ReloadFacade.php:34
 Mautic\PluginBundle\Facade\ReloadFacade->reloadPlugins() at /var/www/mautic5/app/bundles/PluginBundle/Command/ReloadCommand.php:37
 Mautic\PluginBundle\Command\ReloadCommand->execute() at /var/www/mautic5/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/www/mautic5/vendor/symfony/console/Application.php:1058
 Symfony\Component\Console\Application->doRunCommand() at /var/www/mautic5/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/mautic5/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /var/www/mautic5/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/mautic5/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/www/mautic5/bin/console:16

In Driver.php line 34:
                                                                                     
  [PDOException (1045)]                                                              
  SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)  
                                                                                     

Exception trace:
  at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34
 PDO->__construct() at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34
 Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29
 Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Logging/Driver.php:34
 Doctrine\DBAL\Logging\Driver->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29
 Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect() at /var/www/mautic5/vendor/symfony/doctrine-bridge/Middleware/Debug/Driver.php:41
 Symfony\Bridge\Doctrine\Middleware\Debug\Driver->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:375
 Doctrine\DBAL\Connection->connect() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1652
 Doctrine\DBAL\Connection->getWrappedConnection() at /var/www/mautic5/vendor/doctrine/dbal/src/Connection.php:1079
 Doctrine\DBAL\Connection->executeQuery() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php:31
 Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:325
 Doctrine\ORM\Query->_doExecute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1212
 Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1166
 Doctrine\ORM\AbstractQuery->execute() at /var/www/mautic5/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:901
 Doctrine\ORM\AbstractQuery->getResult() at /var/www/mautic5/app/bundles/CoreBundle/Entity/CommonRepository.php:389
 Mautic\CoreBundle\Entity\CommonRepository->getEntities() at /var/www/mautic5/app/bundles/PluginBundle/Entity/PluginRepository.php:42
 Mautic\PluginBundle\Entity\PluginRepository->getEntities() at /var/www/mautic5/app/bundles/CoreBundle/Model/AbstractCommonModel.php:138
 Mautic\CoreBundle\Model\AbstractCommonModel->getEntities() at /var/www/mautic5/app/bundles/PluginBundle/Model/PluginModel.php:106
 Mautic\PluginBundle\Model\PluginModel->getInstalledPlugins() at /var/www/mautic5/app/bundles/PluginBundle/Facade/ReloadFacade.php:34
 Mautic\PluginBundle\Facade\ReloadFacade->reloadPlugins() at /var/www/mautic5/app/bundles/PluginBundle/Command/ReloadCommand.php:37
 Mautic\PluginBundle\Command\ReloadCommand->execute() at /var/www/mautic5/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/www/mautic5/vendor/symfony/console/Application.php:1058
 Symfony\Component\Console\Application->doRunCommand() at /var/www/mautic5/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/mautic5/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /var/www/mautic5/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/mautic5/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/www/mautic5/bin/console:16

mautic:plugins:reload

And now there’s a different error. But I like that more as it seems solvable. Somehow Mautic doesn’t load the DB settings in .env.local or /var/www/mautic5/config/config_local.php.

edit

I noticed I named the config file wrongly.

$ mv config/config_local.php config/local.php
$ rm -rf var/cache/*

It seems to load now :man_facepalming: Absolutely embarrassing :sweat_smile:.

2 Likes