View Issue Details

IDProjectCategoryView StatusLast Update
0006823OXID eShop (all versions)4.01. Database handlingpublic2018-05-03 15:51
Reportersmxsm 
PriorityhighSeveritymajorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version6.0.2 
Target VersionFixed in Version 
Summary0006823: Migrations broken
DescriptionIt looks like the migration functionality is broken in 6.0.2., no matter what migration (CE, EE, PE, PR) is executed, it always leads to a fatal error:

PHP Fatal error: Uncaught Doctrine\DBAL\Driver\Mysqli\MysqliException: Unsupported option '1002' with value 'SET @@SESSION.sql_mode='''
in ... /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php:237

It looks like this commit is responsible for the bug: https://github.com/OXID-eSales/oxideshop-doctrine-migration-wrapper/commit/cc9d230b8098c5ea53e4251e1b7951df565bee3b
Steps To ReproduceJust call e.g.
./vendor/bin/oe-eshop-db_migrate migrations:migrate EE

The migrations will not run, but a fatal error will be reported in error_log.txt

Tagsdoctrine, error, fatal, migration
ThemeNot defined
BrowserNot defined
PHP Version7.0
MySQL Version5.7

Activities

QA

2018-05-03 11:21

administrator   ~0012468

Not reproducible:
Tested 6.0.2 CE > PE > EE

Maybe wrong paramater. It should look like this (no edition at the end):
vendor/bin/oe-eshop-db_migrate migrations:migrate

smxsm

2018-05-03 14:35

reporter   ~0012469

Makes no difference, even without parameter the migrations give me fatal errors, also if I set an environment parameter "MIGRATION_SUITE" as explained here: https://docs.oxid-esales.com/developer/en/6.0/oxid_components/migrations.html

QA

2018-05-03 15:51

administrator   ~0012470

Reproducable when using mysqli instead of pdo_mysql as database type.

Steps to reproduce:
config.inc.php: $this->dbType = 'mysqli'
./vendor/bin/oe-eshop-db_migrate migrations:migrate

Loading configuration from command option: /var/www/html/e602/vendor/oxid-esales/oxideshop-facts/src/Config/../../../../../vendor/oxid-esales/oxideshop-ee/migration/migrations.yml
PHP Fatal error: Uncaught Doctrine\DBAL\Driver\Mysqli\MysqliException: Unsupported option '1002' with value 'SET @@SESSION.sql_mode=''' in /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php:237
Stack trace:
#0 /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php(66): Doctrine\DBAL\Driver\Mysqli\MysqliConnection->setDriverOptions(Array)
#1 /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php(36): Doctrine\DBAL\Driver\Mysqli\MysqliConnection->__construct(Array, 'root', 'root', Array)
#2 /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\Mysqli\Driver->connect(Array, 'root', 'root', Array)
#3 /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): Doctrine\DBAL\Connection->connect()
#4 /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#5 /var/www/html/e602/vendor/do in /var/www/html/e602/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 115

smxsm

2018-05-03 15:51

reporter   ~0012471

We solved the mystery in the skype channel - since the project is a migration, we somehow ended up with

$this->dbType = 'mysqli';

in config.inc.php - if I change that to

$this->dbType = 'pdo_mysql';

the migrations are running again :)
Thanks @Michael Keiluweit!