Comment 7 for bug 883988

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Taking a closer look at the upstream issue as well as the history of the Ubuntu package, some notes:

1. The glance.postinst on natty only attempts to run a manual database migration if the sql_connection is configured for something other than a sqlite connection, which is the default.***
2. On default installs, the tables are automatically created by sqlalchemy when glance-registry is first run. As mentioned in the upstream bug these tables are created outside of version control without the metadata needed to perform future migrations.
3. Any subsequent attempt to run manual migrations will result in migrating from version 0, thus failing because the migration attempts to create tables that already exist.

This is not only an upgrade bug, but a natty bug as well.

To reproduce on natty without upgrading:

apt-get -y install glance
glance-manage db_sync

* In current natty packaging, the postinst is broken in the case of a sql_connection to something other than sqllite, as it tries to run 'glance-manage db sync' instead of 'db_sync'. So, if I've got a config file in place to point glance to a mysql server, postinst will always fail.