I am trying to fetch a value from a database through an API. I am able to do so successfully and print those in the terminal through, but the bot is not able to show those values and it raises an error asyncio.TimeoutError Traceback (most recent call last): File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/rasa/core/”, line 134, in run_cmdline_io sender_id=conversation_id, File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/rasa/core/channels/”, line 139, in record_messages async for response in bot_responses: File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/rasa/core/channels/”, line 105, in send_message_receive_stream async for line in resp.content: File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/aiohttp/”, line 39, in anext rv = await self.read_func() File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/aiohttp/”, line 328, in readline await self._wait(‘readline’) File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/aiohttp/”, line 296, in _wait await waiter File “/Users/gandharv/opt/anaconda3/lib/python3.7/site-packages/aiohttp/”, line 596, in exit raise asyncio.TimeoutError from None concurrent.futures._base.TimeoutError Transport closed @ (‘’, 60445) and exception experienced during error handling

Here is my file

from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from email.message import EmailMessage from import SlotSet import smtplib import psycopg2

class ActionHelloWorld(Action):

def name(self) -> Text:
    return "action_hello_world"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

Getting slot values

    sender_email = tracker.get_slot('email')
    entity_name = tracker.get_slot('entity_name')


    user = "my user"
    password = "mypass"
    host = " "
    port = 8081
    database = "dla"
    db_conn = psycopg2.connect(host=host, user=user, password=password, database=database)
    cursor = db_conn.cursor()
    sql_query = "SELECT * FROM operational_metadata WHERE bor_name = %s; "
    cursor.execute(sql_query, (entity_name,))
    result = cursor.fetchall()
    for row in result:
        a0 = row[0]
        a1 = row[1]
        a2 = row[2]
        a3 = row[3]
        a4 = row[4]
        a5 = row[5]
        a6 = row[6]
        a7 = row[7]
        a8 = row[8]
        a9 = row[9]
        a10 = row[10]
        a11 = row[11]
        a12 = row[12]
        a13 = row[13]
        a14 = row[14]
        a15 = row[15]
        a16 = row[16]
    response = """ details are: {}, {}, {}, {}, {},  {},  {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}.""".format(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16)


    msg = EmailMessage()
    msg['Subject'] = 'Final Testing'
    msg['From'] = "myemail"
    msg['To'] = sender_email
    server = smtplib.SMTP_SSL('', 465)
    server.login("myemail", "mypass")
    return [SlotSet('email',sender_email),SlotSet('entity_name',entity_name)]

I am using Rasa 1.9.5 and rasa shell command along with rasa run actions to run the action server

Hey @gandharv30 that happens refer this Multiple sequential actions cause asyncio TimeoutError · Issue #4381 · RasaHQ/rasa · GitHub and when I’m integrating with it telegram, giving me all responses with out any asyncio error

1 Like

Thanks @bparikh99, I did refer to this. But it did not help me much. My code does not takes 10 sec to execute as I its evident from terminal. Could you help me solve this issue? Also @Juste

@gandharv30 updating rasa could solve your proble, i think so!!

I am using the latest version @bparikh99

hi dear i was face alot of these errors now lets debug where is the error. first before the


type try:

and after



except mysql.connector.Error as error:

        print("parameterized query failed {}".format(error))

        dispatcher.utter_message("error messages here")

just make the right format for the code then in the terminal you will get the error where exactly.

2nd method to trace it in each line by line type some deferent print to terminal to see witch of these is work and where the error occurs .

hope that help you.