FB Messenger... Rasa response not showing up in Messenger

Version: dev-CC

Hello,

I am trying to connect Rasa to FB messenger. I have Rasa & Rasa X deployed on GCP with helm etc…

I followed all the directions to set up a FB page and connect Rasa to FB Messenger.

When testing my bot in FB Messenger, I can type in a message to my page but I do not get a response back from Rasa. However, when I check my Rasa X domain, I can see my chats were logged from Facebook and Rasa is responding to my FB messages in Rasa X.

The problem is that I am not getting a response message to pop into messenger. Everything else seems to be running fine.

I am running a base project rasa init, so no custom actions or duckling at the moment. Not sure if this is the problem or not?

This is what I get after running kubectl get pods on my GCP shell:

`NAME                                   READY   STATUS    RESTARTS   AGE
rasa-nginx-58fb497cb6-n78g5            1/1     Running   0          165m
rasa-app-5c74988c55-gqz6n              1/1     Running   0          165m
rasa-redis-master-0                    1/1     Running   0          165m
rasa-postgresql-0                      1/1     Running   0          165m
rasa-rasa-production-db985f459-vhg6k   1/1     Running   0          73m
rasa-rasa-worker-f4b669594-tkxw2       1/1     Running   0          73m
rasa-rasa-x-554c4bf478-mztf7           1/1     Running   0          72m
rasa-event-service-8547b75db7-wvj48    1/1     Running   4          165m
rasa-rabbit-0                          1/1     Running   0          20m`

When you set up your facebook app, you had to select “subscriptions” - did you select the messaging_postback subscription? That’s just the first thing I’d check. No, the absence of custom actions should not be a problem.

@mloubser Yes, I subscribed my app to all 16 “subscriptions” including messaging postback.

Rasa X is recognizing my messages from FB, so it looks like everything is set up okay. I’m not sure what else to do since I am not getting any errors.

The only thing I can think of is that I havent verified my ID / submitted my app for review. Its saying my app isnt set up yet.

Screenshot%20from%202020-04-17%2011-58-00

I’m pretty sure that verification step is only if you want to publish your app. Can you see any more details on the facebook side of what is happening when the bot tries to send a message?

@mloubser, no I cant see any errors. I hit f-12 in messenger… no problems. f-12 Rasa X… no problems. Inside FB for Developers… no problems.

I reconnected my page and webhooks… resubscribed everything… I dont see the problem at all. Not sure what else to do.

Im on my personal FB account and messaging my page directly. I even added my friend as a Tester on my app and they didnt get any response either.

I’m getting a ton of 200 GET requests rolling in. Its recognizing my messages and saying its sending a response on the bottom right hand corner. Must be something to do with Facebook. Because Rasa seems to be working Okay.

@mloubser, do you have any other suggestions? A response is definitely being sent to FB Messenger no?

I was thinking about starting all over again but setting up the FB app / page first and then integrate Rasa. I think there is something wrong with facebook and it is blocking my messages.

Response Payload

I’m sorry I don’t have a better suggestion - It does sound like a response is being sent. I know it’s a pain to re set up the app/page, but there are a lot of settings in that process that can be hard to identify after set up is done, so let me know if you get it working.

Did you get it fixed ?

No unfortunately not. Yesterday I completely restarted everything (setup new GCP VM instance, rasa init, new github repo, new facebook page etc…) and I am experiencing the exact same issue the second try. This time I started by setting up the Facebook page first and followed the Official Rasa Facebook Setup Documentation. Then, I followed the Rasa blog post The Complete Guide to Deploying Your Rasa Assistant. Same problem… I think this may be a FB issue. Work around solution? @mloubser

on your facebook page in the settings -> advanced messaging -> connected applications -> configure -> main receiver of the handover protocol

and select your facebook page, it worked for me doing that and apart from the messages it only works for me when testing it with the same administrator of the page since another user does not respond to me, it seems to me that when you publish it, it can only be used with other users

