Getting SQLAlchemy error while running rasa x command

Trying to install new version of RasaX but gettting below issue

Rasa Version      :         3.0.0
Minimum Compatible Version: 3.0.0
Rasa SDK Version  :         3.1.0
Rasa X Version    :         1.1.0
Python Version    :         3.7.13
Operating System  :         Linux-4.15.0-163-generic-x86_64-with-Ubuntu-18.04-bionic
Python Path       :         /opt/rasaX/bin/python3.7
Traceback (most recent call last):
  File "/opt/rasaX/lib/python3.7/site-packages/rasa/cli/x.py", line 504, in run_locally
    domain_path=domain_path,
  File "/opt/rasaX/lib/python3.7/site-packages/rasax/community/local.py", line 197, in main
    sql_migrations.run_migrations(session)
  File "/opt/rasaX/lib/python3.7/site-packages/rasax/community/sql_migrations.py", line 35, in run_migrations
    _run_schema_migrations(session)
  File "/opt/rasaX/lib/python3.7/site-packages/rasax/community/sql_migrations.py", line 52, in _run_schema_migrations
    _run_alembic_migration(alembic_config)
  File "/opt/rasaX/lib/python3.7/site-packages/rasax/community/sql_migrations.py", line 76, in _run_alembic_migration
    command.upgrade(alembic_config, target_revision)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/rasaX/lib/python3.7/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 "/opt/rasaX/lib/python3.7/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 96, in <module>
    run_migrations_online()
  File "/opt/rasaX/lib/python3.7/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 "/opt/rasaX/lib/python3.7/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/runtime/migration.py", line 511, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/command.py", line 287, in upgrade
    return script._upgrade_revs(revision, rev)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/base.py", line 364, in _upgrade_revs
    revs = list(revs)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/revision.py", line 765, in _iterate_revisions
    requested_lowers = self.get_revisions(lower)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/revision.py", line 319, in get_revisions
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/revision.py", line 319, in <listcomp>
    return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/revision.py", line 321, in get_revisions
    resolved_id, branch_label = self._resolve_revision_number(id_)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/revision.py", line 501, in _resolve_revision_number
    self._revision_map
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/util/langhelpers.py", line 230, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/revision.py", line 123, in _revision_map
    for revision in self._generator():
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/base.py", line 112, in _load_revisions
    script = Script._from_filename(self, vers, file_)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/script/base.py", line 906, in _from_filename
    module = util.load_python_file(dir_, filename)
  File "/opt/rasaX/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/rasaX/lib/python3.7/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 "/opt/rasaX/lib/python3.7/site-packages/rasax/community/database/schema_migrations/alembic/versions/migration_2021_07_07_ensure_existing_users_have_a_default__1a0c7b2d9ad2.py", line 12, in <module>
    import rasax.community.database.schema_migrations.alembic.utils as migration_utils
  File "/opt/rasaX/lib/python3.7/site-packages/rasax/community/database/schema_migrations/alembic/utils.py", line 12, in <module>
    from sqlalchemy.engine import reflection, Row, Connection
ImportError: cannot import name 'Row' from 'sqlalchemy.engine' (/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py)

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/.

Rasa X don’t have support to rasa 3 yet

Try to use rasa v 2.8.27 with rasa-x v1.0.1 In this moment I think this is the best combination

I believe the Rasa X Matrix is wrong Compatibility Matrix

And… Can you check SQLAlchemy installation?

pip show SQLAlchemy

to install

pip install SQLAlchemy

Hi @itsjhonny, Thanks for the response.

I tried to installed RASA 2.8.27 and installed rasax but still getting same error. below are the details for reference.

(rasaX) root@ENGAGECBot:/var/www/html/RasaX# rasa --version Rasa Version : 2.8.27 Minimum Compatible Version: 2.8.9 Rasa SDK Version : 2.8.5 Rasa X Version : 1.0.1 Python Version : 3.7.13 Operating System : Linux-4.15.0-163-generic-x86_64-with-Ubuntu-18.04-bionic Python Path : /opt/rasaX/bin/python3.7

(rasaX) root@ENGAGECBot:/var/www/html/RasaX# pip show SQLAlchemy Name: SQLAlchemy Version: 1.4.35 Summary: Database Abstraction Library Home-page: https://www.sqlalchemy.org Author: Mike Bayer Author-email: mike_mp@zzzcomputing.com License: MIT Location: /opt/rasaX/lib/python3.7/site-packages Requires: greenlet, importlib-metadata Required-by: alembic, Flask-SQLAlchemy, rasa, rasa-x

Error:

sqlite_where=sa.text(index_text), File “/usr/lib/python3.7/contextlib.py”, line 119, in exit next(self.gen) File “/opt/rasaX/lib/python3.7/site-packages/alembic/operations/base.py”, line 353, in batch_alter_table impl.flush() File “/opt/rasaX/lib/python3.7/site-packages/alembic/operations/batch.py”, line 82, in flush fn(*arg, **kw) File “/opt/rasaX/lib/python3.7/site-packages/alembic/ddl/impl.py”, line 283, in create_index self._exec(schema.CreateIndex(index)) File “/opt/rasaX/lib/python3.7/site-packages/alembic/ddl/impl.py”, line 141, in _exec return conn.execute(construct, *multiparams, **params) File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1306, in execute return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS) File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 81, in _execute_on_connection self, multiparams, params, execution_options File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1404, in _execute_ddl compiled, File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1863, in execute_context e, statement, parameters, cursor, context File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2044, in handle_dbapi_exception sqlalchemy_exception, with_traceback=exc_info[2], from=e File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 207, in raise raise exception File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1820, in _execute_context cursor, statement, parameters, context File “/opt/rasaX/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 732, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: True [SQL: CREATE INDEX message_log_in_training_data_idx ON message_log (in_training_data) WHERE in_training_data is True] (Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation)

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’m running 1.4.29 version of SQLAlchemy

