I try to upgrade empty database to Ocata(neutron-db-manage upgrade ocata), then the alembic_version is Ocata expand. [1]
MariaDB [neutron]> select * from alembic_version;
+--------------+
| version_num |
+--------------+
| a9c43481023c |
+--------------+
1 row in set (0.00 sec)
Then I upgrade expand branch, it raises an exception here:
# neutron-db-manage upgrade --expand
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Running upgrade (expand) for neutron ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade kilo -> 30018084ec99
INFO [alembic.runtime.migration] Running upgrade 30018084ec99 -> 4ffceebfada
INFO [alembic.runtime.migration] Running upgrade 4ffceebfada -> 5498d17be016
INFO [alembic.runtime.migration] Running upgrade 5498d17be016 -> 2a16083502f3
INFO [alembic.runtime.migration] Running upgrade 2a16083502f3 -> 2e5352a0ad4d
INFO [alembic.runtime.migration] Running upgrade 2e5352a0ad4d -> 11926bcfe72d
INFO [alembic.runtime.migration] Running upgrade 11926bcfe72d -> 4af11ca47297
INFO [alembic.runtime.migration] Running upgrade 4af11ca47297 -> 1b294093239c
INFO [alembic.runtime.migration] Running upgrade 1b294093239c -> 8a6d8bdae39
INFO [alembic.runtime.migration] Running upgrade 8a6d8bdae39 -> 2b4c2465d44b
INFO [alembic.runtime.migration] Running upgrade 2b4c2465d44b -> e3278ee65050
INFO [alembic.runtime.migration] Running upgrade e3278ee65050 -> c6c112992c9
INFO [alembic.runtime.migration] Running upgrade c6c112992c9 -> 5ffceebfada
INFO [alembic.runtime.migration] Running upgrade 5ffceebfada -> 4ffceebfcdc
INFO [alembic.runtime.migration] Running upgrade 4ffceebfcdc -> 7bbb25278f53
INFO [alembic.runtime.migration] Running upgrade 7bbb25278f53 -> 89ab9a816d70
INFO [alembic.runtime.migration] Running upgrade 89ab9a816d70 -> c879c5e1ee90
INFO [alembic.runtime.migration] Running upgrade c879c5e1ee90 -> 8fd3918ef6f4
INFO [alembic.runtime.migration] Running upgrade 8fd3918ef6f4 -> 4bcd4df1f426
INFO [alembic.runtime.migration] Running upgrade 4bcd4df1f426 -> b67e765a3524
INFO [alembic.runtime.migration] Running upgrade a9c43481023c -> 804a3c76314c
INFO [alembic.runtime.migration] Running upgrade 804a3c76314c -> 2b42d90729da
INFO [alembic.runtime.migration] Running upgrade 2b42d90729da -> 62c781cb6192
INFO [alembic.runtime.migration] Running upgrade 62c781cb6192 -> c8c222d42aa9
INFO [alembic.runtime.migration] Running upgrade c8c222d42aa9 -> 349b6fd605a6
INFO [alembic.runtime.migration] Running upgrade 349b6fd605a6 -> 7d32f979895f
INFO [alembic.runtime.migration] Running upgrade 7d32f979895f -> 594422d373ee
INFO [alembic.runtime.migration] Running upgrade 594422d373ee -> 61663558142c
OK
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
File "/var/lib/kolla/venv/bin/neutron-db-manage", line 10, in <module>
sys.exit(main())
File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 653, in main
return_val |= bool(CONF.command.func(config, CONF.command.name))
File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 172, in do_upgrade
run_sanity_checks(config, revision)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 637, in run_sanity_checks
script_dir.run_env()
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/base.py", line 427, in run_env
util.load_python_file(self.dir, 'env.py')
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
module = load_module_py(module_id, path)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/util/compat.py", line 141, in load_module_py
mod = imp.load_source(module_id, path, fp)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/networking_infoblox/neutron/db/migration/alembic_migrations/env.py", line 88, in <module>
run_migrations_online()
File "/var/lib/kolla/venv/lib/python2.7/site-packages/networking_infoblox/neutron/db/migration/alembic_migrations/env.py", line 79, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/runtime/environment.py", line 836, in run_migrations
self.get_context().run_migrations(**kw)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/runtime/migration.py", line 321, in run_migrations
for step in self._migrations_fn(heads, self):
File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 628, in check_sanity
revision, rev, implicit_base=True):
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 656, in _iterate_revisions
uppers = util.dedupe_tuple(self.get_revisions(upper))
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 301, in get_revisions
resolved_id, branch_label = self._resolve_revision_number(id_)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 445, in _resolve_revision_number
current_head = self.get_current_head(branch_label)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 267, in get_current_head
current_heads = self.filter_for_lineage(current_heads, branch_label)
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 405, in filter_for_lineage
tg, shares, include_dependencies=include_dependencies)]
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 419, in _shares_lineage
in util.to_tuple(test_against_revs, default=())
File "/var/lib/kolla/venv/lib/python2.7/site-packages/alembic/script/revision.py", line 362, in _revision_for_ident
resolved_id)
alembic.script.revision.ResolutionError: No such revision or branch 'expand'
@Brian, I just start from an empty database.
I try to upgrade empty database to Ocata(neutron- db-manage upgrade ocata), then the alembic_version is Ocata expand. [1]
MariaDB [neutron]> select * from alembic_version;
+--------------+
| version_num |
+--------------+
| a9c43481023c |
+--------------+
1 row in set (0.00 sec)
Then I upgrade expand branch, it raises an exception here: runtime. migration] Context impl MySQLImpl. runtime. migration] Will assume non-transactional DDL. runtime. migration] Context impl MySQLImpl. runtime. migration] Will assume non-transactional DDL. runtime. migration] Running upgrade kilo -> 30018084ec99 runtime. migration] Running upgrade 30018084ec99 -> 4ffceebfada runtime. migration] Running upgrade 4ffceebfada -> 5498d17be016 runtime. migration] Running upgrade 5498d17be016 -> 2a16083502f3 runtime. migration] Running upgrade 2a16083502f3 -> 2e5352a0ad4d runtime. migration] Running upgrade 2e5352a0ad4d -> 11926bcfe72d runtime. migration] Running upgrade 11926bcfe72d -> 4af11ca47297 runtime. migration] Running upgrade 4af11ca47297 -> 1b294093239c runtime. migration] Running upgrade 1b294093239c -> 8a6d8bdae39 runtime. migration] Running upgrade 8a6d8bdae39 -> 2b4c2465d44b runtime. migration] Running upgrade 2b4c2465d44b -> e3278ee65050 runtime. migration] Running upgrade e3278ee65050 -> c6c112992c9 runtime. migration] Running upgrade c6c112992c9 -> 5ffceebfada runtime. migration] Running upgrade 5ffceebfada -> 4ffceebfcdc runtime. migration] Running upgrade 4ffceebfcdc -> 7bbb25278f53 runtime. migration] Running upgrade 7bbb25278f53 -> 89ab9a816d70 runtime. migration] Running upgrade 89ab9a816d70 -> c879c5e1ee90 runtime. migration] Running upgrade c879c5e1ee90 -> 8fd3918ef6f4 runtime. migration] Running upgrade 8fd3918ef6f4 -> 4bcd4df1f426 runtime. migration] Running upgrade 4bcd4df1f426 -> b67e765a3524 runtime. migration] Running upgrade a9c43481023c -> 804a3c76314c runtime. migration] Running upgrade 804a3c76314c -> 2b42d90729da runtime. migration] Running upgrade 2b42d90729da -> 62c781cb6192 runtime. migration] Running upgrade 62c781cb6192 -> c8c222d42aa9 runtime. migration] Running upgrade c8c222d42aa9 -> 349b6fd605a6 runtime. migration] Running upgrade 349b6fd605a6 -> 7d32f979895f runtime. migration] Running upgrade 7d32f979895f -> 594422d373ee runtime. migration] Running upgrade 594422d373ee -> 61663558142c runtime. migration] Context impl MySQLImpl. runtime. migration] Will assume non-transactional DDL. kolla/venv/ bin/neutron- db-manage" , line 10, in <module> exit(main( )) kolla/venv/ lib/python2. 7/site- packages/ neutron/ db/migration/ cli.py" , line 653, in main command. func(config, CONF.command.name)) kolla/venv/ lib/python2. 7/site- packages/ neutron/ db/migration/ cli.py" , line 172, in do_upgrade sanity_ checks( config, revision) kolla/venv/ lib/python2. 7/site- packages/ neutron/ db/migration/ cli.py" , line 637, in run_sanity_checks dir.run_ env() kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ base.py" , line 427, in run_env load_python_ file(self. dir, 'env.py') kolla/venv/ lib/python2. 7/site- packages/ alembic/ util/pyfiles. py", line 81, in load_python_file py(module_ id, path) kolla/venv/ lib/python2. 7/site- packages/ alembic/ util/compat. py", line 141, in load_module_py source( module_ id, path, fp) kolla/venv/ lib/python2. 7/site- packages/ networking_ infoblox/ neutron/ db/migration/ alembic_ migrations/ env.py" , line 88, in <module> migrations_ online( ) kolla/venv/ lib/python2. 7/site- packages/ networking_ infoblox/ neutron/ db/migration/ alembic_ migrations/ env.py" , line 79, in run_migrations_ online run_migrations( ) kolla/venv/ lib/python2. 7/site- packages/ alembic/ runtime/ environment. py", line 836, in run_migrations get_context( ).run_migration s(**kw) kolla/venv/ lib/python2. 7/site- packages/ alembic/ runtime/ migration. py", line 321, in run_migrations s_fn(heads, self): kolla/venv/ lib/python2. 7/site- packages/ neutron/ db/migration/ cli.py" , line 628, in check_sanity base=True) : kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 656, in _iterate_revisions tuple(self. get_revisions( upper)) kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 301, in get_revisions revision_ number( id_) kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 445, in _resolve_ revision_ number current_ head(branch_ label) kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 267, in get_current_head for_lineage( current_ heads, branch_label) kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 405, in filter_for_lineage dependencies= include_ dependencies) ] kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 419, in _shares_lineage tuple(test_ against_ revs, default=()) kolla/venv/ lib/python2. 7/site- packages/ alembic/ script/ revision. py", line 362, in _revision_for_ident script. revision. ResolutionError : No such revision or branch 'expand'
# neutron-db-manage upgrade --expand
INFO [alembic.
INFO [alembic.
Running upgrade (expand) for neutron ...
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
OK
INFO [alembic.
INFO [alembic.
Traceback (most recent call last):
File "/var/lib/
sys.
File "/var/lib/
return_val |= bool(CONF.
File "/var/lib/
run_
File "/var/lib/
script_
File "/var/lib/
util.
File "/var/lib/
module = load_module_
File "/var/lib/
mod = imp.load_
File "/var/lib/
run_
File "/var/lib/
context.
File "<string>", line 8, in run_migrations
File "/var/lib/
self.
File "/var/lib/
for step in self._migration
File "/var/lib/
revision, rev, implicit_
File "/var/lib/
uppers = util.dedupe_
File "/var/lib/
resolved_id, branch_label = self._resolve_
File "/var/lib/
current_head = self.get_
File "/var/lib/
current_heads = self.filter_
File "/var/lib/
tg, shares, include_
File "/var/lib/
in util.to_
File "/var/lib/
resolved_id)
alembic.
[1] https:/ /github. com/openstack/ neutron/ blob/stable/ ocata/neutron/ db/migration/ alembic_ migrations/ versions/ EXPAND_ HEAD