Hi all! I’m trying to do a chatbot on facebok messenger.So I want to send the user a welcome message containing his surname and name. However, while running the code, I get this error:
Encountered an exception while running action ‘action_welcome_with_name’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
I try to add an endpoint: http://localhost:5055/webhooks. But this didn’t solve the problem and I get now this error along side with the last one:
Failed to run custom action ‘action_welcome_with_name’. Couldn’t connect to the server at ‘http://localhost:5055/webhooks’. Is the server running?Error: Cannot connect to host localhost:5055 ssl:None [Connection refused]
My guest is that it is the endpoint which is not properly set. But I’m wondering which endpoint from facebook I need to specify there in other for the action to take place ?
Did you connect your bot as described here Messaging and Voice Channels ? If so, then you can also send messages to the user by doing dispatcher.utter_message("Hello World!") instead of doing the web request.
2020-01-27 15:26:51 DEBUG rasa.core.processor - Predicted next action ‘action_welcome_with_name’ with confidence 1.00.
2020-01-27 15:26:51 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_welcome_with_name’.
2020-01-27 15:26:52 ERROR rasa.core.processor - Encountered an exception while running action ‘action_welcome_with_name’. Bot will continue, but
he actions events are lost. Please check the logs of your action server for more information.
2020-01-27 15:26:52 DEBUG rasa.core.processor - Failed to execute custom action.
Traceback (most recent call last):
File “c:\users\administrator\documents\gbl_x_rasa_core\rasa\core\actions\action.py”, line 451, in run
json=json_body, method=“post”, timeout=DEFAULT_REQUEST_TIMEOUT
File “C:\Users\Administrator\Anaconda3\envs\rasa\lib\asyncio\coroutines.py”, line 110, in next
return self.gen.send(None)
File “c:\users\administrator\documents\gbl_x_rasa_core\rasa\utils\endpoints.py”, line 148, in request
resp.status, resp.reason, await resp.content.read()
rasa.utils.endpoints.ClientResponseError: 500, Internal Server Error, body=‘b’\n
Internal Server Error
\n
\n The server encou
tered an internal error and cannot complete\n your request.\n
\n’’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “c:\users\administrator\documents\gbl_x_rasa_core\rasa\core\processor.py”, line 502, in _run_action
events = await action.run(output_channel, nlg, tracker, self.domain)
File “C:\Users\Administrator\Anaconda3\envs\rasa\lib\asyncio\coroutines.py”, line 110, in next
return self.gen.send(None)
File “c:\users\administrator\documents\gbl_x_rasa_core\rasa\core\actions\action.py”, line 474, in run
raise Exception(“Failed to execute custom action.”) from e
Exception: Failed to execute custom action.
2020-01-27 15:26:52 DEBUG rasa.core.processor - Action ‘action_welcome_with_name’ ended with events ‘[]’
2020-01-27 15:26:52 DEBUG rasa.core.processor - Current slot values:
data: None
name: None
surname: None