Can you try pip install SQLAlchemy==1.4.29 and pip show SQLAlchemy to check the version and try again?

Name: SQLAlchemy Version: 1.4.29 Summary: Database Abstraction Library Home-page: https://www.sqlalchemy.org Author: Mike Bayer Author-email: mike_mp@zzzcomputing.com License: MIT Location: /opt/rasaX/lib/python3.7/site-packages Requires: greenlet, importlib-metadata Required-by: alembic, Flask-SQLAlchemy, rasa, rasa-x

Installed 1.4.29 version still facing same error

This is a incompatibility package problema. Rasa X don’t reading columns database You can try delete events.db and rasa.db files

But i think is bette a fresh installation

My versions:

Rasa Version      :         2.8.27
Minimum Compatible Version: 2.8.9
Rasa SDK Version  :         2.8.5
Rasa X Version    :         1.0.1
Python Version    :         3.8.10
Operating System  :         Linux-5.4.0-107-generic-x86_64-with-glibc2.29

I’m putting my requeriments.txt for you requirements (1).txt (2.9 KB)

reference: Cannot install Rasa X - sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: True

After fresh installation with following

Rasa Version      :         2.8.27
Minimum Compatible Version: 2.8.9
Rasa SDK Version  :         2.8.5
Rasa X Version    :         1.0.1
Python Version    :         3.8.13
Operating System  :         Linux-4.15.0-163-generic-x86_64-with-glibc2.27
Traceback (most recent call last):
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1799, in _execute_context
    self.dialect.do_execute(
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such column: True

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

Traceback (most recent call last):
  File "/opt/rasaX/lib/python3.8/site-packages/rasa/cli/x.py", line 494, in run_locally
    local.main(
  File "/opt/rasaX/lib/python3.8/site-packages/rasax/community/local.py", line 196, in main
    sql_migrations.run_migrations(session)
  File "/opt/rasaX/lib/python3.8/site-packages/rasax/community/sql_migrations.py", line 35, in run_migrations
    _run_schema_migrations(session)
  File "/opt/rasaX/lib/python3.8/site-packages/rasax/community/sql_migrations.py", line 52, in _run_schema_migrations
    _run_alembic_migration(alembic_config)
  File "/opt/rasaX/lib/python3.8/site-packages/rasax/community/sql_migrations.py", line 76, in _run_alembic_migration
    command.upgrade(alembic_config, target_revision)
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/rasaX/lib/python3.8/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 96, in <module>
    run_migrations_online()
  File "/opt/rasaX/lib/python3.8/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 "/opt/rasaX/lib/python3.8/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/runtime/migration.py", line 522, in run_migrations
    step.migration_fn(**kw)
  File "/opt/rasaX/lib/python3.8/site-packages/rasax/community/database/schema_migrations/alembic/versions/migration_2021_06_16_speedup_in_training_data_update_652500998f3e.py", line 38, in upgrade
    batch_op.create_index(
  File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/operations/base.py", line 353, in batch_alter_table
    impl.flush()
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/operations/batch.py", line 82, in flush
    fn(*arg, **kw)
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/ddl/impl.py", line 283, in create_index
    self._exec(schema.CreateIndex(index))
  File "/opt/rasaX/lib/python3.8/site-packages/alembic/ddl/impl.py", line 141, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1286, in execute
    return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 77, in _execute_on_connection
    return connection._execute_ddl(
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1378, in _execute_ddl
    ret = self._execute_context(
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1842, in _execute_context
    self._handle_dbapi_exception(
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2023, in _handle_dbapi_exception
    util.raise_(
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
    raise exception
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1799, in _execute_context
    self.dialect.do_execute(
  File "/opt/rasaX/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: True
[SQL: CREATE INDEX message_log_in_training_data_idx ON message_log (in_training_data) WHERE in_training_data is True]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

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 don’t know what happens. Sorry :cry: Rasa X trying to access events.db and rasa.db files with sqlalchemy but has problem when made sql query. Its happen because incompatibility versions

Maybe try pip install sqlite3 and pip install SQLAlchemy==1.4.29 --no-cache-dir again

@Sharu I’m seeing you are struggling a lot in the installation of Rasa X, can you share how you are installing the rasa x (command or steps), and any reference link which you had followed?

Do check this link and check warning: Installation Guide

I’d recommend installing Rasa X latest with Rasa 3. X and the one you are trying to install are depreciated (I guess). Further, Rasa X is meant to be installed on the server-side. If you only want to explore the Rasa X, you can see this clean installation process for Rasa 2. x with Rasa X 0.39.3 Ref: Rasa X runs with several Errors & Warnings - #2 by nik202

Note: At backend rasa updating a lot :slight_smile: :face_with_monocle:

Try to follow Pedro’s suggestions, or even start fresh. I wish you find the solution soon.

It’s your free will that what you trying to follow, I’m suggesting you. Good Luck!