nova sqlite db migration failing for ocata

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

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:
  nova-common
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/manage.py", line 1594, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/usr/lib/python2.7/dist-packages/nova/cmd/manage.py", line 644, in sync
    return migration.db_sync(version)
  File "/usr/lib/python2.7/dist-packages/nova/db/migration.py", 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/migration.py", line 57, in db_sync
    repository, version)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", 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/__init__.py", line 160, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 93, in runchange
    change.run(self.engine, step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 148, in run
    script_func(engine)
  File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/migrate_repo/versions/345_require_online_migration_completion.py", 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:
 nova-common
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".

https://bugs.launchpad.net/tripleo/+bug/1656791

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 :

Corey,

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 https://bugs.launchpad.net/charm-nova-cloud-controller/+bug/1711209
2) Ocata needs to sync the db_api and this is already done in the upstream deb source
  - https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/nova/tree/debian/nova-common.postinst#n53
  - https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/nova/commit/?id=feed7e0c8f085587bf7b8c3f169a951fdec745a0

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