Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance Task DB logging broken under clustered MariaDB Master/Slave #4947

Open
AskeFC opened this issue Sep 6, 2019 · 0 comments

Comments

@AskeFC
Copy link

commented Sep 6, 2019

We installed Pimcore skeleton version 6.0.0 and since set up a cluster of MariaDB (10.4.7) servers where we configured the database.yml according to Pimcore documentation (https://pimcore.com/docs/6.x/Development_Documentation/Best_Practice/Master-Slave_Database_Connection.html).
This seemed to work fine but after updating to version 6.1.x something broke and we decided to keep the cluster for replication and backup purpose but otherwise go back to original database.yml configuration with only 1 default DB server used by Pimcore.
Now after upgrading to version 6.2.0 we still experience the problem, and in log files it says :

php.CRITICAL: Argument 1 passed to Pimcore\Maintenance\Tasks\LogMailMaintenanceTask::__construct() must be an instance of Pimcore\Db\Connection, instance of AppBundle\Db\Connection given, called in /var/www/html/var/cache/prod/ContainerZpB9QyL/getExecutorService.php on line 16 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Argument 1 passed to Pimcore\Maintenance\Tasks\LogMailMaintenanceTask::__construct() must be an instance of Pimcore\Db\Connection, instance of AppBundle\Db\Connection given, called in /var/www/html/var/cache/prod/ContainerZpB9QyL/getExecutorService.php on line 16 at /var/www/html/vendor/pimcore/pimcore/lib/Maintenance/Tasks/LogMailMaintenanceTask.php:32)"} []

Our temporary workaround/possible fix is now to change the Php type hint in construct methods from "Db\Connection" to "Db\ConnectionInterface" in the following files under \pimcore\lib\Maintenance\Tasks :
LogMailMaintenanceTask.php
LogErrorCleanupTask.php
LogArchiveTask.php
DbCleanupBrokenViewsTask.php
CheckErrorLogsDbTask.php
TmpStoreCleanupTask.php

Our database.yml looks like this :

doctrine:
dbal:
connections:
default:
wrapper_class: '\AppBundle\Db\Connection'
slaves:
slave1:
host: xxx.yyy
port: 3306
dbname: pimcore
user: pimcore
password: ?????
charset: UTF8MB4
slave2:
host: xxx.yyy
port: 3306
dbname: pimcore
user: pimcore
password: ?????
charset: UTF8MB4
slave3:
host: xxx.yyy
port: 3306
dbname: pimcore
user: pimcore
password: ?????
charset: UTF8MB4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.