Comment 0 for bug 1779813

Revision history for this message
Dongcan Ye (hellochosen) wrote :

I had a clean environment(code version: stable/queens), and run DB update operations.

Step 1. First upgrade to Mitaka:
# neutron-db-manage upgrade mitaka

Result: all things runs ok, the neutron and subprojects are upgrade to Mitaka version.

Step 2. Then runs the following command:
# neutron-db-manage upgrade expand

Result: meets an error here, exception:
# neutron-db-manage upgrade expand
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/neutron/db/migration/alembic_migrations/env.py", line 120, in <module>
    run_migrations_online()
  File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/env.py", line 114, 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 723, in _iterate_revisions
    raise RangeNotAncestorError(lower, upper)
alembic.script.revision.RangeNotAncestorError: Revision (u'4ffceebfcdc',) is not an ancestor of revision expand

After Step 1, I found that only one record(mitaka contract head) in alembic_version table:
MariaDB [neutron]> select * from alembic_version;
+-------------+
| version_num |
+-------------+
| 4ffceebfcdc |
+-------------+
1 row in set (0.00 sec)

There was missing expand head in alembic_version table.