Error while runing rasa actions

raise asyncio.TimeoutError from None concurrent.futures._base.TimeoutError Transport closed @ (‘127.0.0.1’, 56725) and exception experienced during error handling

I faced this error after i run an action …

Hello @hamzaghannem2,

can you post the code of you actions.py that you are trying to execute?

Cya!

class ActionHelloWorld(Action):

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

 def run(self, dispatcher: CollectingDispatcher,
         tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
     time.sleep(15)
     var=tracker.get_slot("data")
     driver = webdriver.Chrome('./chromedriver')
     driver.get(var)
     search_bar = driver.find_element_by_name("q")
     search_bar.send_keys(Keys.RETURN)
     driver.close()

     dispatcher.utter_message("done!")

     return []

the code executed succesfuly but after that the error message displayed and the chat is ended.

Hello @hamzaghannem2,

By my experience this sleep is strange, the methods on action server are assyncronous, try remove it.

If doesn’t works try remove all code and leave just the uttering, just to check if is something on code that is messing with process loop of python.

Cya!

even when i removed the time.sleep(15) the error still appear , but when i use the action to just return an utter_msg it works … the code it working successfuly outside the bot process but i don’t know the source of this error ,

@hamzaghannem2

perhaps some of the lines below are asynchronous and need to be awaited?

driver = webdriver.Chrome('./chromedriver')
driver.get(var)
search_bar = driver.find_element_by_name("q")
search_bar.send_keys(Keys.RETURN)
driver.close()