[asyncio.exceptions.TimeoutError] within rasa interactive and custom action

(installingrasa) E:\starspace\GavinNLP\2022_gavin_rasa_case\financial_services_bot>rasa --version
Rasa Version      :         3.0.8
Minimum Compatible Version: 3.0.0
Rasa SDK Version  :         3.0.4
Rasa X Version    :         None
Python Version    :         3.8.8
Operating System  :         Windows-10-10.0.18362-SP0
Python Path       :         e:\anaconda3\envs\installingrasa\python.exe


? The bot wants to run 'transaction_search_form', correct? Yes
2022-03-01 13:34:08 ERROR    asyncio  - Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
  File "e:\anaconda3\envs\installingrasa\lib\asyncio\events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "e:\anaconda3\envs\installingrasa\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
    self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
2022-03-01 13:39:08 ERROR    rasa.core.processor  - Encountered an exception while running action 'transaction_search_form'.Bot will continue, but the acti
ons events are lost. Please check the logs of your action server for more information.
Traceback (most recent call last):
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\processor.py", line 868, in _run_action
    events = await action.run(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\actions\loops.py", line 26, in run
    events += await self.activate(output_channel, nlg, tracker, domain)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\actions\forms.py", line 596, in activate
    return await self.validate_slots(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\actions\forms.py", line 272, in validate_slots
    validate_events = await _action.run(output_channel, nlg, _tracker, domain)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\actions\action.py", line 722, in run
    response = await self.action_endpoint.request(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\utils\endpoints.py", line 164, in request
    async with session.request(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client.py", line 544, in _request
    await resp.start(conn)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client_reqrep.py", line 905, in start
    self._continue = None
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\helpers.py", line 656, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
2022-03-01 13:39:08 ERROR    rasa.core.training.interactive  - An exception occurred while recording messages.
Traceback (most recent call last):
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 1501, in record_messages
    await _predict_till_next_listen(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 978, in _predict_till_next_listen
    listen = await _validate_action(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 1181, in _validate_action
    await send_action(endpoint, conversation_id, action_name, policy, confidence)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 219, in send_action
    return await endpoint.request(json=payload, method="post", subpath=subpath)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\utils\endpoints.py", line 164, in request
    async with session.request(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client.py", line 544, in _request
    await resp.start(conn)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client_reqrep.py", line 905, in start
    self._continue = None
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\helpers.py", line 656, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
2022-03-01 13:39:08 ERROR    asyncio  - Task exception was never retrieved
future: <Task finished name='Task-9' coro=<SignalRouter._dispatch() done, defined at e:\anaconda3\envs\installingrasa\lib\site-packages\sanic\signals.py:10
2> exception=TimeoutError()>
Traceback (most recent call last):
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\sanic\signals.py", line 133, in _dispatch
    retval = await maybe_coroutine
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\sanic\app.py", line 1374, in run_delayed_task
    await prepped
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 1594, in run_interactive_io
    await record_messages(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 1501, in record_messages
    await _predict_till_next_listen(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 978, in _predict_till_next_listen
    listen = await _validate_action(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 1181, in _validate_action
    await send_action(endpoint, conversation_id, action_name, policy, confidence)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\core\training\interactive.py", line 219, in send_action
    return await endpoint.request(json=payload, method="post", subpath=subpath)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\rasa\utils\endpoints.py", line 164, in request
    async with session.request(
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client.py", line 544, in _request
    await resp.start(conn)
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\client_reqrep.py", line 905, in start
    self._continue = None
  File "e:\anaconda3\envs\installingrasa\lib\site-packages\aiohttp\helpers.py", line 656, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

I have modified the configuration file, but it seems to be invalid

anaconda3\envs\installingrasa\Lib\site-packages\rasa\core\channels\console.py

STREAM_READING_TIMEOUT_ENV = "RASA_SHELL_STREAM_READING_TIMEOUT_IN_SECONDS"
# DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS = 10
DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS = 3600

Please give guidance

@duanzhihua did you run the action server in the second terminal? i.e rasa run actions --debug ? If yes then

@duanzhihua I’d highly recommend creating the new conda environment and installing rasa again and meeting all the compatibilities errors.

@duanzhihua confirm with me did you followed any video tutorial for installing rasa on your machine? If yes please share the link.

1 Like

I run the Rasa Action Server in the second terminal and run rasa action server in debugging mode.

I also reinstalled and created a new environment of Rasa 3.0.8.

Now I have started the debugging of Rasa shell ,running rasa Action Server.Everything is working properly. Thank you very much for your guidance

@duanzhihua happy to help you :slight_smile: and good luck with your project.