contao / installation-bundle

[READ-ONLY] Contao Installation Bundle
GNU Lesser General Public License v3.0
8 stars 9 forks source link

Installation with innodb_file_format = Antelope and innodb_large_prefix = On fails #91

Closed mlwebworker closed 6 years ago

mlwebworker commented 6 years ago

Wenn innodb_large_prefix an ist aber innodb_file_format nicht auf Barracuda steht tritt folgender Fehler auf

Doctrine\DBAL\Exception\DriverException:
An exception occurred while executing 'CREATE TABLE tl_files (id INT UNSIGNED AUTO_INCREMENT NOT NULL, pid BINARY(16) DEFAULT NULL, tstamp INT UNSIGNED DEFAULT 0 NOT NULL, uuid BINARY(16) DEFAULT NULL, type VARCHAR(16) DEFAULT '' NOT NULL, path VARCHAR(1022) DEFAULT '' NOT NULL, extension VARCHAR(16) DEFAULT '' NOT NULL, hash VARCHAR(32) DEFAULT '' NOT NULL, found CHAR(1) DEFAULT '1' NOT NULL, name VARCHAR(255) DEFAULT '' NOT NULL, importantPartX INT DEFAULT 0 NOT NULL, importantPartY INT DEFAULT 0 NOT NULL, importantPartWidth INT DEFAULT 0 NOT NULL, importantPartHeight INT DEFAULT 0 NOT NULL, meta BLOB DEFAULT NULL, INDEX pid (pid), UNIQUE INDEX uuid (uuid), INDEX path (path(768)), INDEX extension (extension), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC':

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.

  at vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:125
  at Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception occurred while executing \'CREATE TABLE tl_files (id INT UNSIGNED AUTO_INCREMENT NOT NULL, pid BINARY(16) DEFAULT NULL, tstamp INT UNSIGNED DEFAULT 0 NOT NULL, uuid BINARY(16) DEFAULT NULL, type VARCHAR(16) DEFAULT \'\' NOT NULL, path VARCHAR(1022) DEFAULT \'\' NOT NULL, extension VARCHAR(16) DEFAULT \'\' NOT NULL, hash VARCHAR(32) DEFAULT \'\' NOT NULL, found CHAR(1) DEFAULT \'1\' NOT NULL, name VARCHAR(255) DEFAULT \'\' NOT NULL, importantPartX INT DEFAULT 0 NOT NULL, importantPartY INT DEFAULT 0 NOT NULL, importantPartWidth INT DEFAULT 0 NOT NULL, importantPartHeight INT DEFAULT 0 NOT NULL, meta BLOB DEFAULT NULL, INDEX pid (pid), UNIQUE INDEX uuid (uuid), INDEX path (path(768)), INDEX extension (extension), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC\':SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.', object(PDOException))
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:184)
  at Doctrine\DBAL\DBALException::wrapException(object(Driver), object(PDOException), 'An exception occurred while executing \'CREATE TABLE tl_files (id INT UNSIGNED AUTO_INCREMENT NOT NULL, pid BINARY(16) DEFAULT NULL, tstamp INT UNSIGNED DEFAULT 0 NOT NULL, uuid BINARY(16) DEFAULT NULL, type VARCHAR(16) DEFAULT \'\' NOT NULL, path VARCHAR(1022) DEFAULT \'\' NOT NULL, extension VARCHAR(16) DEFAULT \'\' NOT NULL, hash VARCHAR(32) DEFAULT \'\' NOT NULL, found CHAR(1) DEFAULT \'1\' NOT NULL, name VARCHAR(255) DEFAULT \'\' NOT NULL, importantPartX INT DEFAULT 0 NOT NULL, importantPartY INT DEFAULT 0 NOT NULL, importantPartWidth INT DEFAULT 0 NOT NULL, importantPartHeight INT DEFAULT 0 NOT NULL, meta BLOB DEFAULT NULL, INDEX pid (pid), UNIQUE INDEX uuid (uuid), INDEX path (path(768)), INDEX extension (extension), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC\':SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.')
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:158)
  at Doctrine\DBAL\DBALException::driverExceptionDuringQuery(object(Driver), object(PDOException), 'CREATE TABLE tl_files (id INT UNSIGNED AUTO_INCREMENT NOT NULL, pid BINARY(16) DEFAULT NULL, tstamp INT UNSIGNED DEFAULT 0 NOT NULL, uuid BINARY(16) DEFAULT NULL, type VARCHAR(16) DEFAULT \'\' NOT NULL, path VARCHAR(1022) DEFAULT \'\' NOT NULL, extension VARCHAR(16) DEFAULT \'\' NOT NULL, hash VARCHAR(32) DEFAULT \'\' NOT NULL, found CHAR(1) DEFAULT \'1\' NOT NULL, name VARCHAR(255) DEFAULT \'\' NOT NULL, importantPartX INT DEFAULT 0 NOT NULL, importantPartY INT DEFAULT 0 NOT NULL, importantPartWidth INT DEFAULT 0 NOT NULL, importantPartHeight INT DEFAULT 0 NOT NULL, meta BLOB DEFAULT NULL, INDEX pid (pid), UNIQUE INDEX uuid (uuid), INDEX path (path(768)), INDEX extension (extension), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC')
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1037)
  at Doctrine\DBAL\Connection->query('CREATE TABLE tl_files (id INT UNSIGNED AUTO_INCREMENT NOT NULL, pid BINARY(16) DEFAULT NULL, tstamp INT UNSIGNED DEFAULT 0 NOT NULL, uuid BINARY(16) DEFAULT NULL, type VARCHAR(16) DEFAULT \'\' NOT NULL, path VARCHAR(1022) DEFAULT \'\' NOT NULL, extension VARCHAR(16) DEFAULT \'\' NOT NULL, hash VARCHAR(32) DEFAULT \'\' NOT NULL, found CHAR(1) DEFAULT \'1\' NOT NULL, name VARCHAR(255) DEFAULT \'\' NOT NULL, importantPartX INT DEFAULT 0 NOT NULL, importantPartY INT DEFAULT 0 NOT NULL, importantPartWidth INT DEFAULT 0 NOT NULL, importantPartHeight INT DEFAULT 0 NOT NULL, meta BLOB DEFAULT NULL, INDEX pid (pid), UNIQUE INDEX uuid (uuid), INDEX path (path(768)), INDEX extension (extension), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC')
     (vendor/contao/installation-bundle/src/Database/Installer.php:76)
  at Contao\InstallationBundle\Database\Installer->execCommand('627bb3e11eedae7f25e6c83e5abcf403')
     (vendor/contao/installation-bundle/src/Controller/InstallationController.php:445)
  at Contao\InstallationBundle\Controller\InstallationController->adjustDatabaseTables()
     (vendor/contao/installation-bundle/src/Controller/InstallationController.php:101)
  at Contao\InstallationBundle\Controller\InstallationController->installAction()
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app_dev.php:67)

