Rasa version: 2.6.0
Rasa SDK version: 2.6.0
Python version: 3.8.8
Operating system: linux (ubuntu 18.04)
Hi community,
I am stucked with a very often asyncio time out error when running rasa shell with custom actions using graphQL API:
gql.transport.aiohttp - >>> {"query": "mutation domain_validation($id_domain: String!) {\n postDomain(domainId: $id_domain)\n}\n", "variables": {"id_domain": "DM129"}}
Exception occurred while handling uri: 'http://localhost:5055/webhook'
Traceback (most recent call last):
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/site-packages/sanic/app.py", line 938, in handle_request
response = await response
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/site-packages/rasa_sdk/endpoint.py", line 104, in webhook
result = await executor.run(action_call)
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/site-packages/rasa_sdk/executor.py", line 397, in run
events = await utils.call_potential_coroutine(
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/site-packages/rasa_sdk/utils.py", line 230, in call_potential_coroutine
return await coroutine_or_return_value
File "/home/matthieu/RASA/rasa/actions/actions.py", line 207, in run
bool_domain = await set_domain(client, id_domain_selected)
File "/home/matthieu/RASA/rasa/actions/tiny.py", line 244, in set_domain
return await session.execute(mutation, variable_values=params)
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/site-packages/gql/client.py", line 408, in execute
result = await self._execute(document, *args, **kwargs)
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/site-packages/gql/client.py", line 396, in _execute
return await asyncio.wait_for(
File "/home/matthieu/anaconda3/envs/rasa-os-2.6/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
I tried to increase the DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS
from 10 to 60 (seconds) ass suggested in other similar topics but this didn’t solve the problem.
Please find below the associated code in actions.py: class ActionAskFeedbackLoopPrecontent(Action): def name(self): return “action_ask_feedback_loop_precontent”
async def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
## Set domain selected
id_domain_selected = tracker.get_slot("id_domain")
bool_domain = await set_domain(client, id_domain_selected)
## Get precontent
if bool_domain:
precontent_msg = await get_pre_content(client)
text = precontent_msg.get('tcText').get('reading')
buttons = [
{"payload": "/affirm", "title": precontent_msg.get('tcText').get('responses')[0]}
]
dispatcher.utter_message(text=text, buttons=buttons)
return []
else:
sys.exit("The validation of the selected domain has failed")
Thanks in advance for your lights !