7

Recently, I was trying to build a bot for myself. It works flawlessly when I'm using ngrok to test my bot locally, but when I deployed to AWS, I started seeing the error captured below occasionally, and causing no webhook request sent to my server from Facebook. I have no idea what could possibly go wrong. I have check the request going to my server with tcpflow as well, but there's no luck, it seems like Facebook just didn't send that particular request to my server. This is a really weird problem that happens in no particular point of my bot conversation flow. I always need to repeat my answer or my postback in order to get it to work.

Some basic server info (don't know if this matters) :

  1. Availability zone: ap-southeast-1b
  2. Type: t2.micro
  3. CPU usage (at that moment): 4%

I would really appreciated if anyone could solve my mystery. Thanks.

FYI, I have reported this to Facebook: https://developers.facebook.com/bugs/1825253057751227

connection error example

Roy
  • 383
  • 4
  • 15
  • I just googled this error ,Is it different from this : http://android.stackexchange.com/a/100886 – Niklesh Raut Nov 30 '16 at 14:08
  • Are you using a static ip on your aws instance? VPC? – Mathieu de Lorimier Nov 30 '16 at 16:10
  • I'm using an elastic IP for the AWS. Actually, I reported this to Facebook, and they acknowledged that this is a valid bug and assigned people to fix it, although is not fix yet – Roy Nov 30 '16 at 16:14
  • AWS is not the issue. – Igor S. Nov 30 '16 at 21:31
  • Well, is Facebook taking care of it? If so, i beleive they are in the best position to get a resolution for you in this matter. – Mathieu de Lorimier Dec 01 '16 at 15:38
  • Hi. Your server, which webhook request is working over http or https? – Denis Lisitskiy Dec 05 '16 at 07:55
  • I have the same error too and what's weird is that It's only doing this for one of my persistent menu link. – Thierry Apr 11 '17 at 15:09
  • I have experienced that as well. I suspected that is due to the persistent menu is not refreshed. I ended up deleting the conversation and restart the conversation again, and that seems to fix the problem. If that doesn't help, try remove the persistent menu completely and remove the get started button, then set get started button and then set the persistent menu again. – Roy Apr 22 '17 at 16:31

2 Answers2

0

Your webhook server has to work over valid https (not self signed).

My advice - add https to webhook server, using cloudflare service (it`s free), or get a free valid certificate using letsencrypt

Ivan Chaer
  • 6,980
  • 1
  • 38
  • 48
Denis Lisitskiy
  • 1,285
  • 11
  • 15
  • I am using a letsencrypt actually but still encountering the same problem :( – Roy Dec 06 '16 at 06:33
  • Can you test requests to aws by curl or clients app like PostMaster. Have you see requests on aws by this test? – Denis Lisitskiy Dec 07 '16 at 07:43
  • Yes, the error is occasional, normally I could see the request on AWS, just sometimes the error occurs – Roy Dec 07 '16 at 09:51
0

If your error is occasional, I would recommend moving your instance size up from Micro, to at least Medium or Large and make it a Dedicated instance. The resources required to run the letsencrypt client, combined with your bot traffic and noisy neighbors might overcome a shared micro instance.

Taterhead
  • 5,763
  • 4
  • 31
  • 40