glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

deploy with user interaction fails #272

Closed TheRich-71 closed 1 year ago

TheRich-71 commented 1 year ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Yes, I know

Describe the bug

I prepared a deployment package, and since it contains the removal of the previous software, I wanted to request my users to confirm the installation. I used a predefined "Installation Warning" template, and when the user presses Ok it gets cancelled: usercheck after_download: Unsupported on_ok event: setting policy to stop:error_bad_event usercheck after_download: stopping current job by user choice

To reproduce

  1. In glpi 10.0.5 with plugin glpi-inventory, prepare a deploy package, add a userinteraction of type "Installation Warning", deploy it to a client windows PC running glpi-agent 1.4
  2. At the client, wait for the message and press ok

Expected behavior

OK should continue the installation, not cancel it

Operating system

Windows

GLPI Agent version

1.4

GLPI version

Other (See additional context below)

GLPIInventory plugin or FusionInventory for GLPI plugin version

Other (See additional context below)

Additional context

GLPI 10.0.5 with glpi-inventory 1.0.6

g-bougard commented 1 year ago

Hi @TheRich-71 thank you for this report. Can you share the configuration of the user interaction template and the deploy package ?

TheRich-71 commented 1 year ago

Hi @g-bougard, The deploy package:

The following interaction template is applied "after download":

Screenshot 2022-12-06 at 09-16-52 GLPI Inventory DEPLOY - 3 - GLPI Since it is set to continue after pressing Ok, I did not expect it to cancel the whole installation...

M4rkus221 commented 1 year ago

I was able to reproduce this error and found that the user interaction is successful when "Repeat job after" and "Alarm display timeout" are set to "Never".

If either of these options contains a value other than "Never", I always get the user check before: Unsupported on_ok event: setting policy to stop:error_bad_event.

I would assume the bug has something to do with these timing functionality.

M4rkus221 commented 1 year ago

Okay, another update:

It seems that if I change something in the "General" tab (for example, the interaction type) and press "Save", the user interaction always results in an error. If I then go to the "Behavior" tab and press "Save" without changing anything, the user interaction suddenly starts working.

This is also the case when "Retry job" or "Display timeout" is set, so forget my previous post.

To me it looks like some default values are missing in the "Behavior" tab

g-bougard commented 1 year ago

Hi @M4rkus221

I can confirm what you observed: If I have the agent error and if I then edit the "User interactions template" and click on "Save" on the "Behaviors" tab, the error don't come again and the deployment task is run as expected with user interaction handled as expected.

Then I can confirm this is a glpiinventory plugin issue.

stonebuzz commented 1 year ago

hi @M4rkus221 @TheRich-71

can you try this pull request ?

https://github.com/glpi-project/glpi-inventory-plugin/pull/273

Best regards

g-bougard commented 1 year ago

273 seems to fix the problem in my tests.