nova sqlite db migration failing for ocata

Bug #1671078 reported by Corey Bryant on 2017-03-08
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nova (Ubuntu)

Bug Description

nova/debian/nova-common.postinst needs fixing. Can we remove the db migration? Or should we add api db migration as well?

note: to recreate this requires sqlite connections to be set in nova.conf:

root@puppet-poc:/home/ubuntu# apt-get install nova-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 0 B/108 kB of archives.
After this operation, 443 kB of additional disk space will be used.
Selecting previously unselected package nova-common.
(Reading database ... 123343 files and directories currently installed.)
Preparing to unpack .../nova-common_2%3a15.0.0-0ubuntu1~cloud0_all.deb ...
Unpacking nova-common (2:15.0.0-0ubuntu1~cloud0) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up nova-common (2:15.0.0-0ubuntu1~cloud0) ...
ERROR: could not access cell mapping database - has api db been created?
An error has occurred:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nova/cmd/", line 1594, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/usr/lib/python2.7/dist-packages/nova/cmd/", line 644, in sync
    return migration.db_sync(version)
  File "/usr/lib/python2.7/dist-packages/nova/db/", line 26, in db_sync
    return IMPL.db_sync(version=version, database=database, context=context)
  File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/", line 57, in db_sync
    repository, version)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/", line 186, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<decorator-gen-15>", line 2, in _migrate
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/", line 160, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/", line 366, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/", line 93, in runchange, step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/", line 148, in run
  File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/migrate_repo/versions/", line 44, in upgrade
    raise exception.ValidationError(detail=msg)
ValidationError: Migration cannot continue until all these have been migrated to the api database. Please run `nova-manage db online_migrations' on Newton code before continuing.There are still 5 unmigrated flavors.

dpkg: error processing package nova-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tags: sts Edit Tag help
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nova (Ubuntu):
status: New → Confirmed
Corey Bryant (corey.bryant) wrote :

Looking at this some more, I'm not entirely sure this is a packaging bug. From the traceback it looks like this is an upgrade from Newton->Ocata. This bug from tripleo required an additional db step prior to upgrade: "you need to have run the nova db online_data_migrations after the Newton undercloud upgrade, otherwise the subsequent Ocata undercloud upgrade will fail".

That's not to say that the db migration in nova/debian/nova-common.postinst doesn't need a revisit, so I think we should minimally keep this bug open to revisit that bit of the package.

Changed in nova (Ubuntu):
importance: Undecided → Medium
Felipe Reyes (freyes) wrote :


There are two issues here:

1) When upgrading TO newton "nova-manage db online_data_migrations" needs to be run, we are tracking this bug at
2) Ocata needs to sync the db_api and this is already done in the upstream deb source

The question would be if we should SRU the change into ocata, what do you think?

tags: added: sts
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers