pluginsGLPI / formcreator

GLPI Plugin Formcreator (DOWNLOAD : https://github.com/pluginsGLPI/formcreator/releases)
http://www.teclib-edition.com
GNU General Public License v3.0
174 stars 125 forks source link

Desactivación de Formularios #3207

Open SoporteIdpac opened 1 year ago

SoporteIdpac commented 1 year ago

Describe the bug Buenos días, tenemos la versión 10.0.6 de GLPI instalada en un servidor apache. Tenemos la funcionalidad de Formularios para los difrentes procesos o entidades pero de un momento a otro los formularios desaparacen y e plugin aparece desactivado. Al activarlo desde la aplicación, sale el siguiente error: " The database schema is not consistent with the installed Formcreator 2.13.1. To see the logs run the command bin/console glpi:plugin:install formcreator -f " El Administrador de base de datos, ingresa y corre el siguiente comando: " Procesando complemento "formcreator"... The tables of the plugin passed the schema integrity check. Complemento "formcreator" ha sido instalado y deberá ser activado. www-data@glpi-202210:~/html/glpi$ " Un vez él hace esa instalación entramos al aplicativo y activamos el plugin, Cuando se activa el plugin crea unas columnas en la siguiente tabla:

en esta tabla pro_glpi.glpi_plugin_formcreator_entityconfigs

crea esta columna service_catalog_home

El Plugin se activa, pero al cabo de unas horas, sin hacer nada ni dentro del código, ni en la aplicación, los formularios se desactivan y toca volver a hacer todo el procedimiento.

===

Good morning, we have version 10.0.6 of GLPI installed on an Apache server. We have the Forms functionality for the different processes or entities but from one moment to the next the forms disappear and the plugin appears deactivated. When activating it from the application, the following error appears: " The database schema is not consistent with the installed Formcreator 2.13.1. To see the logs run the command bin/console glpi:plugin:install formcreator -f " The Database Administrator, enter and run the following command: "Processing "formcreator" plugin... The tables of the plugin passed the schema integrity check. Plugin "formcreator" has been installed and will need to be activated. www-data@glpi-202210:~/html/glpi$ " Once he does this installation, we enter the application and activate the plugin. When the plugin is activated, it creates some columns in the following table:

in this table pro_glpi.glpi_plugin_formcreator_entityconfigs

create this column service_catalog_home

The Plugin is activated, but after a few hours, without doing anything either within the code or in the application, the forms are deactivated and you have to do the entire procedure again.

GLPI / Plugins (please complete the following information):

Desktop (please complete the following information):

btry commented 1 year ago

Hi

Plugins may be disabled when you upgrade GLPI or when you replace the plugin's files with a different version. In the later case GLPI detects the version change and disables the plugin.

If you have a missing column which disappears again after you fixed it, then you should investigate on some process which unexpectedly alters your database.

SoporteIdpac commented 1 year ago

Hola, por alguna razón que no hemos podido identificar, la base de datos toma por defecto la version 2.13.1. y al realizar la activación de la version 2.13.5, dice esto: The database schema is not consistent with the previous version of Formcreator 2.13.1. To see the logs run the command bin/console glpi:plugin:install formcreator -f El administrador de la base de datos pone manualmente la versión 2.13.5 en el schema pero la base de datos no, y desactiva los formularios. Toca volver a montarlos desde la base datos y activarlos, pero se vuelve un bucle y la verdad es muy desgastante. Por favor su ayuda con este bendito error. Gracias

===

Hello, for some reason that we have not been able to identify, the database defaults to version 2.13.1. and when activating version 2.13.5, it says this: The database schema is not consistent with the previous version of Formcreator 2.13.1. To see the logs run the command bin/console glpi:plugin:install formcreator -f The database administrator manually puts version 2.13.5 in the schema but the database does not, and disables the forms. He has to reassemble them from the database and activate them, but it becomes a loop and the truth is that it is very exhausting. Please help with this blessed error. Thank you

btry commented 1 year ago

Hi

The version 2.13.1 mentionned in the error message is the detected version of the plugin before you tried to upgrade.

It tells the upgrade system from which version it must run the upgrade procedure. At this moment, the tables of the plugin must match Formcreator 2.13.1 (because the upgrade has not been executed yet). A check on the tables is executed to ensure that all tables comply with the schema of the version 2.13.1 before upgrading them. This is required to prevent upgrade errors (like changing the content of a column which does not exists because of some problem).

When you encouteer this type of error, you must use CLI diagnose the differences between the table structures of the version 2.13.1, and the table structures you have actually.

Use a terminal, locate in GLPI folder then run the command given in the message. This will try to upgrade, and will fail with the same message and an extra diff between the expected and the actual schema.

bin/console glpi:plugin:install formcreator -f

Copy this diff, and paste it here. It will help to know how the tables hare damaged, and find how to repair them.

Wolfwood07 commented 1 year ago

Hello.

We are currently experiencing the same problem after finding problem with current install and trying to update. Here is a copy of the output.

`Processing plugin "formcreator"...
Table schema differs for table "glpi_plugin_formcreator_conditions".
--- Expected database schema
+++ Esquema de base de datos actual
@@ @@
 CREATE TABLE `glpi_plugin_formcreator_conditions` (
   `id` int unsigned NOT NULL AUTO_INCREMENT,
-  `items_id` int unsigned NOT NULL DEFAULT 0,
+  `items_id` int NOT NULL DEFAULT 0,
   `itemtype` varchar(255) NOT NULL DEFAULT '',
   `order` int NOT NULL DEFAULT 1,
-  `plugin_formcreator_questions_id` int unsigned NOT NULL DEFAULT 0,
+  `plugin_formcreator_questions_id` int NOT NULL DEFAULT 0,
   `show_condition` int NOT NULL DEFAULT 0,
   `show_logic` int NOT NULL DEFAULT 1,
   `show_value` text,

Table schema differs for table "glpi_plugin_formcreator_targetchanges".
--- Expected database schema
+++ Esquema de base de datos actual
@@ @@
   `backoutplancontent` text,
   `category_question` int unsigned NOT NULL DEFAULT 0,
   `category_rule` int NOT NULL DEFAULT 1,
-  `changetemplates_id` int unsigned NOT NULL DEFAULT 0,
+  `changetemplates_id` int NOT NULL DEFAULT 0,
   `checklistcontent` text,
   `commonitil_validation_question` varchar(255),
   `commonitil_validation_rule` int NOT NULL DEFAULT 1,
@@ @@
   `ola_question_tto` int unsigned NOT NULL DEFAULT 0,
   `ola_question_ttr` int unsigned NOT NULL DEFAULT 0,
   `ola_rule` int NOT NULL DEFAULT 1,
-  `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT 0,
+  `plugin_formcreator_forms_id` int NOT NULL DEFAULT 0,
   `rolloutplancontent` text,
   `show_rule` int NOT NULL DEFAULT 1,
   `sla_question_tto` int unsigned NOT NULL DEFAULT 0,

Table schema differs for table "glpi_plugin_formcreator_targettickets".
--- Expected database schema
+++ Esquema de base de datos actual
@@ @@
   `ola_question_tto` int unsigned NOT NULL DEFAULT 0,
   `ola_question_ttr` int unsigned NOT NULL DEFAULT 0,
   `ola_rule` int NOT NULL DEFAULT 1,
-  `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT 0,
+  `plugin_formcreator_forms_id` int NOT NULL DEFAULT 0,
   `show_rule` int NOT NULL DEFAULT 1,
   `sla_question_tto` int unsigned NOT NULL DEFAULT 0,
   `sla_question_ttr` int unsigned NOT NULL DEFAULT 0,
@@ @@
   `tag_specifics` varchar(255) NOT NULL DEFAULT '',
   `tag_type` int NOT NULL DEFAULT 1,
   `target_name` varchar(255) NOT NULL DEFAULT '',
-  `tickettemplates_id` int unsigned NOT NULL DEFAULT 0,
+  `tickettemplates_id` int NOT NULL DEFAULT 0,
   `type_question` int unsigned NOT NULL DEFAULT 0,
   `type_rule` int NOT NULL DEFAULT 0,
   `urgency_question` int unsigned NOT NULL DEFAULT 0,

Table schema differs for table "glpi_plugin_formcreator_targets_actors".
--- Expected database schema
+++ Esquema de base de datos actual
@@ @@
 CREATE TABLE `glpi_plugin_formcreator_targets_actors` (
-  `id` int unsigned NOT NULL AUTO_INCREMENT,
+  `id` int NOT NULL AUTO_INCREMENT,
   `actor_role` int NOT NULL DEFAULT 1,
   `actor_type` int NOT NULL DEFAULT 1,
   `actor_value` int unsigned NOT NULL DEFAULT 0,
@@ @@
   `uuid` varchar(255),
   PRIMARY KEY (`id`),
   KEY `item` (`itemtype`,`items_id`)
-) COLLATE=utf8mb4_unicode_ci DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB
+) COLLATE=utf8_unicode_ci DEFAULT CHARSET=utf8 ENGINE=InnoDB

Table schema differs for table "glpi_plugin_formcreator_issues".
--- Expected database schema
+++ Esquema de base de datos actual
@@ @@
   `display_id` varchar(255) NOT NULL,
   `entities_id` int unsigned NOT NULL DEFAULT 0,
   `is_recursive` tinyint NOT NULL DEFAULT 0,
-  `items_id` int unsigned NOT NULL DEFAULT 0,
+  `items_id` int NOT NULL DEFAULT 0,
   `itemtype` varchar(255) NOT NULL DEFAULT '',
   `name` varchar(255),
   `requester_id` int unsigned NOT NULL DEFAULT 0,

The database schema is not consistent with the previous version of Formcreator 2.13.6. To see the logs run the command bin/console glpi:plugin:install formcreator -f
To ignore the inconsistencies and upgrade anyway run bin/console glpi:plugin:install formcreator -f -p skip-db-check
Plugin "formcreator" installation failed`
btry commented 1 year ago

Hi

@Wolfwood07, sorry for the long delay. If you did not solved your migration problem, you may fix all columns with PhpMyAdmin, HeidiSQL or any other similar tool. Set the columns unsigned, then try again to upgrade.

btry commented 1 year ago

@SoporteIdpac

You must use CLI to try to upgrade the plugin. Command is ```bin/console glpi:plugin:install formcreator -f