0.26.1 rasa x error in python alembic revisions

I receive this error updating to rasa 0.26.1 using the docker-compose update instructions. Following this: Update Rasa X

RASA_X_VERSION=0.26.1
RASA_VERSION=1.8.0
RASA_X_DEMO_VERSION=0.26.1

Error:

rasa-x_1           | INFO:rasax.community.services.event_service:Waiting until database migrations have been executed...
rasa-x_1           | INFO:alembic.runtime.migration:Context impl PostgresqlImpl.
rasa-x_1           | INFO:alembic.runtime.migration:Will assume transactional DDL.
rasa-x_1           | INFO:rasax.community.services.event_service:Check for database migrations completed.
rasa-x_1           | ERROR:pika.adapters.utils.io_services_utils:Socket failed to connect: <socket.socket fd=18, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.25.0.6', 53302)>; error=111 (Connection refused)
rasa-x_1           | ERROR:pika.adapters.utils.connection_workflow:TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.25.0.2', 5672))
rasa-x_1           | ERROR:pika.adapters.utils.connection_workflow:AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-x_1           | INFO:alembic.runtime.migration:Context impl PostgresqlImpl.
rasa-x_1           | INFO:alembic.runtime.migration:Will assume transactional DDL.
rasa-x_1           | Traceback (most recent call last):
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 158, in _catch_revision_errors
rasa-x_1           |     yield
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 360, in _upgrade_revs
rasa-x_1           |     revs = list(revs)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 755, in _iterate_revisions
rasa-x_1           |     requested_lowers = self.get_revisions(lower)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 319, in get_revisions
rasa-x_1           |     return sum([self.get_revisions(id_elem) for id_elem in id_], ())
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 319, in <listcomp>
rasa-x_1           |     return sum([self.get_revisions(id_elem) for id_elem in id_], ())
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 324, in get_revisions
rasa-x_1           |     for rev_id in resolved_id
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 324, in <genexpr>
rasa-x_1           |     for rev_id in resolved_id
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 387, in _revision_for_ident
rasa-x_1           |     resolved_id,
rasa-x_1           | alembic.script.revision.ResolutionError: No such revision or branch 'b49ca6b367e3'
rasa-x_1           | 
rasa-x_1           | The above exception was the direct cause of the following exception:
rasa-x_1           | 
rasa-x_1           | Traceback (most recent call last):
rasa-x_1           |   File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
rasa-x_1           |     "__main__", mod_spec)
rasa-x_1           |   File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
rasa-x_1           |     exec(code, run_globals)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/server.py", line 108, in <module>
rasa-x_1           |     main()
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/server.py", line 32, in main
rasa-x_1           |     sql_migrations.run_migrations(session)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/sql_migrations.py", line 25, in run_migrations
rasa-x_1           |     _run_schema_migrations(session)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/sql_migrations.py", line 41, in _run_schema_migrations
rasa-x_1           |     _run_alembic_migration(alembic_config)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/sql_migrations.py", line 65, in _run_alembic_migration
rasa-x_1           |     command.upgrade(alembic_config, target_revision)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/command.py", line 276, in upgrade
rasa-x_1           |     script.run_env()
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 475, in run_env
rasa-x_1           |     util.load_python_file(self.dir, "env.py")
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
rasa-x_1           |     module = load_module_py(module_id, path)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/util/compat.py", line 156, in load_module_py
rasa-x_1           |     spec.loader.exec_module(module)
rasa-x_1           |   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
rasa-x_1           |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 87, in <module>
rasa-x_1           |     run_migrations_online()
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/rasax/community/database/schema_migrations/alembic/env.py", line 77, in run_migrations_online
rasa-x_1           |     context.run_migrations()
rasa-x_1           |   File "<string>", line 8, in run_migrations
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/runtime/environment.py", line 839, in run_migrations
rasa-x_1           |     self.get_context().run_migrations(**kw)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/runtime/migration.py", line 350, in run_migrations
rasa-x_1           |     for step in self._migrations_fn(heads, self):
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/command.py", line 265, in upgrade
rasa-x_1           |     return script._upgrade_revs(revision, rev)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 365, in _upgrade_revs
rasa-x_1           |     for script in reversed(list(revs))
rasa-x_1           |   File "/usr/local/lib/python3.6/contextlib.py", line 99, in __exit__
rasa-x_1           |     self.gen.throw(type, value, traceback)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 190, in _catch_revision_errors
rasa-x_1           |     compat.raise_from_cause(util.CommandError(resolution))
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/util/compat.py", line 274, in raise_from_cause
rasa-x_1           |     reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/util/compat.py", line 267, in reraise
rasa-x_1           |     raise value.with_traceback(tb)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 158, in _catch_revision_errors
rasa-x_1           |     yield
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py", line 360, in _upgrade_revs
rasa-x_1           |     revs = list(revs)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 755, in _iterate_revisions
rasa-x_1           |     requested_lowers = self.get_revisions(lower)
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 319, in get_revisions
rasa-x_1           |     return sum([self.get_revisions(id_elem) for id_elem in id_], ())
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 319, in <listcomp>
rasa-x_1           |     return sum([self.get_revisions(id_elem) for id_elem in id_], ())
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 324, in get_revisions
rasa-x_1           |     for rev_id in resolved_id
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 324, in <genexpr>
rasa-x_1           |     for rev_id in resolved_id
rasa-x_1           |   File "/usr/local/lib/python3.6/site-packages/alembic/script/revision.py", line 387, in _revision_for_ident
rasa-x_1           |     resolved_id,
rasa-x_1           | alembic.util.exc.CommandError: Can't locate revision identified by 'b49ca6b367e3'

Anyone know what the problem could be? Seems Rasa is only working for me at:

RASA_X_VERSION=latest
RASA_VERSION=1.8.0
RASA_X_DEMO_VERSION=0.26.0

@argideritzalpea what version were you pulling before this? The revision number you have referenced is one that’s part of an unreleased Rasa X version. I would guess previously you were pulling the latest tag?

Hi @akled, the instructions say that 0.26.1 is ready to pull. I would have first pulled 0.26.1, then tried latest.

Hey @argideritzalpea! Is your Rasa X database new or does it already have data stored inside?

It has conversations stored from testing through the UI browser. I do not care if these conversations are overwritten.

In that case, I think the easiest fix for the issue is going back to the 0.26.1 image and deleting the database mounted volume so that it is created again.

1 Like

@fede I am getting the same problem, How can I do that?

rasa-x_1 | alembic.util.exc.CommandError: Can't locate revision identified by '304e0754a200'

@akelad Hi can you help me out with this…?

@svshubham01 that migration was released as part of Rasa X 0.26.0, what version are you using?

Thanks @fede this works for me.

1 Like