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.

2 Likes

@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

I am having the same issue. This means i should use the 0.26.1 install.sh? How do I delete the database volume?

Hi, how did you delete the “database mounted volume”?

@akelad I am facing the exact same issue, I recently updated my rasa-x to 0.33.1. Once I realized that this version support rasa 2.0, not 1.0, I updated it again to 0.32.2 and now I am getting the exact same issue, in my case, I am getting the following

No such revision or branch ‘052172fdb4b3’

My assumption is that we are trying to run some migration script through Alembic which is not running properly as the migration is ahead of expected, if we could bring the migration to a 0.32.2 compatible state it should work.

Currently, since migration fails the docker is restarted and the same thing happens again, is there a way to do it without losing your data, as suggested in the post.

I ended up resetting out rasa login database to overcome the above issue, but now I am not able to use the rasa export command Getting rasa: command not found I am getting the same when I use rasa -h any idea?

I was finally able to get the command working by bashing in production container(docker exec -it rasa_rasa-production_1 bash) but now it’s throwing

Could not find a tracker_store section in the supplied endpoints file. Instructions on how to configure a tracker store can be found here: https://rasa.com/docs/rasa/api/tracker-stores/. Exiting.

I have checked the endpoints.yml and it does contain the tracker-stores configuration, these configurations have not been touched, all the new conversations are coming but I have not been able to pull the older conversations.

I am able to run the command from another bot which is outside the rasa-x, though facing a different issue, will try with minimum data, first. I guess in rasa-x u have to do it differently?

Lol getting this same error again trying to downgrade from 0.35.0 to 0.33.1 because of another issue related to the bot responding, people saying it could be the version…

People are suggesting delete the whole data store, the “database mounted volume”, to get around the Alembic error?

So it appears you cannot safely downgrade Rasa X and data in your store without some Alembic error?

@fede

db-migration_1     |     resolved_id,
db-migration_1     | alembic.util.exc.CommandError: Can't locate revision identified

I also get:

rasa-production_1  | Starting Rasa X in production mode... 🚀
rasa-production_1  | Could not fetch runtime config from server at 'http://rasa-x:5002/api/config?token=z1FsQY7lcYi91qd'. Exiting.
rasa-worker_1      | Starting Rasa X in production mode... 🚀
rasa-worker_1      | Could not fetch runtime config from server at 'http://rasa-x:5002/api/config?token=z1FsQY7lcYi91qd'. Exiting.

I have re-installed / updated Rasa X with the instructions here for Docker-Compose: Update Rasa X

A side note is that my interpreter does not like: sudo curl -sSL -o install.sh [https://storage.googleapis.com/rasa-x-releases/](https://storage.googleapis.com/rasa-x-releases/)0.34.0/install.sh and I had to change the command to:

sudo curl -sSL -o install.sh https://storage.googleapis.com/rasa-x-releases/0.34.0/install.sh

for it to download.

Prior to running the install.sh script downloaded via the above instructions, I removed all extant images in Docker. The install script repulled but I still get the alembic errors after attempting to update.

We should all benefit if there were detailed instructions as to the cause of this error and what can be done to mitigate and prevent this in the future. Thanks, and really hope to work to resolve this.

rasa_app_1               rasa/rasa-sdk        2.2.0        a1c9443b5df6   151.3 MB
rasa_db-migration_1      rasa/rasa-x          0.34.0       1bd0f7d7c23c   2.246 GB
rasa_db_1                bitnami/postgresql   11.9.0       0964f45e6b89   250.4 MB
rasa_duckling_1          rasa/duckling        0.1.6.4      1253a54501d5   147 MB  
rasa_nginx_1             rasa/nginx           0.34.0       ea905db30635   90.17 MB
rasa_rabbit_1            bitnami/rabbitmq     3.8.9        05842c6800e8   243.9 MB
rasa_rasa-production_1   rasa/rasa            2.1.2-full   1ae20eafdcbd   1.912 GB
rasa_rasa-worker_1       rasa/rasa            2.1.2-full   1ae20eafdcbd   1.912 GB
rasa_rasa-x_1            rasa/rasa-x          0.34.0       1bd0f7d7c23c   2.246 GB
rasa_redis_1             bitnami/redis        6.0.8        da471e740b1c   102.7 MB

I get the exact same db-migration_1 | alembic.util.exc.CommandError: Can't locate revision identified error with the same referenced revision, despite having completely cleared all images and cache, reinstalling via docker-compose, re-pulling - What is this error, how do we fix it?

Hi @fede, do you have any recommendations regarding the problem stated above?

What exactly does someone have to delete to resolve this error?