MySQL >= 8.0.2 Bug: Exception during module activation because of reserved keyword "GROUPS"

Created on 3 January 2019, almost 6 years ago
Updated 12 September 2023, over 1 year ago

Hi there,

I am trying to install the current Group version on my fresh drupal installation. The installation works fine but when I want to activate the plugin I immediatly get the following error in the apache logs:

[Thu Jan 03 21:39:38.974441 2019] [php7:notice] [pid 22] [client 172.18.0.7:51636] Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "Exception thrown while performing a schema update. SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups (\n`id` INT unsigned NOT NULL auto_increment, \n`type` VARCHAR(32) CHARACTE' at line 1: CREATE TABLE {groups} (\n`id` INT unsigned NOT NULL auto_increment, \n`type` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The ID of the target entity.', \n`uuid` VARCHAR(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, \n`langcode` VARCHAR(12) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, \nPRIMARY KEY (`id`), \nUNIQUE KEY `group_field__uuid__value` (`uuid`), \nINDEX `group_field__type__target_id` (`type`)\n) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'The base table for group entities.'; Array\n(\n)\n" at /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php line 1490, referer: https://noekis-portal-qs.banet.at/admin/modules

On the status report page I get the following warning

Entity/field definitions
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Group

    The Group entity type needs to be installed.

Group content

    The Group content entity type needs to be installed.

Group content type

    The Group content type entity type needs to be installed.

Group type

    The Group type entity type needs to be installed.

I also tried to use the -rc2 Version

My system configuration is
- Drupal 8.6.4
- MySQL 8.0.13

I am also not able to uninstall the module. When I try to uninstall, the site crashes (in my case it's not a problem because I used a test install)

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria lobo_

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡―πŸ‡΅Japan dc-kinoshita

    We need to update MySQL 5.7.x to 8.x on our site and we use the Group module.
    I searched for several related issues here but the comments are written in different years for various versions of Drupal and MySQL.
    However, I found this one.
    https://www.drupal.org/project/group/issues/3280680#comment-14516383 β†’
    Does it mean that if I upgrade Drupal 8 to the latest minor version 8.9.20 I will not face the trouble with the Group module using MySQL 8.x?
    Or should I apply a patch that was not committed to the core?
    Of course, I will do various tests after MySQL upgrade, but I would like to be prepared.
    Any information will be appreciated.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    The issue in core is not fixed in Drupal 8 and will not ever be fixed in Drupal 8.

    It is fixed in core Drupal 9.

    To avoid this problem, don't upgrade to MySQL 8 until AFTER you upgrade to Drupal 9 core. Trying to go from MySQL 5 to MySQL 8 while still using core Drupal 8 won't work.

  • πŸ‡―πŸ‡΅Japan dc-kinoshita

    Thank you very much. We will consider upgrading to Drupal 9 as a main approach then.

Production build 0.71.5 2024