Description of problem: Running beaker-init to initialize a new database on RHEL 7 which has python-alembic 0.7 installed is failed. It is because the context._current_rev and context._update_current_rev are deprecated in python-alembic 0.7. See more details here https://github.com/g2p/bedup/issues/75 How reproducible: Always Actual results: prop = self._property_from_column(key, prop) Traceback (most recent call last): File "/bin/beaker-init", line 9, in <module> load_entry_point('bkr.server==19.3', 'console_scripts', 'beaker-init')() File "/usr/lib/python2.7/site-packages/bkr/server/tools/init.py", line 295, in main init_db(metadata) File "/usr/lib/python2.7/site-packages/bkr/server/tools/init.py", line 43, in init_db run_alembic_operation(metadata, stamp) File "/usr/lib/python2.7/site-packages/bkr/server/tools/init.py", line 255, in run_alembic_operation env_context.run_migrations() File "/usr/lib/python2.7/site-packages/alembic/environment.py", line 742, in run_migrations self.get_context().run_migrations(**kw) File "/usr/lib/python2.7/site-packages/alembic/migration.py", line 296, in run_migrations for step in self._migrations_fn(heads, self): File "/usr/lib/python2.7/site-packages/bkr/server/tools/init.py", line 39, in stamp current = context._current_rev() AttributeError: 'MigrationContext' object has no attribute '_current_rev' Expected results: beaker-init should be successfully run with python-alembic 0.7
(In reply to matt jia from comment #0) > Description of problem: > > Running beaker-init to initialize a new database on RHEL 7 which has > python-alembic 0.7 installed is failed. It is because the > context._current_rev and context._update_current_rev are deprecated in > python-alembic 0.7. See more details here > > https://github.com/g2p/bedup/issues/75 We can use context.get_current_revision() to take place of context._current_rev but I did not find a method to replace context._update_current_rev(). Probably we should wrap the alembic command module to eliminate such that pain.
Are there any workarounds for this issue or is the only solution to install beaker on RHEL 6 instead of RHEL 7?
(In reply to matt jia from comment #1) > (In reply to matt jia from comment #0) > > Description of problem: > > > > Running beaker-init to initialize a new database on RHEL 7 which has > > python-alembic 0.7 installed is failed. It is because the > > context._current_rev and context._update_current_rev are deprecated in > > python-alembic 0.7. See more details here > > > > https://github.com/g2p/bedup/issues/75 This is returning a 404.
(In reply to Amit Saha from comment #3) > (In reply to matt jia from comment #1) > > (In reply to matt jia from comment #0) > > > Description of problem: > > > > > > Running beaker-init to initialize a new database on RHEL 7 which has > > > python-alembic 0.7 installed is failed. It is because the > > > context._current_rev and context._update_current_rev are deprecated in > > > python-alembic 0.7. See more details here > > > > > > https://github.com/g2p/bedup/issues/75 > > This is returning a 404. Perhaps they deleted it. Here is another one https://github.com/g2p/bedup/issues/55
(In reply to Tim Flink from comment #2) > Are there any workarounds for this issue or is the only solution to install > beaker on RHEL 6 instead of RHEL 7? We would need to write a patch to get beaker-init support both alembic versions, currently it only supports alembic version <= 0.6.
(In reply to matt jia from comment #5) > (In reply to Tim Flink from comment #2) > > Are there any workarounds for this issue or is the only solution to install > > beaker on RHEL 6 instead of RHEL 7? > > We would need to write a patch to get beaker-init support both alembic > versions, currently it only supports alembic version <= 0.6. OK, I'll see if I can get an older alembic to build on el7 (first epel7 build seems to be 0.7.x) and hack that in for the time being. Otherwise, I'll just redeploy our new instance as el6 and upgrade sometime in the future.
On Gerrit: http://gerrit.beaker-project.org/#/c/4232/
Verified Steps: 1. create an empty beaker database on the server that has python-alembic 0.7 installed 2. run beaker-init to initialize this database 3. also need to check beaker-init on the server that has python-alembic 0.6
Beaker 21.0 has been released.