Contao 4.5.7 Maria DB 10.1.17 PHP 7.2.3 (Webgo)

Siehe dazu auch https://community.contao.org/de/showthread.php?70063-Fehler-bei-der-Installation&p=470636&viewfull=1#post470636

leofeyer commented 6 years ago

Kannst Du bitte mal folgendes testen:

  1. Öffne die Datei vendor/contao/core-bundle/src/Doctrine/Schema/DcaSchemaProvider.php

  2. Finde die Zeile 463:

        return \in_array(strtolower((string) $largePrefix->Value), ['1', 'on'], true) ? 3072 : 767;
  1. Lösche die Zeile und füge stattdessen folgendes ein:
        $fileFormat = $this->doctrine
            ->getConnection()
            ->query("SHOW VARIABLES LIKE 'innodb_file_format'")
            ->fetch(\PDO::FETCH_OBJ)
        ;

        if (
            'barracuda' === strtolower((string) $fileFormat->Value)
            && \in_array(strtolower((string) $largePrefix->Value), ['1', 'on'], true)
        ) {
            return 3072;
        }

        return 767;
mlwebworker commented 6 years ago

Hat funktioniert. Danke.

leofeyer commented 6 years ago

Bitte noch nicht schließen, ich muss die Änderungen ja noch übernehmen. 😃

mlwebworker commented 6 years ago

ok, da kenn ich mich noch nicht genau aus.

leofeyer commented 6 years ago

So, jetzt. Behoben in contao/core-bundle@7b2c571c6cd83a6e59f2f035162a180295dca644.