craftcms / webhooks

Plugin for integrating Craft with Zapier and IFTTT.
https://plugins.craftcms.com/webhooks
MIT License
84 stars 12 forks source link

Failed webhooks blocks the queue forever #15

Closed jaypeng2015 closed 5 years ago

jaypeng2015 commented 5 years ago

Craft Version: 3.2.6 Pro Database: posgresql 11.4 Plugin version: 2.0.1 Runtime: PHP 7.2 running on 64bit Amazon Linux/2.8.12 No warnings under CMS System Report. Sender Class: craft\elements\Entry Event: afterSave

The UI shows the status after saving an entry: image

This was because the webhook endpoint is unavailable.

webhooks.php:

<?php
return [
  'maxDepth' => 10,
  'maxAttempts' => 3,
  'attemptDelay' => 120,
];

However this doesn't stop after 3 (or 4) attempts, instead it clears dateReserved and timeUpdated and keeps running.

Appreciate any help!

minyan-gu commented 5 years ago

Maybe this could help you as a workaround? https://github.com/lukeyouell/craft-queue-manager

jaypeng2015 commented 5 years ago

Thanks @minyangu-bgl, the plugin may help us from a developer's prospective, but not for commercial users I think.

jaypeng2015 commented 5 years ago

@minyangu-bgl tried craft-queue-manager, but it doesn't work for some reason if the queue is not empty. image

jaypeng2015 commented 5 years ago

More information about the bug itself is that the activity tab always shows pending and there's no attempts. So it's more likely that the job is not triggered at all.

Works on localhost through.

image

jaypeng2015 commented 5 years ago

It turns out that the root cause of this is this issue: https://github.com/craftcms/cms/issues/2715

After I applied the sql ALTER DATABASE dbname SET bytea_output TO 'escape';, everything started to work now.