Unable to start rasa-x in local mode

Rasa Version : 2.8.6 Minimum Compatible Version: 2.8.0 Rasa SDK Version : 2.8.2 Rasa X Version : 0.42.2 Python Version : 3.8.11

Edition Windows 10 Home
Version 20H2
OS build 19042.1165
Experience Windows Feature Experience Pack 120.2212.3530.0

I had come across the below error message when I installed rasa-x and launch in local mode:

c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasa\shared\core\slots.py:311: FutureWarning: UnfeaturizedSlot is deprecated and will be removed in Rasa Open Source 3.0. Please ch ange the type and configure the ‘influence_conversation’ flag for slot ‘requested_slot’ instead. rasa.shared.utils.io.raise_warning( Starting Rasa X in local mode… � 2021-09-16 10:11:10 WARNING rasax.community.services.insights.insight_service - No new evaluation results. 2021-09-16 10:11:13 ERROR concurrent.futures - exception calling callback for <Future at 0x1f42ff7bb50 state=finished raised gaierror> Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\chatbot\lib\concurrent\futures\thread.py”, line 57, in run result = self.fn(*self.args, **self.kwargs) File “c:\users\tszch\anaconda3\envs\chatbot\lib\socket.py”, line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\chatbot\lib\concurrent\futures_base.py”, line 328, in _invoke_callbacks callback(self) File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\futures.py”, line 374, in _call_set_state dest_loop.call_soon_threadsafe(_set_state, destination, source) File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\base_events.py”, line 764, in call_soon_threadsafe self._check_closed() File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\base_events.py”, line 508, in _check_closed raise RuntimeError(‘Event loop is closed’) RuntimeError: Event loop is closed 2021-09-16 10:11:13 ERROR concurrent.futures - exception calling callback for <Future at 0x1f42ff860d0 state=finished returned list> Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\chatbot\lib\concurrent\futures_base.py”, line 328, in _invoke_callbacks callback(self) File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\futures.py”, line 374, in _call_set_state dest_loop.call_soon_threadsafe(_set_state, destination, source) File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\base_events.py”, line 764, in call_soon_threadsafe self._check_closed() File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\base_events.py”, line 508, in _check_closed raise RuntimeError(‘Event loop is closed’) RuntimeError: Event loop is closed Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasa\cli\x.py”, line 496, in run_locally local.main( File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\local.py”, line 257, in main common_utils.run_in_loop(model_service.discover_models()) File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\utils\common.py”, line 900, in run_in_loop return loop.run_until_complete(coro) File “c:\users\tszch\anaconda3\envs\chatbot\lib\asyncio\base_events.py”, line 616, in run_until_complete return future.result() File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\model_service.py”, line 821, in discover_models await model_service.discover_models() File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\model_service.py”, line 147, in discover_models await _run_loop(max_retries, sleep_in_seconds) File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\model_service.py”, line 133, in _run_loop await self._discover_models() File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\model_service.py”, line 185, in _discover_models minimum_version = await self._retry_fetching_minimum_compatible_version() File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\model_service.py”, line 174, in _retry_fetching_minimum_compatible_version minimum_version = await self.minimum_compatible_version() File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\model_service.py”, line 160, in minimum_compatible_version info = await stack_service.version() File “c:\users\tszch\anaconda3\envs\chatbot\lib\site-packages\rasax\community\services\stack_service.py”, line 112, in version response = await session.get( File “C:\Users\tszch\AppData\Roaming\Python\Python38\site-packages\aiohttp\client.py”, line 619, in _request break File “C:\Users\tszch\AppData\Roaming\Python\Python38\site-packages\aiohttp\helpers.py”, line 656, in exit raise asyncio.TimeoutError from None asyncio.exceptions.TimeoutError

Sorry, something went wrong (see error above). Make sure to start Rasa X with valid data and valid domain and config files. Please, also check any warnings that popped up. If you need help fixing the issue visit our forum: https://forum.rasa.com/.

I am not sure if my issue related with asyncio. I often encountered a TimeoutError after idling the shell mode for a while. Would it be the main cause? How can I resolve the issue?

@arthurchan Hello! Can you type rasa --version in your virtual environment and share the screenshot please.

@arthurchan

I’d recommend to create a fresh conda environment with python 3.7 or 3.8 and follow the step

`pip install rasa==2.8.1`
 #I guess it will install both rasa and rasa-sdk else please install rasa-sdk==2.8.1

check version rasa --version its install or not

then

pip install rasa-x==0.39.3 --extra-index-url https://pypi.rasa.com/simple

check rasa version rasa --version its install or not

You will see some error : ImportError: cannot import name ‘RowProxy’ from ‘sqlalchemy.engine’ Install

pip install SQLAlchemy==1.3.22 should fix it

If sanic related error: pip install sanic-jwt==1.6.0

delete .db if is showing alembic issue.

@arthurchan If you have any error, please let me know.

Good luck! I hope this will solve your issue.

@nik202 Thanks for the prompt reply. It worked after following the steps. However, I have caught another error message:

Starting Rasa X in local mode… � 2021-09-16 15:05:00 WARNING rasax.community.services.insights.insight_service - No new evaluation results. 2021-09-16 15:05:03 ERROR concurrent.futures - exception calling callback for <Future at 0x198af729e50 state=finished raised gaierror> Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\rasa\lib\concurrent\futures\thread.py”, line 57, in run result = self.fn(*self.args, **self.kwargs) File “c:\users\tszch\anaconda3\envs\rasa\lib\socket.py”, line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\rasa\lib\concurrent\futures_base.py”, line 328, in _invoke_callbacks callback(self) File “c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\futures.py”, line 374, in _call_set_state dest_loop.call_soon_threadsafe(_set_state, destination, source) File “c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\base_events.py”, line 764, in call_soon_threadsafe self._check_closed() File “c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\base_events.py”, line 508, in _check_closed raise RuntimeError(‘Event loop is closed’) RuntimeError: Event loop is closed 2021-09-16 15:05:03 ERROR concurrent.futures - exception calling callback for <Future at 0x198af72d3d0 state=finished returned list> Traceback (most recent call last): File “c:\users\tszch\anaconda3\envs\rasa\lib\concurrent\futures_base.py”, line 328, in _invoke_callbacks callback(self) File “c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\futures.py”, line 374, in _call_set_state dest_loop.call_soon_threadsafe(_set_state, destination, source) File “c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\base_events.py”, line 764, in call_soon_threadsafe self._check_closed() File “c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\base_events.py”, line 508, in _check_closed raise RuntimeError(‘Event loop is closed’) RuntimeError: Event loop is closed [2021-09-16 15:05:11 +0800] [14928] [INFO] Goin’ Fast @ http://0.0.0.0:5002 2021-09-16 15:05:11 INFO sanic.root - Goin’ Fast @ http://0.0.0.0:5002

The server is running at http://localhost:5002/login?username=me&password=Hv2Tzlm6c2IC

[2021-09-16 15:05:12 +0800] [14928] [INFO] Starting worker [14928] 2021-09-16 15:05:12 INFO sanic.root - Starting worker [14928] c:\users\tszch\anaconda3\envs\rasa\lib\site-packages\rasa\utils\train_utils.py:641: UserWarning: constrain_similarities is set to False. It is recommended to set it to True when using cross-entropy loss. It will be set to True by default, Rasa Open Source 3.0.0 onwards. rasa.shared.utils.io.raise_warning( 2021-09-16 15:05:40 ERROR asyncio - Task was destroyed but it is pending! task: <Task pending name=‘Task-9’ coro=<TCPConnector._resolve_host() running at C:\Users\tszch\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py:865> wait_for=<Future pen ding cb=[_chain_future.._call_check_cancel() at c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\futures.py:360, <TaskWakeupMethWrapper object at 0x00000198AE690C10>()]> cb=[TCPConn ector._create_direct_connection..drop_exception() at C:\Users\tszch\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py:1002]> 2021-09-16 15:05:40 ERROR asyncio - Task was destroyed but it is pending! task: <Task pending name=‘Task-8’ coro=<TCPConnector._resolve_host() running at C:\Users\tszch\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py:865> wait_for=<Future pen ding cb=[_chain_future.._call_check_cancel() at c:\users\tszch\anaconda3\envs\rasa\lib\asyncio\futures.py:360, <TaskWakeupMethWrapper object at 0x00000198AF72D310>()]> cb=[TCPConn ector._create_direct_connection..drop_exception() at C:\Users\tszch\AppData\Roaming\Python\Python38\site-packages\aiohttp\connector.py:1002]> WARNING:rasax.community.services.event_consumers.event_consumer:Saving event failed due to an ‘IntegrityError’. This means that the event is already stored in the database. The event data was ‘{“sender_id”: “ac034a65be614568a7f61c49ff162dc8”, “event”: “action”, “timestamp”: 1631775969.9691477, “name”: “action_listen”, “policy”: null, “confidence”: null, “action_text”: nul l, “hide_rule_turn”: false}’. (sqlite3.IntegrityError) UNIQUE constraint failed: conversation_event.conversation_id, conversation_event.timestamp, conversation_event.type_name [SQL: INSERT INTO conversation_event (conversation_id, type_name, timestamp, intent_name, action_name, slot_name, slot_value, policy, is_flagged, data, evaluation, rasa_environment) VALUE S (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] [parameters: (‘ac034a65be614568a7f61c49ff162dc8’, ‘action’, 1631775969.9691477, None, ‘action_listen’, None, None, None, 0, ‘{“sender_id”: “ac034a65be614568a7f61c49ff162dc8”, “event”: “ac tion”, “timestamp”: 1631775969.9691477, “name”: “action_listen”, “policy”: null, “confidence”: null, “action_text”: null, “hide_rule_turn”: false}’, None, ‘production’)] (Background on this error at: Error Messages — SQLAlchemy 1.3 Documentation)

Do you have any idea?

@arthurchan can you please delete the cookies and cache from the web browser and try run please?

@arthurchan This is just a warning, can you confirm you are able to take with bot and you getting back the response?

@arthurchan Can you even share the above error screenshot and rasa version to.

@nik202 I had deleted the cookies and cache from the web browser and run again.

@nik202 I tried to talk to my bot and it seemed to respond to me as expected.

@nik202 Below are the screenshots from my command line

@nik202 Below shows my rasa version:

@arthurchan This is can be the issue of the network as it showing TCP connector. I guess your bot is fine and you can work. It should not affect your bot/user conversation. If there is any further solution I will share with you :slight_smile:

@arthurchan I would also like to request to please close this thread with the solution for others.

Good Luck!

Thank you!

@arthurchan No worries :pray:

Valuable links and resources for your reference

  1. RasaMasterclass
  2. Conversational AI with Rasa
  3. Rasa for Beginners
  4. Rasa Certification Workshop
  5. Rasa Advanced Custom Actions, Forms, & Responses Workshop
  6. Rasa Advanced Deployment Workshop
  7. Rasa Youtube Channel Please subscribe and hit the bell icon for notification.
  8. Rasa Github Mini Project

I hope these links will help you to learn Rasa!