RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.88k stars 4.63k forks source link

Can not connect chatbot to fb #2413

Closed MinhMinnie closed 5 years ago

MinhMinnie commented 6 years ago
**Rasa Core version**: 0.10.4 **Python version**: python3 **Operating system** (windows, osx, ...): Ubuntu **Issue**: I can not connect my chatbot to fb messenger platform. I am using this command : python3 -m rasa_core.run -d models/dialogue -u projects/default/model_20180810-113049 --port 5002 --connector facebook --credentials fb_credentials.yml My fb_credentials.yml file: verify: “minh-bot” secret: $MY_SECRET page-access-token: $MY_PAGE_ACCESS_TOKEN I am using ngrok for local testing. when I set up webhook, ngrok gave me : GET /webhook 200 OK . but when I send messages from fb messenger, chat bot doesn’t reply **Content of domain file** (if used & relevant): ```yaml ```
akelad commented 6 years ago

Thanks for creating this issue, @Ghostvv will get back to you about it soon.

Also I have removed your secret and page-access-token from your original issue -- you don't really want this to be publically available, as anyone can access your fb page now.

Ghostvv commented 6 years ago

Hi, could you please add more details, did you specify your webhook in developers.facebook.com?Does your bot receive a message? What are the logs?

MinhMinnie commented 6 years ago

@Ghostvv Yes, I have specified webhook. The bot can receive messages but it's not able to response. I captured screen where I take App secret and verify Callback URL.

capture d ecran de 2018-08-13 15-25-34

capture d ecran de 2018-08-13 15-29-37

Ghostvv commented 6 years ago

Could you please paste the logs from the bot?

MinhMinnie commented 6 years ago

here is my rasa_core log: /usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds)

/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds)

/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds)

/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176 return f(*args, **kwds)

/home/minh/.local/lib/python3.6/site-packages/pykwalify/core.py:99: UnsafeLoaderWarning: The default 'Loader' for 'load(stream)' without further arguments can be unsafe. Use 'load(stream, Loader=ruamel.yaml.Loader)' explicitly if that is OK. Alternatively include the following in your code:

import warnings warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)

In most other cases you should consider using 'safe_load(stream)' data = yaml.load(stream)

Ghostvv commented 6 years ago

could you call rasa_core.run script with --verbose flag

MinhMinnie commented 6 years ago

here is the result : capture d ecran de 2018-08-13 19-12-02

Ghostvv commented 6 years ago

but you started command line script. could you run the script, you run for facebook, but wit --verbose flag?

MinhMinnie commented 6 years ago

sorry I uploaded the wrong one. capture d ecran de 2018-08-14 10-44-20

Ghostvv commented 6 years ago

could you input message in fb and check what is logged

MinhMinnie commented 6 years ago

here it is capture d ecran de 2018-08-14 11-19-45 capture d ecran de 2018-08-14 11-21-57

Ghostvv commented 6 years ago

at the logs you posted above, if you connect it to facebook, the logs have to appear there

MinhMinnie commented 6 years ago

Here is what exactly I have done many times so far Step1: in fb_credentials.yml file: verify: "minh-bot" secret: I take the app secret here capture d ecran de 2018-08-14 11-33-21 page-access-token: in here capture d ecran de 2018-08-14 11-37-18 Step2 : I run this script: python3 -m rasa_core.run -d models/dialogue -u projects/default/model_20180813-121815 --port 5002 --connector facebook --credentials fb_credentials.yml

and run ./ngrok http 5002 for local testing

Step 3 : Edit user subcription (verify token : minh-bot) capture d ecran de 2018-08-13 15-29-37 Verify and save Step4 : in put message in fb

Ghostvv commented 6 years ago

could you in step2: python3 -m rasa_core.run -d models/dialogue -u projects/default/model_20180813-121815 --port 5002 --connector facebook --credentials fb_credentials.yml --verbose

Step5: check logs

MinhMinnie commented 6 years ago

yes, the result of Step2 : capture d ecran de 2018-08-14 11-52-26 Step5: capture d ecran de 2018-08-14 11-51-49 capture d ecran de 2018-08-14 11-51-11

akelad commented 6 years ago

@MinhMinnie when you press "Verify and Save" does it save or does it show you an error message? Also, is the webhook also set under your Messenger settings like this?

screen shot 2018-08-14 at 11 38 56

Next, can you post your ngrok logs if that doesn't work

MinhMinnie commented 6 years ago

capture d ecran de 2018-08-14 12-46-32 After I press "verify and save", it is properly saved

here is ngrok logs capture d ecran de 2018-08-14 12-47-58

akelad commented 6 years ago

Also, is the webhook also set under your Messenger settings like this?

screen shot 2018-08-14 at 11 38 56
MinhMinnie commented 6 years ago

yeah, exactly the same like this

akelad commented 6 years ago

@MinhMinnie any luck with this? (sorry I was on vacation)

MinhMinnie commented 6 years ago

@akelad I think the problem was because I didn't update the information in Basic/settings page. After I updated, It works till now. you can close the post

MatheusBlanco commented 6 years ago

@MinhMinnie, what did you do to fix the problem? After updating the settings page did it start working right away? I know this Issue is closed already, but me and my friends have had the same problem