Error thrown while running 'rasa x' command

After running the rasa x command, the following is shown:

Starting Rasa X in local mode... 🚀
2021-07-16 10:15:08 WARNING  rasax.community.services.insights.insight_service  - No local evaluation result files found.
2021-07-16 10:15:10 ERROR    concurrent.futures  - exception calling callback for <Future at 0x1b774c828b0 state=finished raised gaierror>
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\concurrent\futures\_base.py", line 328, in _invoke_callbacks
    callback(self)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\futures.py", line 374, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 764, in call_soon_threadsafe
    self._check_closed()
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
2021-07-16 10:15:10 ERROR    concurrent.futures  - exception calling callback for <Future at 0x1b774d46a00 state=finished returned list>
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv\lib\concurrent\futures\_base.py", line 328, in _invoke_callbacks
    callback(self)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\futures.py", line 374, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 764, in call_soon_threadsafe
    self._check_closed()
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\site-packages\rasa\cli\x.py", line 496, in run_locally
    local.main(
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\local.py", line 257, in main
    common_utils.run_in_loop(model_service.discover_models())
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\utils\common.py", line 900, in run_in_loop
    return loop.run_until_complete(coro)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\model_service.py", line 821, in discover_models
    await model_service.discover_models()
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\model_service.py", line 133, in _run_loop
    await self._discover_models()
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\model_service.py", line 160, in minimum_compatible_version
    info = await stack_service.version()
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\stack_service.py", line 92, in version
    response = await session.get(
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\aiohttp\client.py", line 619, in _request
    break
  File "c:\users\007km\anaconda3\envs\venv\lib\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: http://forum.rasa.com/.

I am on: Rasa Version : 2.8.0 Minimum Compatible Version: 2.8.0 Rasa SDK Version : 2.8.0 Rasa X Version : 0.41.2 Python Version : 3.8.8

I would greatly appreciate it if anyone could guide me to a solution.

Thanks

@rishubm Try this

  1. Go to the directory: venv/Lib/python/site-packages/rasa/core/channels/console.py
  2. Change the default value of DEFAULT_STREAM_READING_TIMEOUT_IN_SECONDS to more than 10, what ever time you required.

Note: venv or what ever is your virtual environment name. Hope it will fix your issue.If error still persist share the error.

Hey @nik202 Thanks for the reply. Unfortunately, the issue is still persisting with the same error:

Starting Rasa X in local mode... 🚀
2021-07-16 13:44:06 WARNING  rasax.community.services.insights.insight_service  - No local evaluation result files found.
2021-07-16 13:44:08 ERROR    concurrent.futures  - exception calling callback for <Future at 0x229193dfb20 state=finished raised gaierror>
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\concurrent\futures\_base.py", line 328, in _invoke_callbacks
    callback(self)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\futures.py", line 374, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 764, in call_soon_threadsafe
    self._check_closed()
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
2021-07-16 13:44:08 ERROR    concurrent.futures  - exception calling callback for <Future at 0x229193e80a0 state=finished returned list>
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv\lib\concurrent\futures\_base.py", line 328, in _invoke_callbacks
    callback(self)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\futures.py", line 374, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 764, in call_soon_threadsafe
    self._check_closed()
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\site-packages\rasa\cli\x.py", line 496, in run_locally
    local.main(
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\local.py", line 257, in main
    common_utils.run_in_loop(model_service.discover_models())
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\utils\common.py", line 900, in run_in_loop
    return loop.run_until_complete(coro)
  File "c:\users\007km\anaconda3\envs\venv\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\model_service.py", line 821, in discover_models
    await model_service.discover_models()
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\model_service.py", line 133, in _run_loop
    await self._discover_models()
  File "c:\users\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\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\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\model_service.py", line 160, in minimum_compatible_version
    info = await stack_service.version()
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\rasax\community\services\stack_service.py", line 92, in version
    response = await session.get(
  File "c:\users\007km\anaconda3\envs\venv\lib\site-packages\aiohttp\client.py", line 619, in _request
    break
  File "c:\users\007km\anaconda3\envs\venv\lib\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: http://forum.rasa.com/.

This is what the editied ‘console.py’ file looks like ( I tried with a few different times but none seemed to fix the issue)

@rishubm What is your rasa version? rasa --version and are you able to see rasa x in browser but in terminal you seeing this error right?

@nik202 Im on version 2.8.0 as shown here image

As for using rasa x in browser, I haven’t tried that. How would I do that?

@rishubm you running rasa x in browser? or on terminal rasa x and it will open in default browser.

@nik202 I am running it on terminal but it hasn’t opened any browser for me

@rishubm strange… Install these packages

google-auth==1.10.1 
prompt-toolkit==2.0.10 
questionary==1.4.0 
SQLAlchemy==1.3.12 
urllib3==1.25.7

you will see resolver message just copy --use-feature=2020-resolver and paste next to command

such as pip install urllib3==1.25.7 --use-feature=2020-resolver

@rishubm even try this pip install sanic==19.9.0

I sure, it will still not solve but try.

@rishubm Even I try replicate your configuration and I am able to run rasa x thou I not use Rasa X at all.

@nik202 Nope, still getting the same error messages.

Also, looks like the packages you suggested have compatibility issues

@rishubm try install all these dependencies >=1.5.1 and so on.

i.e pip install questionary==1.5.1

@nik202 I reinstalled them with the updated versions and no longer the the dependency conflicts but the original issue persists

Screenshot 2021-07-16 at 8.05.28 PM

I am using this config its working fine, without any issue, may be python version issue with latest update, try use lower versions.

@rishubm did you tried this? `ip install sanic==19.9.0

@nik202 Yes, I tried downgrading sanic but it didnt fix.

I also created a new environment on python 3.7.7 and reinstalled rasa and rasa x. The error message I get now is similar but says ‘concurrent.futures._base.TimeoutError’ instead of ‘asyncio.exceptions.TimeoutError’ on the last line. Here is the full message:

Starting Rasa X in local mode... 🚀
2021-07-16 14:15:50 WARNING  rasax.community.services.insights.insight_service  - No local evaluation result files found.
2021-07-16 14:15:53 ERROR    concurrent.futures  - exception calling callback for <Future at 0x226753fd348 state=finished raised gaierror>
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv37\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\users\007km\anaconda3\envs\venv37\lib\socket.py", line 752, 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\007km\anaconda3\envs\venv37\lib\concurrent\futures\_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\futures.py", line 365, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\base_events.py", line 736, in call_soon_threadsafe
    self._check_closed()
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\base_events.py", line 479, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
2021-07-16 14:15:53 ERROR    concurrent.futures  - exception calling callback for <Future at 0x226753fd908 state=finished returned list>
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv37\lib\concurrent\futures\_base.py", line 324, in _invoke_callbacks
    callback(self)
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\futures.py", line 365, in _call_set_state
    dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\base_events.py", line 736, in call_soon_threadsafe
    self._check_closed()
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\base_events.py", line 479, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\rasa\cli\x.py", line 502, in run_locally
    domain_path=domain_path,
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\rasax\community\local.py", line 257, in main
    common_utils.run_in_loop(model_service.discover_models())
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\rasax\community\utils\common.py", line 900, in run_in_loop
    return loop.run_until_complete(coro)
  File "c:\users\007km\anaconda3\envs\venv37\lib\asyncio\base_events.py", line 587, in run_until_complete
    return future.result()
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\rasax\community\services\model_service.py", line 821, in discover_models
    await model_service.discover_models()
  File "c:\users\007km\anaconda3\envs\venv37\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\007km\anaconda3\envs\venv37\lib\site-packages\rasax\community\services\model_service.py", line 133, in _run_loop
    await self._discover_models()
  File "c:\users\007km\anaconda3\envs\venv37\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\007km\anaconda3\envs\venv37\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\007km\anaconda3\envs\venv37\lib\site-packages\rasax\community\services\model_service.py", line 160, in minimum_compatible_version
    info = await stack_service.version()
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\rasax\community\services\stack_service.py", line 95, in version
    timeout=timeout_in_seconds,
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\aiohttp\client.py", line 619, in _request
    break
  File "c:\users\007km\anaconda3\envs\venv37\lib\site-packages\aiohttp\helpers.py", line 656, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

@rishubm do you have rasa init basic file? @rishubm have you try rasa shell or rasa shell before rasa x?

@nik202 Yes, I did rasa init and did rasa shell. I am able to speak to the bot in the terminal with no problem. I also haven’t made any changes to any of the NLU files/config etc for the model.

requirement.txt (2.6 KB)

Starting Rasa X in local mode... 🚀
Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 162, in _catch_revision_errors
    yield
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 364, in _upgrade_revs
    revs = list(revs)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 765, in _iterate_revisions
    requested_lowers = self.get_revisions(lower)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 319, in get_revisions
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 319, in <listcomp>
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 324, in get_revisions
    for rev_id in resolved_id
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 324, in <genexpr>
    for rev_id in resolved_id
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 397, in _revision_for_ident
    resolved_id,
alembic.script.revision.ResolutionError: No such revision or branch '652500998f3e'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasa\cli\x.py", line 501, in run_locally
    domain_path=domain_path,
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasax\community\local.py", line 234, in main
    sql_migrations.run_migrations(session)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasax\community\sql_migrations.py", line 25, in run_migrations
    _run_schema_migrations(session)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasax\community\sql_migrations.py", line 41, in _run_schema_migrations
    _run_alembic_migration(alembic_config)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasax\community\sql_migrations.py", line 65, in _run_alembic_migration
    command.upgrade(alembic_config, target_revision)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\command.py", line 298, in upgrade
    script.run_env()
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\util\pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\util\compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasax\community\database\schema_migrations\alembic\env.py", line 96, in <module>
    run_migrations_online()
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\rasax\community\database\schema_migrations\alembic\env.py", line 86, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\runtime\environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\runtime\migration.py", line 511, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\command.py", line 287, in upgrade
    return script._upgrade_revs(revision, rev)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 369, in _upgrade_revs
    for script in reversed(list(revs))
  File "c:\users\007km\anaconda3\envs\myenv\lib\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 194, in _catch_revision_errors
    compat.raise_from_cause(util.CommandError(resolution))
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\util\compat.py", line 308, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\util\compat.py", line 301, in reraise
    raise value.with_traceback(tb)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 162, in _catch_revision_errors
    yield
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\base.py", line 364, in _upgrade_revs
    revs = list(revs)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 765, in _iterate_revisions
    requested_lowers = self.get_revisions(lower)
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 319, in get_revisions
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 319, in <listcomp>
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 324, in get_revisions
    for rev_id in resolved_id
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 324, in <genexpr>
    for rev_id in resolved_id
  File "c:\users\007km\anaconda3\envs\myenv\lib\site-packages\alembic\script\revision.py", line 397, in _revision_for_ident
    resolved_id,
alembic.util.exc.CommandError: Can't locate revision identified by '652500998f3e'

@rishubm meanwhile deleting the database .db so that it is created again. Search the files where it is gone :slight_smile:

Remove local DB (stored on your root of project directory) rm -rf rasa.db rm -rf events.db

@rishubm do see this a free course for you https://www.udemy.com/course/rasa-for-beginners/

@rishubm do share the rasa new versions with the error.

Even follow this:

  1. Downgrade pip pip install --upgrade pip==20.2 pip -V
  2. check compatibility between rasa-open source+rasa sdk+rasa x from here: Compatibility Matrix

Now based on your rasa open source+sdk version choose correct rasa x .

  1. Install rasa x

In my case it is 0.35.0

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

  1. Remove local DB (stored on your root of project directory) rm -rf rasa.db rm -rf events.db
  2. Run rasa rasa x -v --vv (give correct path for config/domain/data folder if you have changed their default location)

GoodLuck!