tomolimo / mailanalyzer

Mail Analyzer GLPI Plugin may be used to combine CC mails into one Ticket
25 stars 10 forks source link

Index column size too large. The maximum column size is 767 bytes. #76

Closed Riesuu closed 1 year ago

Riesuu commented 1 year ago

Describe the bug

Hi, i want to install mail analyzer on GLPI 10.0.5 and i have an error message when i clic on "+" to install

Page(s) URL

If applicable, page(s) URL where the bug happens.

To reproduce

Steps to reproduce the behavior: Copy the folder into plugin directory Clic on "+" to install this plugin

Expected behavior

Error creating glpi_plugin_mailanalyzer_message_id Index column size too large. The maximum column size is 767 bytes.

Logs

  Error: Index column size too large. The maximum column size is 767 bytes.
  Backtrace :
  plugins\mailanalyzer\hook.php:24                   
  src\Plugin.php:787                                 plugin_mailanalyzer_install()
  front\plugin.form.php:51                           Plugin->install()
  {"user":"2@mypc"} 
[2022-12-27 10:24:49] glpisqllog.ERROR: DBmysql::query() in C:\wamp\www\glpi_new\src\DBmysql.php line 370
  *** MySQL query error:
  SQL: CREATE TABLE `glpi_plugin_mailanalyzer_message_id` (
            `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
            `message_id` VARCHAR(255) NOT NULL DEFAULT '0',
            `tickets_id` INT UNSIGNED NOT NULL DEFAULT '0',
            PRIMARY KEY (`id`),
            UNIQUE INDEX `message_id` (`message_id`),
            INDEX `tickets_id` (`tickets_id`)
         )
         COLLATE='utf8mb4_unicode_ci'
         ENGINE=innoDB;

  Error: Index column size too large. The maximum column size is 767 bytes.
  Backtrace :
  plugins\mailanalyzer\hook.php:24                   
  src\Plugin.php:787                                 plugin_mailanalyzer_install()
  front\plugin.form.php:51                           Plugin->install()
  {"user":"2@mypc"} 

Screenshots

If applicable, add screenshots to help explain your problem.

Your GLPI setup (you can find it in Setup > General menu, System tab)

Operating system: Windows NT mypc 10.0 build 19045 (Windows 10) i586
PHP 8.1.13 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bcmath, bz2, calendar,
    com_dotnet, ctype, curl, date, dom, exif, fileinfo, filter, gd, gettext, gmp, hash, iconv, imap, intl, json, ldap, libxml,
    mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, readline, session, soap, sockets, sqlite3, standard, tokenizer,
    xdebug, xml, xmlreader, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="120" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files"
    upload_max_filesize="2M" 
Software: Apache/2.4.54 (Win32) PHP/8.1.13 mod_fcgid/2.3.10-dev (Apache/2.4.54 (Win32) PHP/8.1.13 mod_fcgid/2.3.10-dev Server at
    glpinew Port 80
)
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54
Server Software: MySQL Community Server (GPL)
    Server Version: 5.7.40
    Server SQL Mode: STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER
    Parameters: root@localhost/glpitest
    Host info: localhost via TCP/IP

Additional context

image

tomolimo commented 1 year ago

Hello @Riesuu, Could check that support for large prefix is ON? show global variables like 'innodb_lar%'; And if yes, could you post the results of show global variables like 'innodb_fil%'; And also the result of show global variables like 'innodb_default%'; Thank you, Regards, Tomolimo

Riesuu commented 1 year ago

Sure!

MariaDB [(none)]> show global variables like 'innodb_lar%';
Empty set (0.001 sec)

MariaDB [(none)]> show global variables like 'innodb_fil%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| innodb_file_per_table | ON    |
| innodb_fill_factor    | 100   |
+-----------------------+-------+
2 rows in set (0.001 sec)

MariaDB [(none)]> show global variables like 'innodb_default%';
+----------------------------------+---------+
| Variable_name                    | Value   |
+----------------------------------+---------+
| innodb_default_encryption_key_id | 1       |
| innodb_default_row_format        | compact |
+----------------------------------+---------+
2 rows in set (0.001 sec)
tomolimo commented 1 year ago

Hello @Riesuu That's strange, you showed the results for MariaDB but in the GLPI system info it shows: Server Software: MySQL Community Server (GPL) Server Version: 5.7.40 What SQL server GLPI is using? MariaDB or MySQL? Thank you Regards, Tomolimo

Riesuu commented 1 year ago

My bad, im using wamp and i'm not familiar

mysql> show global variables like 'innodb_lar%';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| innodb_large_prefix | ON    |
+---------------------+-------+
1 row in set (0.00 sec)

mysql> show global variables like 'innodb_fil%';
+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| innodb_file_format       | Barracuda |
| innodb_file_format_check | ON        |
| innodb_file_format_max   | Barracuda |
| innodb_file_per_table    | ON        |
| innodb_fill_factor       | 100       |
+--------------------------+-----------+
5 rows in set (0.00 sec)

mysql> show global variables like 'innodb_default%';
+---------------------------+---------+
| Variable_name             | Value   |
+---------------------------+---------+
| innodb_default_row_format | compact |
+---------------------------+---------+
1 row in set (0.00 sec)
tomolimo commented 1 year ago

Hello,

Then the solution is to change the innodb_default_row_format from compact to dynamic You may try this: SET GLOBAL innodb_default_row_format = DYNAMIC;

Then you should be able to add the plugin :)

Thank you, Regards, Tomolimo

Riesuu commented 1 year ago

Good morning, thanks a lot it working !