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

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

Closed
mlwebworker opened this issue Apr 15, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@mlwebworker
Copy link

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
Copy link
Member

leofeyer commented Apr 17, 2018

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;

@leofeyer leofeyer modified the milestones: 4.5.6, 4.5.8 Apr 17, 2018
@mlwebworker
Copy link
Author

Hat funktioniert. Danke.

@leofeyer leofeyer reopened this Apr 19, 2018
@leofeyer
Copy link
Member

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

@mlwebworker
Copy link
Author

ok, da kenn ich mich noch nicht genau aus.

@leofeyer leofeyer self-assigned this Apr 19, 2018
leofeyer added a commit to contao/core-bundle that referenced this issue Apr 19, 2018
@leofeyer
Copy link
Member

leofeyer commented Apr 19, 2018

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

@leofeyer leofeyer modified the milestones: 4.5.9, 4.5 May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants