Rasa X Cannot converse in UI

I created a new conda environment. Installed latest rasa and rasa x. I started with rasa init. After training did rasa x on terminal. When UI opens, I say ‘hello’ and gets db errors. I have tried changing rasa versions but still get same errors. I can’t start conversing not only in normal mode but also not in Rasa X interactive mode. Normal rasa shell and rasa interactive commands are working fine on terminal.

Here is error on terminal I get, when I say word “hello” on terminal, Moreover the text in the box of rasa X UI also disappears after pressing “Enter” on word “Hello”.

`[2019-11-25 15:30:37 +0500] [12955] [ERROR] Exception occurred while handling uri: ‘http://localhost:5005/conversations/89794c1c7bc045fdade417da2baf5553/tracker?include_events=ALL’ Traceback (most recent call last): File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1246, in _execute_context cursor, statement, parameters, context File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/default.py”, line 581, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: locking protocol

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

Traceback (most recent call last): File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sanic/app.py”, line 942, in handle_request response = await response File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/server.py”, line 168, in decorated result = await result File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/server.py”, line 434, in retrieve_tracker tracker = get_tracker(app.agent, conversation_id) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/server.py”, line 204, in get_tracker tracker = agent.tracker_store.get_or_create_tracker(conversation_id) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/tracker_store.py”, line 115, in get_or_create_tracker tracker = self.retrieve(sender_id) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/tracker_store.py”, line 685, in retrieve .order_by(self.SQLEvent.timestamp) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3211, in all return list(self) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3367, in iter return self._execute_and_instances(context) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3392, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 982, in execute return meth(self, multiparams, params) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1101, in _execute_clauseelement distilled_params, File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1250, in _execute_context e, statement, parameters, cursor, context File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1476, in _handle_dbapi_exception util.raise_from_cause(sqlalchemy_exception, exc_info) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 398, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 152, in reraise raise value.with_traceback(tb) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1246, in _execute_context cursor, statement, parameters, context File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/default.py”, line 581, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) locking protocol [SQL: SELECT events.id AS events_id, events.sender_id AS events_sender_id, events.type_name AS events_type_name, events.timestamp AS events_timestamp, events.intent_name AS events_intent_name, events.action_name AS events_action_name, events.data AS events_data FROM events WHERE events.sender_id = ? ORDER BY events.timestamp] [parameters: (‘89794c1c7bc045fdade417da2baf5553’,)] (Background on this error at: http://sqlalche.me/e/e3q8) 2019-11-25 15:30:53 ERROR rasa.core.channels.channel - An exception occured while handling user message ‘hello’. Traceback (most recent call last): File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1246, in _execute_context cursor, statement, parameters, context File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/default.py”, line 581, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: locking protocol

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

Traceback (most recent call last): File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/channels/channel.py”, line 486, in receive metadata=metadata, File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/channels/channel.py”, line 82, in handler await app.agent.handle_message(*args, **kwargs) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/agent.py”, line 471, in handle_message return await processor.handle_message(message) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/processor.py”, line 80, in handle_message tracker = await self.log_message(message, should_save_tracker=False) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/processor.py”, line 150, in log_message tracker = self._get_tracker(message.sender_id) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/processor.py”, line 576, in _get_tracker return self.tracker_store.get_or_create_tracker(sender_id) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/tracker_store.py”, line 115, in get_or_create_tracker tracker = self.retrieve(sender_id) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/rasa/core/tracker_store.py”, line 685, in retrieve .order_by(self.SQLEvent.timestamp) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3211, in all return list(self) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3367, in iter return self._execute_and_instances(context) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3392, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 982, in execute return meth(self, multiparams, params) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1101, in _execute_clauseelement distilled_params, File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1250, in _execute_context e, statement, parameters, cursor, context File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1476, in _handle_dbapi_exception util.raise_from_cause(sqlalchemy_exception, exc_info) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 398, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 152, in reraise raise value.with_traceback(tb) File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1246, in _execute_context cursor, statement, parameters, context File “/mnt/d/InstalledSoftware/ubuntu-on-windows/anaconda3/envs/test_2/lib/python3.6/site-packages/sqlalchemy/engine/default.py”, line 581, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) locking protocol [SQL: SELECT events.id AS events_id, events.sender_id AS events_sender_id, events.type_name AS events_type_name, events.timestamp AS events_timestamp, events.intent_name AS events_intent_name, events.action_name AS events_action_name, events.data AS events_data FROM events WHERE events.sender_id = ? ORDER BY events.timestamp] [parameters: (‘89794c1c7bc045fdade417da2baf5553’,)] (Background on this error at: http://sqlalche.me/e/e3q8)`

Another thing I should tell is I am using ubuntu 18.04 on Windows subsystem on Linux.

After a week of struggling, found that issue is in WSL

1 Like

Thanks for sharing the solution! It’ll help other users using WSL.

I faced a similar or the same problem in my Win10 with WSL2 Ubuntu 20.04 connected via Visual Studio Code. When I start rasa-x locally, I cannot use the conversations because of the error below. I thought it would be fixed in WSL2. Can anyone else confirm this problem

Error log

Starting Rasa X in local mode… :rocket:

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

[2020-09-12 13:24:08 +0200] [5134] [ERROR] Experienced exception while trying to serve Traceback (most recent call last): File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1277, in _execute_context cursor, statement, parameters, context File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 593, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: locking protocol

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

