Rasa X upgrade to 1.1.5 gives error

(myvenv) (base) MacBook-Pro:rasa-demo jamestagg$ rasa x -vv 2019-07-10 13:54:17 DEBUG pykwalify.compat - Using yaml library: /Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/ruamel/yaml/init.py 2019-07-10 13:54:17 DEBUG rasa.cli.utils - Parameter ‘endpoints’ not set. Using default location ‘endpoints.yml’ instead. Starting Rasa X in local mode… :rocket: 2019-07-10 13:54:17 DEBUG sanic_jwt.configuration - validating provided secret 2019-07-10 13:54:17 DEBUG sanic_jwt.configuration - validating keys (if needed) 2019-07-10 13:54:17 DEBUG sanic_jwt.configuration - loading secret and/or keys (if needed) Traceback (most recent call last): File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1179, in _execute_context context = constructor(dialect, self, conn, *args) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/default.py”, line 717, in _init_compiled param.append(processorskey) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py”, line 1782, in process value = _strict_as_bool(value) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py”, line 1755, in _strict_as_bool if value not in self._strict_bools: TypeError: unhashable type: ‘list’

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

Traceback (most recent call last): File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasa/cli/x.py”, line 322, in run_locally local.main(args, project_path, args.data, token=rasa_x_token) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/local.py”, line 190, in main project_path, data_path, session, args.port File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/local.py”, line 127, in _initialize_with_local_data COMMUNITY_USERNAME, File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/initialise.py”, line 140, in inject_domain username=username, File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/services/domain_service.py”, line 127, in validate_and_store_domain_yaml self.dump_domain_in_local_mode() File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/services/domain_service.py”, line 140, in dump_domain_in_local_mode self._dump_domain(filename) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/services/domain_service.py”, line 143, in _dump_domain domain = self.get_domain() File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/services/domain_service.py”, line 160, in get_domain domain = self._get_domain(project_id) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/rasax/community/services/domain_service.py”, line 133, in _get_domain self.session.query(Domain).filter(Domain.project_id == project_id).first() File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3222, in first ret = list(self[0:1]) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3012, in getitem return list(res) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/query.py”, line 3323, in iter self.session._autoflush() File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/session.py”, line 1588, in _autoflush util.raise_from_cause(e) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 399, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 154, in reraise raise value File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/session.py”, line 1577, in _autoflush self.flush() File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/session.py”, line 2459, in flush self._flush(objects) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/session.py”, line 2597, in _flush transaction.rollback(_capture_exception=True) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py”, line 68, in exit compat.reraise(exc_type, exc_value, exc_tb) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 154, in reraise raise value File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/session.py”, line 2557, in _flush flush_context.execute() File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py”, line 422, in execute rec.execute(self) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py”, line 589, in execute uow, File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py”, line 245, in save_obj insert, File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py”, line 1084, in _emit_insert_statements c = cached_connections[connection].execute(statement, multiparams) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 988, in execute return meth(self, multiparams, params) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1107, in _execute_clauseelement distilled_params, File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1182, in _execute_context e, util.text_type(statement), parameters, None, None File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1466, in _handle_dbapi_exception util.raise_from_cause(sqlalchemy_exception, exc_info) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 399, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/util/compat.py”, line 153, in reraise raise value.with_traceback(tb) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1179, in _execute_context context = constructor(dialect, self, conn, args) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/engine/default.py”, line 717, in _init_compiled param.append(processorskey) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py”, line 1782, in process value = _strict_as_bool(value) File “/Users/jamestagg/.virtualenvs/myvenv/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py”, line 1755, in _strict_as_bool if value not in self._strict_bools: sqlalchemy.exc.StatementError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (builtins.TypeError) unhashable type: ‘list’ [SQL: INSERT INTO domain_intent (id, intent, use_entities) VALUES (?, ?, ?)] [parameters: [{‘use_entities’: True, ‘intent’: ’ location_restaurant’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘affirm’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘ask_builder’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘ask_faq_channels’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘ask_faq_community_size’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘ask_faq_differencecorenlu’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘ask_faq_languages’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘ask_faq_opensource’, ‘id’: 1} … displaying 10 of 73 total bound parameter sets … {‘use_entities’: True, ‘intent’: ‘telljoke’, ‘id’: 1}, {‘use_entities’: True, ‘intent’: ‘thank’, ‘id’: 1}]]

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

OK I fixed it myself.

The answer is that an old format in the intents file cannot be read by the new rasa X although it does not upset rasa shell. (ie. it compiles and runs as a valid mode).

Rasa X reads the original files and edits them in real time. This process was failing.

Also rasa X reads in and writes out the domain file. This does a few things.

  1. It removes any comments or formatting. (annoying if you want to structure your data.)
  2. If anything went wrong it may destroy your domain file so BACKUP!

The hash() is a built-in python method, used to return a unique number . This can be applied to any user-defined object which won’t get changed once initialized. This property is used mainly in dictionary keys .

TypeError: unhashable type: ‘list’ usually means that you are trying to use a list as an hash argument. This means that when you try to hash an unhashable object it will result an error. For ex. when you use a list as a key in the dictionary , this cannot be done because lists can’t be hashed. The standard way to solve this issue is to cast a list to a tuple .