Exception While handling webhooks/callback/webhook

I am connecting my rasa bot to whatsapp using external APIs(which is a separate project). I am using rasa Callback method to send and receive messages following Rasa connectors - Your own website

Note the when is use RestInput everything is working fine. But when I use CallbackInput I am getting the following exception. Everything is working perfect in rasa shell and rasa interactive mode as well.

I have a rule in rules.yml which is to first greet the user and send a menu. This means two actions continuously.

- rule: provide with main menu
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_home_menu

Now I set a callback url is credentials.yml. and I have my external APIs ready at the callback url.

2021-01-21 13:56:57 DEBUG    rasa.core.lock_store  - Issuing ticket for conversation '919581686942'.
2021-01-21 13:57:20 DEBUG    rasa.core.lock_store  - Acquiring lock for conversation '919581686942'.
2021-01-21 13:57:20 DEBUG    rasa.core.lock_store  - Acquired lock for conversation '919581686942'.
2021-01-21 13:57:20 DEBUG    rasa.core.tracker_store  - Recreating tracker for id '919581686942'
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Starting a new session for conversation ID '919581686942'.
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Action 'action_session_start' ended with events '[<rasa.shared.core.events.SessionStarted object at 0x0000022ECF5BAB20>, <rasa.shared.core.events.ActionExecuted object at 0x0000022ECF5BA580>]'.
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Current slot values:
        vehicle_registeration_no: None
        vehicle_chasis_no: None
        policy_no: None
        requested_slot: None
2021-01-21 13:57:20 DEBUG    rasa.nlu.classifiers.diet_classifier  - There is no trained model for 'ResponseSelector': The component is either not trained or didn't receive enough training data.
2021-01-21 13:57:20 DEBUG    rasa.nlu.selectors.response_selector  - Adding following selector key to message property: default
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Received user message 'Helloe' with intent '{'id': 2761767774935807683, 'name': 'greet', 'confidence': 0.9820572137832642}' and entities '[]'
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events.
2021-01-21 13:57:20 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen
2021-01-21 13:57:20 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2021-01-21 13:57:20 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen
2021-01-21 13:57:20 DEBUG    rasa.core.policies.rule_policy  - There is a rule for the next action 'utter_greet'.
2021-01-21 13:57:20 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_2_RulePolicy.
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Predicted next action 'utter_greet' with confidence 1.00.
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
2021-01-21 13:57:20 DEBUG    rasa.core.processor  - Action 'utter_greet' ended with events '[BotUttered('Hi, I hope you are having a great day.', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {"template_name": "utter_greet"}, 1611217640.783824)]'.
2021-01-21 13:59:20 DEBUG    rasa.core.lock_store  - Deleted lock for conversation '919581686942'.
[2021-01-21 13:59:20 +0530] [16788] [ERROR] Exception occurred while handling uri: 'http://localhost:5005/webhooks/callback/webhook'
Traceback (most recent call last):
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\sanic\app.py", line 938, in handle_request
    response = await response
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\callback.py", line 76, in webhook
    await on_new_message(
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\channel.py", line 85, in handler
    await app.agent.handle_message(*args, **kwargs)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\agent.py", line 521, in handle_message
    return await processor.handle_message(message)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\processor.py", line 98, in handle_message
    await self._predict_and_execute_next_action(message.output_channel, tracker)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\processor.py", line 630, in _predict_and_execute_next_action
    should_predict_another_action = await self._run_action(
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\processor.py", line 775, in _run_action
    await self.execute_side_effects(events, tracker, output_channel)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\processor.py", line 670, in execute_side_effects
    await self._send_bot_messages(events, tracker, output_channel)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\processor.py", line 686, in _send_bot_messages
    await output_channel.send_response(tracker.sender_id, e.message())
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\channel.py", line 186, in send_response
    await self.send_text_message(recipient_id, message.pop("text"), **message)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\channel.py", line 328, in send_text_message
    await self._persist_message(self._message(recipient_id, text=message_part))
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\core\channels\callback.py", line 33, in _persist_message
    await self.callback_endpoint.request(
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\rasa\utils\endpoints.py", line 146, in request
    async with session.request(
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\aiohttp\client.py", line 1012, in __aenter__
    self._resp = await self._coro
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\aiohttp\client.py", line 504, in _request
    await resp.start(conn)
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\aiohttp\client_reqrep.py", line 847, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
File "c:\users\vageesha\anaconda3\envs\rasa\lib\site-packages\aiohttp\streams.py", line 591, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError

As you see, after utter_greet it did not implement utter_home_menu

Please help.

Hi @vagi8, what is in your credentials.yml now (masking details if necessary)?

> rest:
> 
> callback:
>   url: "http://localhost:8081/send_to_whatsapp"
>
> rasa:
> url: "http://localhost:5002/api"

hi any update ?

Do you get the expected response when you call this address manually? What response do you receive?

Hey, No i wasnt getting any result in the body. But I now know my mistake i wasnt returning anything. I got it working now successfully. Thankyou