Chatwoot Facebook Integration Delay Issue

TLDR 32lichunjia encountered delayed message delivery between Facebook and Chatwoot. sojan_official suggested checking sidekiq queue. The issue eventually resolved itself.

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 02:24:07 UTC

Hello, I'm using Ubuntu 20.04 to run Chatwoot on GCP. Self hosted env OS: Ubuntu 20.04 I've followed the instruction to set up Facebook (https://www.chatwoot.com/docs/self-hosted/configuration/features/integrations/facebook-channel-setup), and it works in the begining. I could send and receive message from both Facebook and Chatwoot. But it takes about 10-60 mins to receive message from Facebook on Chatwoot recently. Sometimes, no message is delivered from Facebook. This situation has last about 2 weeks. Facebook APP shows that the Webhooks from Facebook kept receiving error: HTTP 503 Failed to connect to server.

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 02:25:22 UTC

Since I have kinda heavy traffic on Website-Chat inboxes, nginx.conf has been modified as below:

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 02:25:46 UTC

Since FB Webhooks receive HTTP 503, I've tried to modify puma.rb to increase workers as below. But seems like it doesn't help:

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 02:26:57 UTC

From Nginx access log, it can receive POST request at /bot endpoint. <@4K257a> told me to check if it's taking time to create record, but I'm not quite sure how to do that.

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 02:28:09 UTC

If more information is needed, I'm willing to prepare. Could anybody please kindly give some help?

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 03:35:05 UTC

Update: I'm testing the issue today. I can receive Facebook message on Chatwoot immediately, untill another FB user send message from Facebook. I cannot receive message from the second user and my message can also not be received on Chatwoot after he sends message.

Photo of 32lichunjia
32lichunjia
Wed, 14 Dec 2022 09:18:53 UTC

From syslog, it kept showing the following 3 errors:

Photo of sojan_official
sojan_official
Wed, 21 Dec 2022 15:40:59 UTC

32lichunjia none of the errors seems to be related specifically towards facebook. Could you check the status of your sidekiq queue and see if there is a lot of pending jobs ?

Photo of 32lichunjia
32lichunjia
Mon, 26 Dec 2022 01:53:01 UTC

Hi sojan_official , this error seems not happening these days. Thanks for offering more clues.