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

Errors log : "Missing type for Ticket template!" #2210

Closed btry closed 3 years ago

btry commented 3 years ago

issue reported in GLPI : https://github.com/glpi-project/glpi/issues/8418

btry commented 3 years ago

Cannot investigate without a complete backtrace (see the backtrace shared in the linked issue)

phamorais commented 3 years ago

@btry Hi !

follow last 50 lines in backtrace

plugins/formcreator/inc/formanswer.class.php:1001 PluginFormcreatorFormAnswer->generateTarget() inc/commondbtm.class.php:1173 PluginFormcreatorFormAnswer->post_addItem() plugins/formcreator/front/form.form.php:142 CommonDBTM->add()

[2021-04-13 18:46:23] glpiphplog.WARNING: *** PHP User Warning (512): Missing type for Ticket template! in /home/paulo/myglpi/glpi/inc/commonitilobject.class.php at line 7957 Backtrace : inc/commonitilobject.class.php:7957 trigger_error() inc/commonitilobject.class.php:7918 CommonITILObject->getTemplateFieldName() inc/commonitilobject.class.php:792 CommonITILObject->getITILTemplateToUse() inc/ticket.class.php:974 CommonITILObject->handleTemplateFields() inc/commondbtm.class.php:1484 Ticket->prepareInputForUpdate() inc/ticket.class.php:2332 CommonDBTM->update() inc/commonitilactor.class.php:382 Ticket->updateDateMod() inc/group_ticket.class.php:66 CommonITILActor->post_addItem() inc/commondbtm.class.php:1173 Group_Ticket->post_addItem() inc/commonitilobject.class.php:1969 CommonDBTM->add() inc/ticket.class.php:1924 CommonITILObject->post_addItem() inc/commondbtm.class.php:1173 Ticket->post_addItem() plugins/formcreator/inc/targetticket.class.php:808 CommonDBTM->add() plugins/formcreator/inc/formanswer.class.php:816 PluginFormcreatorTargetTicket->save() plugins/formcreator/inc/formanswer.class.php:1001 PluginFormcreatorFormAnswer->generateTarget() inc/commondbtm.class.php:1173 PluginFormcreatorFormAnswer->post_addItem() plugins/formcreator/front/form.form.php:142 CommonDBTM->add()

[2021-04-13 18:48:08] glpiphplog.WARNING: *** PHP User Warning (512): Missing type for Ticket template! in /home/paulo/myglpi/glpi/inc/commonitilobject.class.php at line 7957 Backtrace : inc/commonitilobject.class.php:7957 trigger_error() inc/commonitilobject.class.php:7918 CommonITILObject->getTemplateFieldName() inc/commonitilobject.class.php:792 CommonITILObject->getITILTemplateToUse() inc/ticket.class.php:974 CommonITILObject->handleTemplateFields() inc/commondbtm.class.php:1484 Ticket->prepareInputForUpdate() inc/ticket.class.php:2332 CommonDBTM->update() inc/commonitilactor.class.php:382 Ticket->updateDateMod() inc/group_ticket.class.php:66 CommonITILActor->post_addItem() inc/commondbtm.class.php:1173 Group_Ticket->post_addItem() inc/commonitilobject.class.php:1969 CommonDBTM->add() inc/ticket.class.php:1924 CommonITILObject->post_addItem() inc/commondbtm.class.php:1173 Ticket->post_addItem() plugins/formcreator/inc/targetticket.class.php:808 CommonDBTM->add() plugins/formcreator/inc/formanswer.class.php:816 PluginFormcreatorTargetTicket->save() plugins/formcreator/inc/formanswer.class.php:1001 PluginFormcreatorFormAnswer->generateTarget() inc/commondbtm.class.php:1173 PluginFormcreatorFormAnswer->post_addItem() plugins/formcreator/front/form.form.php:142 CommonDBTM->add()

[2021-04-13 18:50:32] glpiphplog.DEBUG: Html::compileScss() in /home/paulo/myglpi/glpi/inc/html.class.php line 7505 css/palettes/automn.scss is new, loading {"user":"6@myserver"} [2021-04-13 18:50:32] glpiphplog.DEBUG: Html::compileScss() in /home/paulo/myglpi/glpi/inc/html.class.php line 7505 css/dashboard.scss is new, loading {"user":"6@myserver"} [2021-04-13 18:50:32] glpiphplog.DEBUG: Html::compileScss() in /home/paulo/myglpi/glpi/inc/html.class.php line 7505 css/styles.scss is new, loading {"user":"6@myserver"}

And "Also, please confirm that the ticket being created has a group in the actors. It seems this is important to reproduce."

the ticket was actually opened without assigning the group or technician

image

I´m GLPI 9.5.5 and Formcreator 2.11.2

btry commented 3 years ago

