View Issue Details

IDProjectCategoryView StatusLast Update
0007240OXID eShop (all versions)7. --- Other tools --------------public2024-03-06 15:05
ReporterAlex Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status confirmedResolutionopen 
Product Version6.3.0 
Summary0007240: Database options from config.inc.php are not used in migrations-db.php
DescriptionWhen connecting to a MySQL-Server with SSL enabled we need to specify the certificates within the dbDriverOptions (config.inc.php), for example like this:
$this->dbDriverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES utf8";
$this->dbDriverOptions[PDO::MYSQL_ATTR_SSL_CA] = "/app/certs/proxysql-ca.pem";
$this->dbDriverOptions[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = false;

These parameters are not used within the migrations-db.php which leads to an error on connecting to the database:
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] ProxySQL Error: Access denied for user 'erfalstaging' (using password: YES). SSL is required in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:38
Stack trace:
#0 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(38): PDO->__construct('mysql:host=XXX...', 'XXXX', 'XXX...', Array)
#1 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(24): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=erfal...', 'XXX', 'XXX...', Array)
#2 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'XXX', 'XXX...', Array)
#3 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(427): Doctrine\DBAL\Connection->connect()
#4 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(387): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#5 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(330 in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 112

Steps To Reproduce- enforce SSL to DB-Server
- specify SSL-Settings in config.inc.php
- run vendor/bin/oe-eshop-db_migrate migrations:migrate
Additional Informationvendor/bin/oe-eshop-db_views_generate seems to work perfect - only the migration is not using the driverOptions from the config file.
There might be other Scripts, that ignore the dirverOptions - I haven't checked everything.

PHP-Version: 8.0.3
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionOther
Database VersionMySQL 5.7

Relationships

related to 0006869 confirmedSvenBrunk Add support for --dry-run and --write-sql options 
has duplicate 0007605 closedQA DB migration does not use dbDriverOptions from config.inc.php 

Activities

QA

2021-05-12 14:21

administrator   ~0013440

- MK