1

Fresh pull of the recent 4.1.2 package and when config.yml is set to use with utf8mb4 -- @Michael Bessolov

doctrine:
    dbal:
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci

During the Database Setup/Process Migrations precedure I get the following errors. However, when installed without the above config.yml modifications, the install succeeds properly.. I have used utf8mb4 with 4.1.0 and 4.1.1 as well as the entire 3.1 branch with the current setup perfectly. Seems to just be introduced in the recent revision.

The initial error message is on MariaDB 10.4.12 and the second is after being tested against MySQL 5.7.29 after Andrey's mention of the error message formatting.

MariaDB 10.4.12-

  > Oro\Bundle\DataAuditBundle\Migrations\Schema\OroDataAuditBundleInstaller
    ERROR: An exception occurred while executing 'CREATE TABLE oro_audit (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, impersonation_id INT DEFAULT NULL, action VARCHAR(8) DEFAULT NULL, logged_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)', object_id VARCHAR(255) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, object_name VARCHAR(255) DEFAULT NULL, version INT DEFAULT NULL, type VARCHAR(255) NOT NULL, transaction_id VARCHAR(255) NOT NULL, owner_description VARCHAR(255) DEFAULT NULL, additional_fields LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_5FBA427CA76ED395 (user_id), INDEX idx_oro_audit_type (type), UNIQUE INDEX idx_oro_audit_version (object_id, object_class, version, type), UNIQUE INDEX idx_oro_audit_transaction (object_id, object_class, transaction_id, type), INDEX idx_oro_audit_logged_at (logged_at), INDEX idx_oro_audit_object_class (object_class), INDEX idx_oro_audit_obj_by_type (object_id, object_class, type), INDEX idx_oro_audit_owner_descr (owner_description), INDEX idx_oro_audit_organization_id (organization_id), INDEX IDX_5FBA427C26F87DB8 (impersonation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':

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

@Andrey Yatsenko

MySQL 5.7.29 - edit: was missing english translation, shows same error now

  > Oro\Bundle\DataAuditBundle\Migrations\Schema\OroDataAuditBundleInstaller
    ERROR: An exception occurred while executing 'CREATE TABLE oro_audit (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, impersonation_id INT DEFAULT NULL, action VARCHAR(8) DEFAULT NULL, logged_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)', object_id VARCHAR(255) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, object_name VARCHAR(255) DEFAULT NULL, version INT DEFAULT NULL, type VARCHAR(255) NOT NULL, transaction_id VARCHAR(255) NOT NULL, owner_description VARCHAR(255) DEFAULT NULL, additional_fields LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_5FBA427CA76ED395 (user_id), INDEX idx_oro_audit_type (type), UNIQUE INDEX idx_oro_audit_version (object_id, object_class, version, type), UNIQUE INDEX idx_oro_audit_transaction (object_id, object_class, transaction_id, type), INDEX idx_oro_audit_logged_at (logged_at), INDEX idx_oro_audit_object_class (object_class), INDEX idx_oro_audit_obj_by_type (object_id, object_class, type), INDEX idx_oro_audit_owner_descr (owner_description), INDEX idx_oro_audit_organization_id (organization_id), INDEX IDX_5FBA427C26F87DB8 (impersonation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':

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

C-P
  • 21
  • 3

2 Answers2

1

Oro internal ticket #BAP-18992 issued to fix. Thank you team Oro!

C-P
  • 21
  • 3
0

Make sure your environment meets all the OroCommerce system requirements. The only supported MySQL version, for now, is 5.7.

But according to the error message, you are using an older version. If so, please upgrade MySQL to 5.7. Earlier versions of MySQL are not supported officially anymore and not tested before releases. It was a coincidence if the application worked with it.

Andrey Yatsenko
  • 1,936
  • 1
  • 11
  • 13
  • I tried against both 5.7.29 and MariaDB 10.4.12 (like is mentioned in the linked sys reqs) with the same result, just different error ''message'' as you can see above. – C-P Apr 14 '20 at 19:28
  • if you are restarting installation on an existing instance, please follow the reinstall guide: https://doc.oroinc.com/backend/setup/reinstall/ – Andrey Yatsenko Apr 14 '20 at 20:12
  • This is a fresh install, fresh database install and creation, not a reinstall. The issue seems to be exceeding the byte limitation (3072B) of indexes when using 4byte characters in utf8mb4. Can anybody reproduce this when installing using utf8mb4? – C-P Apr 14 '20 at 20:30
  • Confirmed a bug. Thank you for the report! Internal ticket id #BAP-18992. – Andrey Yatsenko Apr 15 '20 at 14:42
  • Thank you Andrey! I had just edited the MySQL error section because I was missing the English translation so it was showing 'Unknown error' earlier but now it matches the MariaDB output.. Thank you too and please thank the entire team for all of the amazing work, truly appreciate you all! – C-P Apr 15 '20 at 14:46
  • If you want to track the progress on an issue, you have to report it to the GitHub issues: https://github.com/oroinc/platform/issues/new?template=1_bug_report.md – Andrey Yatsenko Apr 15 '20 at 14:48
  • I had initially created one but Michael Bessolov had closed it, want me to just re-open that one or do I need to re-create under the platform github? https://github.com/oroinc/orocommerce/issues/114 – C-P Apr 16 '20 at 15:56