Traceback (most recent call last): File “/home/wel/.local/lib/python3.7/site-packages/sanic/app.py”, line 1167, in run serve(**server_settings) File “/home/wel/.local/lib/python3.7/site-packages/sanic/server.py”, line 892, in serve trigger_events(before_start, loop) File “/home/wel/.local/lib/python3.7/site-packages/sanic/server.py”, line 668, in trigger_events loop.run_until_complete(result) File “uvloop/loop.pyx”, line 1456, in uvloop.loop.Loop.run_until_complete File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/run.py”, line 243, in load_agent_on_start _broker = EventBroker.create(endpoints.event_broker) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/broker.py”, line 21, in create return _create_from_endpoint_config(obj) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/broker.py”, line 62, in _create_from_endpoint_config broker = SQLEventBroker.from_endpoint_config(endpoint_config) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/sql.py”, line 57, in from_endpoint_config return cls(host=broker_config.url, **broker_config.kwargs) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/sql.py”, line 52, in init self.Base.metadata.create_all(self.engine) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/schema.py”, line 4556, in create_all ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2097, in _run_visitor conn._run_visitor(visitorcallable, element, **kwargs) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1656, in _run_visitor visitorcallable(self.dialect, self, **kwargs).traverse_single(element) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py”, line 145, in traverse_single return meth(obj, **kw) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 760, in visit_metadata [t for t in tables if self._can_create_table(t)] File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 760, in [t for t in tables if self._can_create_table(t)] File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 737, in _can_create_table self.connection, table.name, schema=effective_schema File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/dialects/sqlite/base.py”, line 1640, in has_table connection, “table_info”, table_name, schema=schema File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/dialects/sqlite/base.py”, line 2153, in _get_table_pragma cursor = connection.execute(statement) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1003, in execute return self.execute_text(object, multiparams, params) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1178, in _execute_text parameters, File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1317, in execute_context e, statement, parameters, cursor, context File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1511, in handle_dbapi_exception sqlalchemy_exception, with_traceback=exc_info[2], from=e File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 182, in raise raise exception File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1277, in _execute_context cursor, statement, parameters, context File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 593, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) locking protocol [SQL: PRAGMA main.table_info(“events”)] (Background on this error at: http://sqlalche.me/e/13/e3q8) Process SpawnProcess-2: Traceback (most recent call last): File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1277, in _execute_context cursor, statement, parameters, context File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 593, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: locking protocol

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

Traceback (most recent call last): File “/usr/local/lib/python3.7/multiprocessing/process.py”, line 297, in _bootstrap self.run() File “/usr/local/lib/python3.7/multiprocessing/process.py”, line 99, in run self._target(*self._args, **self._kwargs) File “/home/wel/.local/lib/python3.7/site-packages/rasa/cli/x.py”, line 86, in _rasa_service ssl_password=args.ssl_password, File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/run.py”, line 216, in serve_application endpoints.lock_store if endpoints else None File “/home/wel/.local/lib/python3.7/site-packages/sanic/app.py”, line 1167, in run serve(**server_settings) File “/home/wel/.local/lib/python3.7/site-packages/sanic/server.py”, line 892, in serve trigger_events(before_start, loop) File “/home/wel/.local/lib/python3.7/site-packages/sanic/server.py”, line 668, in trigger_events loop.run_until_complete(result) File “uvloop/loop.pyx”, line 1456, in uvloop.loop.Loop.run_until_complete File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/run.py”, line 243, in load_agent_on_start _broker = EventBroker.create(endpoints.event_broker) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/broker.py”, line 21, in create return _create_from_endpoint_config(obj) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/broker.py”, line 62, in _create_from_endpoint_config broker = SQLEventBroker.from_endpoint_config(endpoint_config) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/sql.py”, line 57, in from_endpoint_config return cls(host=broker_config.url, **broker_config.kwargs) File “/home/wel/.local/lib/python3.7/site-packages/rasa/core/brokers/sql.py”, line 52, in init self.Base.metadata.create_all(self.engine) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/schema.py”, line 4556, in create_all ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2097, in _run_visitor conn._run_visitor(visitorcallable, element, **kwargs) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1656, in _run_visitor visitorcallable(self.dialect, self, **kwargs).traverse_single(element) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/visitors.py”, line 145, in traverse_single return meth(obj, **kw) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 760, in visit_metadata [t for t in tables if self._can_create_table(t)] File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 760, in [t for t in tables if self._can_create_table(t)] File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py”, line 737, in _can_create_table self.connection, table.name, schema=effective_schema File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/dialects/sqlite/base.py”, line 1640, in has_table connection, “table_info”, table_name, schema=schema File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/dialects/sqlite/base.py”, line 2153, in _get_table_pragma cursor = connection.execute(statement) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1003, in execute return self.execute_text(object, multiparams, params) File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1178, in _execute_text parameters, File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1317, in execute_context e, statement, parameters, cursor, context File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1511, in handle_dbapi_exception sqlalchemy_exception, with_traceback=exc_info[2], from=e File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 182, in raise raise exception File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1277, in _execute_context cursor, statement, parameters, context File “/home/wel/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 593, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) locking protocol [SQL: PRAGMA main.table_info(“events”)] (Background on this error at: http://sqlalche.me/e/13/e3q8) /home/wel/.local/lib/python3.7/site-packages/matplotlib/_pylab_helpers.py:76: RuntimeWarning: coroutine ‘Loop.create_server’ was never awaited gc.collect(1)