pimcore / pimcore

Core Framework for the Open Source Data & Experience Management Platform (PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce)
http://www.pimcore.com
Other
3.38k stars 1.43k forks source link

[Installer] Requirements check MariaDB => 10.3 compatibility issues #4533

Closed ceefour closed 5 years ago

ceefour commented 5 years ago

Bug Report

Pimcore 6.0.

Expected behavior

Completes successfully.

Actual behavior

Running installation. You can find a detailed install log in var/installer/logs/prod.log

Checking prerequisites...

  2/10 [=====>----------------------]  20%

 [ERROR] The following errors were encountered during installation

 * innodb_large_prefix = ON  is required.
 * innodb_file_format = Barracuda is required.

Additionally, var/installer/logs/prod.log is not created, even though we have permissions.

Steps to reproduce

  1. Create AWS RDS MariaDB 10.3 instance
  2. ./vendor/bin/pimcore-install with --mysql-host-socket= option

Explanation

In AWS RDS MariaDB 10.3, innodb_large_prefix and innodb_file_format is always empty and cannot be changed via parameter group, as the default (since 10.2) is Barracuda and thus these settings are no longer relevant. So these settings do not need to be checked for MariaDB 10.2 and later.

Refs #2595

Workaround

Patch ./vendor/pimcore/pimcore/lib/Tool/Requirements.php, and comment:

/*
        $largePrefix = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb\_large\_prefix';");
        $checks[] = new Check([
            'name' => 'innodb_large_prefix = ON ',
            'state' => ($largePrefix && $largePrefix['Value'] != 'ON') ? Check::STATE_ERROR : Check::STATE_OK
        ]);

        $fileFormat = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format';");
        $checks[] = new Check([
            'name' => 'innodb_file_format = Barracuda',
            'state' => ($fileFormat && $fileFormat['Value'] != 'Barracuda') ? Check::STATE_ERROR : Check::STATE_OK
        ]);
*/
pitzio725 commented 2 years ago

Hi there.

Hope you are all well.

I also had the below errors:

I solved the first 2 of them by commenting:

Patch ./vendor/pimcore/pimcore/lib/Tool/Requirements.php, and comment:

/* $largePrefix = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb_large_prefix';"); $checks[] = new Check([ 'name' => 'innodb_large_prefix = ON ', 'state' => ($largePrefix && $largePrefix['Value'] != 'ON') ? Check::STATE_ERROR : Check::STATE_OK ]);

    $fileFormat = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format';");
    $checks[] = new Check([
        'name' => 'innodb_file_format = Barracuda',
        'state' => ($fileFormat && $fileFormat['Value'] != 'Barracuda') ? Check::STATE_ERROR : Check::STATE_OK
    ]);

*/

BUT, how can i solve this one as well? --> * WITH RECURSIVE is required.

Please advise.

pitzio725 commented 2 years ago

I fixed the above error by commenting out: // $checks[] = new Check([ // 'name' => 'WITH RECURSIVE', // 'state' => $queryCheck ? Check::STATE_OK : Check::STATE_ERROR, // ]);

Installation runs until step 6/11 and then gives the below NEW error:

====================================================== [ERROR] The following errors were encountered during installation

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

PLEASE HELP ME :(

brusch commented 2 years ago

@pitzio725 it seems your MariaDB instance is not using Barracuda and innodb_large_prefix. Please check that directly on your MySQL console, by using:

SHOW GLOBAL VARIABLES LIKE 'innodb\_large\_prefix';
SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format';
pitzio725 commented 2 years ago

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'innodb_large_prefix'; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | innodb_large_prefix | OFF | +---------------------+-------+ 1 row in set (0.01 sec)

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'innodb_file_format'; +--------------------+----------+ | Variable_name | Value | +--------------------+----------+ | innodb_file_format | Antelope | +--------------------+----------+ 1 row in set (0.01 sec)

Thank you for your swift reply @brusch

What are the next steps that i should do to solve this?

brusch commented 2 years ago

@pitzio725 you need to change the MariaDB configs accordingly, see: https://mariadb.com/kb/en/configuring-mariadb-with-option-files/

abcpremium commented 2 years ago

Hi there.

Hope you are all well.

I also had the below errors:

* innodb_large_prefix = ON  is required.

* innodb_file_format = Barracuda is required.

* WITH RECURSIVE is required.

I solved the first 2 of them by commenting:

Patch ./vendor/pimcore/pimcore/lib/Tool/Requirements.php, and comment:

/* $largePrefix = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb_large_prefix';"); $checks[] = new Check([ 'name' => 'innodb_large_prefix = ON ', 'state' => ($largePrefix && $largePrefix['Value'] != 'ON') ? Check::STATE_ERROR : Check::STATE_OK ]);

    $fileFormat = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format';");
    $checks[] = new Check([
        'name' => 'innodb_file_format = Barracuda',
        'state' => ($fileFormat && $fileFormat['Value'] != 'Barracuda') ? Check::STATE_ERROR : Check::STATE_OK
    ]);

*/

BUT, how can i solve this one as well? --> * WITH RECURSIVE is required.

Please advise.

Is there any update here for the "WITH RECURSIVE" error? I ran into exactly the same issue.

weihan00ae commented 2 years ago

Hi there. Hope you are all well. I also had the below errors:

* innodb_large_prefix = ON  is required.

* innodb_file_format = Barracuda is required.

* WITH RECURSIVE is required.

I solved the first 2 of them by commenting: Patch ./vendor/pimcore/pimcore/lib/Tool/Requirements.php, and comment: /* $largePrefix = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb_large_prefix';"); $checks[] = new Check([ 'name' => 'innodb_large_prefix = ON ', 'state' => ($largePrefix && $largePrefix['Value'] != 'ON') ? Check::STATE_ERROR : Check::STATE_OK ]);

    $fileFormat = $db->fetchRow("SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format';");
    $checks[] = new Check([
        'name' => 'innodb_file_format = Barracuda',
        'state' => ($fileFormat && $fileFormat['Value'] != 'Barracuda') ? Check::STATE_ERROR : Check::STATE_OK
    ]);

/ BUT, how can i solve this one as well? --> WITH RECURSIVE is required. Please advise.

Is there any update here for the "WITH RECURSIVE" error? I ran into exactly the same issue.

I resolve doing this but I don't know if there are going to be fundemental problems in he future because of it.

Go to vendor/pimcore/pimcore/lib/Tool/Requirements.php

and comment this last check:

`// With RECURSIVE // $queryCheck = true;

    // try {
    //     $db->query(
    //         'WITH RECURSIVE counter AS (
    //             SELECT 1 as n UNION ALL SELECT n + 1 FROM counter WHERE n < 10
    //         )
    //         SELECT * from counter'
    //     );
    // } catch (\Exception $e) {
    //     $queryCheck = false;
    // }

    // $checks[] = new Check([
    //     'name' => 'WITH RECURSIVE',
    //     'state' => $queryCheck ? Check::STATE_OK : Check::STATE_ERROR,
    // ]);`

You should be fine now.

schmitz-progressive commented 1 year ago

In my case, I got the "With RECURSIVE" error because I was still using mysql 5.7 Server. Upgrading to mysql 8 solved the error for me.