question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple sequential actions cause asyncio TimeoutError

See original GitHub issue

Rasa version: 1.2.4 Rasa SDK version: 1.2.0 Python version: Python 3.6.9 (Anaconda 4.5.13) Operating system : Win10, 64bit

Issue: Multiple sequential actions (I would say 4 and more) in row in one story lead to Task exception was never retrieved error (see traceback).

Story:

## FULL 1b
* want_search
    - action_search_start_print_utter
    - action_search_start_print_utter
    - action_search_start_print_utter
    - action_search_start_print_utter    
    - action_search_start_print_utter

Action:

class ActionSearchStartPrintUtter(Action):
    def name(self):
        return "action_search_start_print_utter"

    def run(self, dispatcher, tracker, domain):
        dispatcher.utter_template("utter_lets_do_it", tracker)
        return []

Command or request that led to error:

[Rasa]
rasa shell --credentials credentials.yml --endpoints endpoints.yml --port 4444  --log-file logs/out.log --debug  --verbose

[SDK]
python -m rasa_sdk --actions action_sdk.actions --verbose --debug

Error (including full traceback):

2019-09-03 21:17:53 INFO     root  - Connecting to channel 'cmdline' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.  
2019-09-03 21:17:53 INFO     root  - Starting Rasa server on http://localhost:4444
Bot loaded. Type a message and press enter (use '/stop' to exit): 
Your input ->  neco hledam                                                                                      

2019-09-03 21:18:14 WARNING  root  - Could not parse timestamp c1f48ac98a26479687b85d9aa9e1c2ec. Instead current UTC time will be passed to duckling. Error: invalid literal for int() with base 10: 'c1f48ac98a26479687b85d9aa9e1c2ec'
Lets do this
Lets do this
Lets do this
2019-09-03 21:18:22 ERROR    asyncio  - Task exception was never retrieved
future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\rasa\core\run.py:122> exception=TimeoutError()>
Traceback (most recent call last):
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\rasa\core\run.py", line 126, in run_cmdline_io
    server_url=constants.DEFAULT_SERVER_FORMAT.format(port)
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\rasa\core\channels\console.py", line 138, in record_messages
    async for response in bot_responses:
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\async_generator\_impl.py", line 366, in step
    return await ANextIter(self._it, start_fn, *args)
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\async_generator\_impl.py", line 205, in throw
    return self._invoke(self._it.throw, type, value, traceback)
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\async_generator\_impl.py", line 209, in _invoke
    result = fn(*args)
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\rasa\core\channels\console.py", line 103, in send_message_receive_stream
    async for line in resp.content:
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\aiohttp\streams.py", line 40, in __anext__  
    rv = await self.read_func()
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\aiohttp\streams.py", line 329, in readline  
    await self._wait('readline')
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\aiohttp\streams.py", line 297, in _wait     
    await waiter
  File "c:\users\tomas\anaconda3\envs\eqs_chatbot\lib\site-packages\aiohttp\helpers.py", line 585, in __exit__  
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

Rasa SDK output (if needed):

2019-09-03 21:16:20 INFO     rasa_sdk.endpoint  - Action endpoint is up and running. on ('0.0.0.0', 5055)       
2019-09-03 21:18:16 DEBUG    rasa_sdk.executor  - Received request to run 
2019-09-03 21:18:16 DEBUG    rasa_sdk.executor  - Finished running 'action_search_start_print_utter'
127.0.0.1 - - [2019-09-03 21:18:16] "POST /webhook HTTP/1.1" 200 200 0.032939
2019-09-03 21:18:18 DEBUG    rasa_sdk.executor  - Received request to run 
2019-09-03 21:18:18 DEBUG    rasa_sdk.executor  - Finished running 'action_search_start_print_utter'
127.0.0.1 - - [2019-09-03 21:18:18] "POST /webhook HTTP/1.1" 200 200 0.019048
2019-09-03 21:18:20 DEBUG    rasa_sdk.executor  - Received request to run 
2019-09-03 21:18:20 DEBUG    rasa_sdk.executor  - Finished running 'action_search_start_print_utter'
127.0.0.1 - - [2019-09-03 21:18:20] "POST /webhook HTTP/1.1" 200 200 0.018976
2019-09-03 21:18:22 DEBUG    rasa_sdk.executor  - Received request to run 
2019-09-03 21:18:22 DEBUG    rasa_sdk.executor  - Finished running 'action_search_start_print_utter'
127.0.0.1 - - [2019-09-03 21:18:22] "POST /webhook HTTP/1.1" 200 200 0.014997
2019-09-03 21:18:24 DEBUG    rasa_sdk.executor  - Received request to run 
2019-09-03 21:18:24 DEBUG    rasa_sdk.executor  - Finished running 'action_search_start_print_utter'
127.0.0.1 - - [2019-09-03 21:18:24] "POST /webhook HTTP/1.1" 200 200 0.008981

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ShaunHoltcommented, Apr 27, 2020

Thank you. I am enjoying Rasa.  A wonderful learning experience.

Get Outlook for Android

On Mon, Apr 27, 2020 at 2:52 AM -0400, “Tobias Wochinger” notifications@github.com wrote:

@ShaunHolt This is related to #4606 . There will be fix in the next release #5686

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

1reaction
tocosastalocommented, Oct 9, 2019

I would say that generally run mode takes the same action less time than in shell mode in my environment. So users of other channels are not very affected.

Returning to the beginning of the issue, the action was as simple as it could have been - it utters one text-only template:

class ActionSearchStartPrintUtter(Action):
    def name(self):
        return "action_search_start_print_utter"

    def run(self, dispatcher, tracker, domain):
        dispatcher.utter_template("utter_lets_do_it", tracker)
        return []

Story was also very simple:

* want_search
    - action_search_start_print_utter
    - action_search_start_print_utter
    - action_search_start_print_utter
    - action_search_start_print_utter    
    - action_search_start_print_utter

And it hit the timeout limit in shell mode. In run mode it is done in 1 second. I thought it was a bug, but it would be a problem on my side. I think we can close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Weird behaviour of asyncio.CancelledError and ...
This code waits for future to complete with a timeout. And if a timeout occurs, it cancels the future and raises asyncio.TimeoutError ....
Read more >
asyncio.TimeoutError - Rasa Open Source
Hey @gandharv30 that happens refer this Multiple sequential actions cause asyncio TimeoutError · Issue #4381 · RasaHQ/rasa · GitHub and when ...
Read more >
Python Asyncio: The Complete Guide
It is a Python library that allows us to run code using an asynchronous programming model. This lets us handle multiple I/O operations...
Read more >
Exceptions — Python 3.11.1 documentation
This exception can be caught to perform custom operations when asyncio Tasks are cancelled. In almost all situations the exception must be re-raised....
Read more >
API Reference - discord.py
Note that this does propagate the asyncio.TimeoutError for you in case of timeout and is provided for ease of use. In case the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found