Hi jchek, thanks for your suggestion. I tried it out and still didnt get it to work. I read through the Rasa Facebook docs again and wasnt sure if I had to add the https://<yourdomain.com>/webhook/facebook/webhooks in the credentials.yml file at the bottom.

e.g. FB Messenger Documentation
" The endpoint for receiving Facebook messenger messages is http://localhost:5005/webhooks/facebook/webhook , replacing the host and port with the appropriate values. This is the URL you should add in the configuration of the webhook."

Does that mean I would put above in my credential.yml file?
" This entry is needed if you are using Rasa X. The entry represents credentials for the Rasa X “channel”, i.e. Talk to your bot and Share with guest testers. rasa: url: “https://<yourdomain.com>/webhooks/facebook/webhook”

I’m going to try one more time with the setup and set up my FB first with the advanced messenger setting you recommended. If I cant get it to work, would you be interested in helping me setup the FB messenger and get Rasa working for payment? @jchek11

your credential.yml file How do you have it configured?

rest → also uncomment for the REST APIs to be enabled

rest:

facebook:

  • verify: “”
  • secret: “”
  • page-access-token: “”

With Rasa x I have not tried, but the command I use to enable the APIS is:

rasa run -m models --enable-api --cors “*” --debug

Currently I test it with the ngrok program to pass to Facebook a link https

the generated link I put it in Webhooks of the page

ngrok tells me that facebook validated it correctly

Then I try by facebook messenger and it responds to me normal, by Rasa x I have not tried, maybe you need to enable the REST APIs @memorizeracks

Here is how my credential.yml is set. In my previous post… I am not sure if I change the Rasa: Url: to my webhook or keep it the same default http://localhost value??

# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels/

rest:
# you don't need to provide anything here - this channel doesn't
# require any credentials


facebook:
  verify: "my-example"
  secret: "d5616ser651dgExample651685168"
  page-access-token: "DDFSA68516518Example681684serg"

#slack:
#  slack_token: "<your slack token>"
#  slack_channel: "<the slack channel>"

#socketio:
#  user_message_evt: <event name for user message>
#  bot_message_evt: <event name for but messages>
#  session_persistence: <true/false>

#mattermost:
#  url: "https://<mattermost instance>/api/v4"
#  token: "<bot token>"
#  webhook_url: "<callback URL>"

# This entry is needed if you are using Rasa X. The entry represents credentials 
# for the Rasa X "channel", i.e. Talk to your bot and Share with guest testers.
rasa:
  url: "https://bobrasa.dev/webhooks/facebook/webhook"

I will try the rasa run -m models --enable-api --cors “*” --debug command. My Rasa instance is running on a Google Cloud VM with ubuntu.You think it would work if I just type that command into the SSH terminal?

Also, I noticed that in your picture of the FB Developer panel… your icon for the FB Messenger product is green. My FB Messenger product is still white like it hasnt been set up. Even though I followed all the directions in the documentation and configured the advanced messenger steps like you mentioned. Did you submit your app for review to FB? I would pay you to help me set it up (paypal).

Tried 3 times with Rasa X & FB Messenger. Still not working. Willing to pay to have someone help me solve this problem. Respond back if interested.

Hi @memorizeracks

no money needed :slight_smile:

But it looks like you havent finish setting up your App on Facebook yet. perhaps you wanna share more screenshots about your facebook (messenger, webhook) setup

@memorizeracks were you able to solve it?

@gaushh - No I wasnt able to solve the problem. I even had help with testing the setup and webhooks from one of Rasa’s employee. I was told that I should try to implement locally with Ngrok and see if I can figure out the problem.

Heres the acual error. Notice in the FB response the ‘text’ ‘not working’

At this point, I could try to run local on ngrok or maybe the one line deploy script has been updated to Rasa 2.0 and the problem fixed itself.