ERROR asyncio - Task exception was never retrieve

rasa train nlu successfully, rasa shell nlu successfully, rasa train core successfully, but, I chat with rasa failed in last turn of the dialogue,

ok let me see what I can find
2019-09-11 11:53:44 ERROR    asyncio  - Task exception was never retrieved
future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at /home/powerop/work/project/rasa-master/rasa/core/run.py:122> exception=TimeoutError()>
Traceback (most recent call last):
  File "/home/powerop/work/project/rasa-master/rasa/core/run.py", line 126, in run_cmdline_io
    server_url=constants.DEFAULT_SERVER_FORMAT.format(port)
  File "/home/powerop/work/project/rasa-master/rasa/core/channels/console.py", line 137, in record_messages
    async for response in bot_responses:
  File "/home/powerop/.local/lib/python3.6/site-packages/async_generator/_impl.py", line 366, in step
    return await ANextIter(self._it, start_fn, *args)
  File "/home/powerop/.local/lib/python3.6/site-packages/async_generator/_impl.py", line 205, in throw
    return self._invoke(self._it.throw, type, value, traceback)
  File "/home/powerop/.local/lib/python3.6/site-packages/async_generator/_impl.py", line 209, in _invoke
    result = fn(*args)
  File "/home/powerop/work/project/rasa-master/rasa/core/channels/console.py", line 102, in send_message_receive_stream
    async for line in resp.content:
  File "/home/powerop/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 40, in __anext__
    rv = await self.read_func()
  File "/home/powerop/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 329, in readline
    await self._wait('readline')
  File "/home/powerop/.local/lib/python3.6/site-packages/aiohttp/streams.py", line 297, in _wait
    await waiter
  File "/home/powerop/.local/lib/python3.6/site-packages/aiohttp/helpers.py", line 585, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
2019-09-11 11:58:34 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_search_restaurants'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
2019-09-11 12:03:35 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_suggest'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.

I think the problem is just that you are not running the action server, see Actions

@amn41 I receive this error even after running the action server. Could I get help to solve this iisue?

I am having the exact same problem – my action server is running fine. I’m using Windows 10, Python 3.6.8, Anaconda Prompt as the command line interface, and the latest version of Rasa. I’m using the formbot tutorial example exactly as written, and I get this error message:

2019-12-23 03:19:07 ERROR asyncio - Task exception was never retrieved future: <Task finished coro=<configure_app..run_cmdline_io() done, defined at c:\springboard\miniconda\envs\myenv\lib\site-packages\rasa\core\run.py:124> exception=RuntimeError(‘This event loop is already running’,)> Traceback (most recent call last): File “c:\springboard\miniconda\envs\myenv\lib\site-packages\rasa\core\run.py”, line 128, in run_cmdline_io server_url=constants.DEFAULT_SERVER_FORMAT.format(“http”, port) File “c:\springboard\miniconda\envs\myenv\lib\site-packages\rasa\core\channels\console.py”, line 131, in record_messages text = get_user_input(button_question) File “c:\springboard\miniconda\envs\myenv\lib\site-packages\rasa\core\channels\console.py”, line 77, in get_user_input style=Style([(“qmark”, “#b373d6”), ("", “#b373d6”)]), File “c:\springboard\miniconda\envs\myenv\lib\site-packages\questionary\question.py”, line 45, in ask return self.unsafe_ask(patch_stdout) File “c:\springboard\miniconda\envs\myenv\lib\site-packages\questionary\question.py”, line 59, in unsafe_ask return self.application.run() File “c:\springboard\miniconda\envs\myenv\lib\site-packages\prompt_toolkit\application\application.py”, line 788, in run return get_event_loop().run_until_complete(self.run_async(pre_run=pre_run)) File “c:\springboard\miniconda\envs\myenv\lib\asyncio\base_events.py”, line 471, in run_until_complete self.run_forever() File “c:\springboard\miniconda\envs\myenv\lib\asyncio\base_events.py”, line 425, in run_forever raise RuntimeError(‘This event loop is already running’) RuntimeError: This event loop is already running

Did you get a solution for this? I am facing the same issue now but can’t find a solution!

I had come across same issue as JGreenLowe. Uninstalling rasa and rasa-sdk and reinstalling rasa==1.4.3 , I did not got RuntimeError: This event loop is already running but I got Exception occurred while handling uri: ‘http://localhost:5005/webhooks/rest/webhook?stream=true&token=’ which was solved by following Rasa Shell error following tutorial · Issue #5019 · RasaHQ/rasa · GitHub .

pip3 uninstall rasa
pip3 uninstall rasa-sdk

And reinstall:
pip3 install rasa==1.4.3

After this run rasa shell:
if its working then its fine,

elif got uri exception then:
pip3 install sanic==19.9.0

else pass

Rasa offers to execute an action within 10 seconds while the event loop is running. It can be customized by changing

DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS = 10

in rasa.core.channels.console

Where can i change this rasa.core.channels.console?

Same problem. How can i solve it?

Hello, i solved this issue by fixing requirements.txt, adding bellow into requirements:

google-auth==1.10.1 
prompt-toolkit==2.0.10 
questionary==1.4.0 
SQLAlchemy==1.3.12 
urllib3==1.25.7

Refer to: python - I tried to run rasa shell i am getting ERROR asyncio Task exception was never retrieved future - Stack Overflow

1 Like

thanks, it works for me