ERROR asyncio - Task exception was never retrieve - Rasa Open Source - Rasa Community Forum

ERROR asyncio - Task exception was never retrieve

post by IamHimon on Sep 11, 2019

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.

post by amn41 on Sep 11, 2019

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

post by shiv on Dec 11, 2019

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

post by JGreenLowe on Dec 23, 2019

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')

post by Shamim9007 on Jan 6, 2020

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

post by shrestha1 on Jan 7, 2020

I had come across the same issue as JGreenLowe. Uninstalling rasa and rasa-sdk and reinstalling rasa==1.4.3, I did not get 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 pip3 install rasa==1.4.3

post by caioreis350 on Jan 30, 2020

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

post by ankitrohilla1 on Jan 31, 2020

Same problem. How can I solve it?

post by cocofish on Feb 5, 2020

Hello, I solved this issue by fixing requirements.txt, adding below 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

post by Sandy1811 on Feb 21, 2020

thanks, it works for me

post by arunjyoti1995 on Jun 12, 2020

Thanks a lot. It worked out.

post by RBenjaminfranklin on Jun 30, 2020

@cocofish it worked for me once but now it is showing the same error again after sometime

post by pkumar-a on Nov 6, 2020

I am using Windows 10 and running rasa 2.0. The fix for me was to run the command prompt in administrator mode. If I run command prompt under normal user mode, I was getting the error.

post by NikoAP77 on Jan 7, 2021

How did you solve the error?

post by Johan1us on Jan 15, 2021

That’s what I needed! Thanks!

post by bharatji30 on Mar 21, 2021

Hoping to add this latest reply for fixing this issue. It was enough downgrading only questionary to ==1.4.0 to solve the error.

post by Ludiana on Mar 21, 2021

it seems like it is not working for me, I am trying to upgrade to rasa 2.0 and I keep getting this error. when I change the questionary version to 1.4.0 it says it is not compatible, any suggestions?

post by themrcesi on Apr 8, 2021

Having the same error, for me it was enough to uninstall and install rasa again. Hope it helps for someone!

post by rushi2440 on Oct 22, 2021

We have a similar issue, please check the screenshot and error below:

ERROR asyncio - Task exception was never retrieved future: <Task finished name='Task-2' coro=<configure_app..run_cmdline_io() done, defined at /mnt/d/Jinay/Work-Sofftware/DATA/rasa-venv/lib/python3.8/site-packages/rasa/core/run.py:131> exception=TimeoutError()>

post by hsm207 on Oct 27, 2021

were you talking to the bot using rasa shell?

post by actorkrishna on Feb 10, 2022

Yes

post by nat on Mar 28, 2022

Any other suggestions for this? I am getting the same error within my custom policy and I am not sure why! I have tried out a bunch of the solutions suggested here but none seem to be the fix with Rasa 3.0

post by mansimht on Aug 29, 2022

Can you please tell me in this console.py file where can I change this DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS = 10 ?

post by tuananh99 on Aug 30, 2022

Thanks a lot, worked for me.

post by Andy626-Worlder on Sep 27, 2022

Hello there, I did find the console.py, but there is none DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS= 10 in there, is there any suggestion you can give me? Thanks in advance!

post by edu_vives on Oct 11, 2022

Hi all, I am using PyCharm and I have encountered the same problem. In my case I have solved it by simply running the “Invalidate Caches and Restart” option. I hope someone will find it helpful!

post by nageshkale on Apr 1, 2023

same issue in my bot. whenever my bot gives sorry it is going into TimeoutError please help.

I am providing my error.

asyncio - Task exception was never retrieved future: <Task finished coro=<RestInput.on_message_wrapper() done, defined at C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\channels\rest.py:33> exception=KeyError('action_two_stage_fallback')>

Traceback (most recent call last): File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\channels\rest.py", line 47, in on_message_wrapper await on_new_message(message) File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\channels\channel.py", line 89, in handler await app.agent.handle_message(message) File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\agent.py", line 430, in handle_message return await self.processor.handle_message(message) File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\processor.py", line 146, in handle_message tracker = await self.run_action_extract_slots(message.output_channel, tracker) File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\processor.py", line 173, in run_action_extract_slots output_channel, self.nlg, tracker, self.domain File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\core\actions\action.py", line 1171, in run mapping, tracker, domain File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\shared\core\slot_mappings.py", line 115, in intent_is_desired mapping, domain, active_loop_name File "C:\Users\GM\anaconda3\envs\rasa3.0.2\lib\site-packages\rasa\shared\core\slot_mappings.py", line 95, in _get_active_loop_ignored_intents form_ignored_intents = domain.forms[active_loop_name].get( KeyError: 'action_two_stage_fallback'

post by nageshkale on Apr 1, 2023

stuck with the same problem please help if you have solved this problem

post by Rajashekar on Jun 7, 2023

I am facing the same issue as … can anyone help in this … I tried with questionary == 1.4 as well it didn’t get resolved

post by OzzYzzO on Dec 2, 2024

Hi. I faced the same issue and solved it just by reinstalling rasa with “pip install rasa”. In my case it happened because I was working in two computers (with different python versions) and synced project from github.