ericferon / glpi-webhook

GNU General Public License v2.0
20 stars 5 forks source link

Webhook is not working #8

Closed alinakasimova336 closed 2 years ago

alinakasimova336 commented 2 years ago

Hi everybody! I set to get a notification when ticket is being updated. I do get notification via email and browser but not via webhook. What should I do?

ericferon commented 2 years ago

Hi, Did you follow the process described in the wiki https://github.com/ericferon/glpi-webhook/wiki/Webhook ? If yes, more information will be needed to help you. K.r,

gilbanech commented 2 years ago

The plugin doesn't work for me either. I followed the installation instructions. i'm trying to send a message to rocket.chat but I don't even see attempts to access the url in the nginx access log to the Rocket server. when I make a direct curl call from the shell from the gpi server, it works.

curl -H "X-Auth-Token: My-Token-ID" \ -H "X-User-Id: My-User-ID" \ -H "Content-type:application/json" \ https://My-URL-api \ -d '{ "channel": "@user", "text": "This is a direct message!" }'

ericferon commented 2 years ago

Are you using the last version (v1.0.4) ? Have you messages in the file /pathtoglpi/files/_log/webhook.log ? K.r,

gilbanech commented 2 years ago

GLPI version: 10.0.3 Webhook plugin version: 1.0.4 no such file: /pathtoglpi/files/_log/webhook.log I have read this issue: https://github.com/ericferon/glpi-webhook/issues/9 and noticed that I also do not have recipients for webhook. on the last screenshot, all recipients are added via the "All" button webhook1 webhook2 webhook3

ericferon commented 2 years ago

Hi, Have you error messages related to the plugin into pathtoglpi/files/_log/php-errors.log or sql-errors.log ? Otherwise, can you read the table glpi_plugin_webhook_configs in the GLPI database and execute the query "SELECT id, name FROM glpi_plugin_webhook_configs" ? K.r,

gilbanech commented 2 years ago

Hi, there are warnings in php-errors.log on the day the plugin was installed: [2022-10-07 07:21:42] glpiphplog.WARNING: *** PHP User Warning (512): Usage of signed integers in primary or foreign keys is discouraged, please use unsigned integers instead inglpi_plugin_webhook_secrettypes.id. in /var/www/html/src/DBmysql.php at line 2033 plugins/webhook/hook.php:34 DBmysql->runFile() src/Plugin.php:787 plugin_webhook_install() plugins/webhook/hook.php:34 DBmysql->runFile() src/Plugin.php:787 plugin_webhook_install() [2022-10-07 07:21:43] glpiphplog.WARNING: *** PHP User Warning (512): Usage of signed integers in primary or foreign keys is discouraged, please use unsigned integers instead inglpi_plugin_webhook_operationtypes.id. in /var/www/html/src/DBmysql.php at line 2033 plugins/webhook/hook.php:34 DBmysql->runFile() src/Plugin.php:787 plugin_webhook_install()

Query result "SELECT id, name FROM glpi_plugin_webhook_configs":

MariaDB [glpidb]> SELECT id, name FROM glpi_plugin_webhook_configs; +----+--------+ | id | name | +----+--------+ | 1 | Rocket | +----+--------+

webhook4

ericferon commented 2 years ago

Hi, In order to change signed integers keys into unsigned ones, you can run the command "php bin/console glpi:migration:unsigned_keys", from the GLPI root directory. But this warning does not explain why you don't see your Rocket webhook into the list. However, I'm surprised that you are using the v1.0.4 and that the list of "Authentication type" doesn't display "2 - Basic Authentication". Can you run the query "SELECT id, name FROM glpi_plugin_webhook_secrettypes" ? Thank you,

gilbanech commented 2 years ago

Hi, Query result: MariaDB [glpidb]> SELECT id, name FROM glpi_plugin_webhook_secrettypes; +----+------------------------------+ | id | name | +----+------------------------------+ | 1 | Basic Authentication | | 2 | Encoded Basic Authentication | +----+------------------------------+

webhook5 webhook6

ericferon commented 2 years ago

Hi, There was a bug in v1.0.4 and the "Authentication type" list has not been upgraded as it should be. Can you install v1.0.5 and run again the last query "SELECT id, name FROM glpi_plugin_webhook_secrettypes" ? You should then update your Rocket webhook with the right "Authentication type". Then, can you also check whether your "Rocket" webhook appears in the recipient list ? Thank you in advance,

gilbanech commented 2 years ago

I did everything. but there were no recipients. I then removed the old "Rocket" webhook and created a new "rocket". Nothing changed there are no errors in php-error and sql-error logs

MariaDB [glpidb]> SELECT id, name FROM glpi_plugin_webhook_configs; +----+--------+ | id | name | +----+--------+ | 2 | rocket | +----+--------+

MariaDB [glpidb]> SELECT id, name FROM glpi_plugin_webhook_secrettypes; +----+----------------------------------+ | id | name | +----+----------------------------------+ | 1 | 1 - None | | 2 | 2 - Basic Authentication | | 3 | 3 - Encoded Basic Authentication | +----+----------------------------------+ webhook5_1 webhook5_2 all recipients selected webhook5_3

peroda commented 2 years ago

the same thing happens to me with microsoft Teams webhook

ericferon commented 2 years ago

There was indeed a bug, that has been solved in v1.0.6. K.r,

peroda commented 2 years ago

There was indeed a bug, that has been solved in v1.0.6. K.r,

Thanks.

Melak91 commented 2 years ago

I have been following this issue for the past few days, Is there others step to do to see webhook in recipent cause I still can't see them.

here the step i did:

here a list of all recipient avalaible (added with all button) image

There is no error about webhook in php-error and sql-error logs

ericferon commented 2 years ago

Hi, @Melak91 Which type of notification and which event do you use for your webhook (in Setup>Notifications>Notifications) ? K.r,

Melak91 commented 2 years ago

Hi,@ericferon

type: Form answer event: The form as been saved

Thanks fore the help!

ericferon commented 2 years ago

Hi, I've not this event in my list. Is it an event linked to the Formcreator plugin ? Otherwise, which one ? If it's the Formcreator plugin, v1.0.7 should solve your problem. K.r,

Melak91 commented 2 years ago

Hi, Yea it was from Formcreator.

Thanks for the fix and help! Continue your great work!