Thank you for your information, but so far I could not reproduce.

The backtrace shows that a relation between a group and the ticket is involved in the bug, and adding a group to the target ticket is not sufficient to generate the error.

Can you show the definition of the actors of the target ticket in Formcreator ? If there are no group added here, can you tell how the group is added to the ticket (ticket template, business rule) ?

phamorais commented 3 years ago

OIa @btry

Follow the print of the "target"

image

In the environment, the attribution of the Technician or Group to the ticket is used by means of the rule in "ITIL Category" and "Rules of the entity"

1 - I set up the automatic assignment of technicians or groups through ITIL Categories. For that I need to go to the entity configuration and select the option below

image

2 - First I create the ITIL Category and inform which group will attend the ticket

image

3 - When I create the form, select only the category in the "target"

image

btry commented 3 years ago

Hi

I created an ITIL category with a group in charge of the ticket, then configured the entity to automatically assign the ticket based on the category.

Running a test form runs without error, then I still don't reproduce. I notice that in your screenshots, the group in charge of the hardware is added in the requesters, instead of the assigned (like it is expected and i observe on my own instance).

phamorais commented 3 years ago

@btry sorry for delay!

Sorry I did not understand the problem in the statement: "... I notice that in your screenshots, the group in charge of the hardware is added in the requesters, instead of the assigned (like it is expected and i observe on my own instance)."

See the behavior below in my production instance with GLPI 9.5.4 and Form 2.11.2

image

image ticket_open

See that the ticket opens without errors, and I have the same configuration in the ITIL Category

image

Targets in Form

image

stdglpi commented 3 years ago

Same error for me (GLPI 9.5.5 with Formcreator 2.11.2

When I'm writing a solution just after "Error 500" and in the Php-errors.log

[2021-04-19 22:34:16] glpiphplog.WARNING: *** PHP User Warning (512): Missing type for Ticket template! in C:\inetpub\wwwroot\GLPI 9.5.5\inc\commonitilobject.class.php at line 7957 Backtrace : inc\commonitilobject.class.php:7957 trigger_error() inc\commonitilobject.class.php:7918 CommonITILObject->getTemplateFieldName() inc\commonitilobject.class.php:792 CommonITILObject->getITILTemplateToUse() inc\ticket.class.php:974 CommonITILObject->handleTemplateFields() inc\commondbtm.class.php:1484 Ticket->prepareInputForUpdate() inc\itilsolution.class.php:372 CommonDBTM->update() inc\commondbtm.class.php:1173 ITILSolution->post_addItem() front\itilsolution.form.php:57 CommonDBTM->add()

i'm using ITIL Category for the tickets.

btry commented 3 years ago

Hi @stdglpi

If you get an error 500, then you have a 2nd backtrace in the logs of your HTTP server. This may be useful to find the root cause of the problem.

When you write a solution are you in the context of the service catalog ?

phamorais commented 3 years ago

@btry I update in another GLPI instalation.. with GLPI 9.5.5 and Form 2.11.3, and de the error still the same :(

btry commented 3 years ago

Hi

The original issue on GLPI is reopened because it seems to also occur with the mail collector. We are currently missing data to find the cause of the problem.

phamorais commented 3 years ago

@btry I can provide ssh access to a test environment for you to access.

btry commented 3 years ago

Good, this would be very nice, but I don't recognize you as a GLPI Network subscriber. If you have a subscription to professional service you should have credentials to request support here : https://services.glpi-network.com/ .

phamorais commented 3 years ago

@btry We were partners through Oriontech, but it is in renegotiation.

Anyway, if you want to analyze the incident just let me know. Until then, I will keep pausing the update of the environment.

btry commented 3 years ago

When we thought that the issue was caused by Formcreator, I tried to reproduce, without success. The backtrace involving the mailcollector workflow is a strong clue that Formcreator is not the cause (or root cause) of the bug. I did not investigated further since this event, but @cedric-anne did.

I see 2 possible scenarios:

1

I recommend you follow the issue in GLPI side. As the bug has a significant impact you should probably wait until the solution is identified. Being able to investigate directly in an impacted instance of GLPI should make investigation more efficient, then you shoud resume the partnership renegociation.

2

You said you reproduce on a testing environment. If you have a receipe to reproduce from a fresh GLPI + Formcreator with a very minimal configuration and data set, this may be the key to solve the bug before the partnership renegociation succeeds. In such scenario, please, share all necessary data in the issue opened on GLPI's repo.

stdglpi commented 3 years ago

from my side the problem start to occur since the GLPI update 9.5.4 to 9.5.5. Also I always use the mail collector to create my tickets.

This problem happens when I try to :

Have a good day

btry commented 3 years ago

Hi

Thank you @stdglpi for those useful information.

btry commented 3 years ago

Hi

A fix for GLPI was found. Closing this issue.