Hi,
I just encountered a similar problem, although in my case it is not caused by a slow custom action, and I have seen it occurred only once so far.
Here is the action code:
class ActionSetStartDefaultActionParameters(Action):
"""Set next_question_action slot for the beginning
of the conversation"""
def name(self) -> Text:
return "action_set_start_default_action_parameters"
def run(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# Extract any title, name, introduction and time of day flag
latest_message = tracker.current_state()["latest_message"]["text"]
entitiesValues = re.findall( '(title|name|intro|tod)_([^\s]*)', latest_message, re.IGNORECASE )
return [
SlotSet("next_question_action", "utter_action_first_question"),
] + [ SlotSet(entity,value) for (entity,value) in entitiesValues ]
As you can see this action simply performs a RegEx search to extract key/value pairs from a string and finally assign those values to slots having the same names as the keys.
Also, the error message on the RASA Bot side is slightly different than what the OP describes, but the root error is also a concurrent.futures._base.CancelledError from aiohttp
ERROR rasa.core.processor - Encountered an exception while running action 'action_set_start_default_action_parameters'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
2020-10-09 09:48:01 DEBUG rasa.core.processor -
Traceback (most recent call last):
File "/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py", line 650, in _run_action
events = await action.run(output_channel, nlg, tracker, self.domain)
File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 549, in run
json=json_body, method="post", timeout=DEFAULT_REQUEST_TIMEOUT
File "/opt/venv/lib/python3.7/site-packages/rasa/utils/endpoints.py", line 150, in request
**kwargs,
File "/opt/venv/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
self._resp = await self._coro
File "/opt/venv/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request
timeout=real_timeout
File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection
req, traces, timeout)
File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 967, in _create_direct_connection
traces=traces), loop=self._loop)
concurrent.futures._base.CancelledError
They are no errors in the action server logs.
The setup:
I’m running the RASA bot (docker image rasa/rasa:1.10.8) and action server (image rasa/rasa-sdk:1.10.2) in separate docker containers on the same docker overlay network - although the 2 containers are deployed on the same host.
Remarks:
Debugging some completely unrelated client/server application exchanging data using TCP on a similar overlay network, I have noticed that data packets can randomly be lost during transmission without triggering any error. Although it has only ever occurred between containers on different hosts, I thought I mention it in case it helps narrow down the problem.
Edit:
From my application logs, I can see that there were network packets lost between 2 others services running on the same overlay network as the RASA bot and action server at the same time as this error occurred, which suggests that in my case it is purely a networking problem.