New database is not under version_controll
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glance (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Description: Ubuntu precise (development branch)
Release: 12.04
Package: python-
Set the following in /etc/glance/
sql_connection = mysql:/
Issue: New database is not put under version control
# dpkg -l | grep glance
ii glance 2012.1-0ubuntu2 OpenStack Image Registry and Delivery Service - Daemons
ii glance-api 2012.1-0ubuntu2 OpenStack Image Registry and Delivery Service - API
ii glance-client 2012.1-0ubuntu2 OpenStack Image Registry and Delivery Service - Registry
ii glance-common 2012.1-0ubuntu2 OpenStack Image Registry and Delivery Service - Common
ii glance-registry 2012.1-0ubuntu2 OpenStack Image Registry and Delivery Service - Registry
ii python-glance 2012.1-0ubuntu2 OpenStack Image Registry and Delivery Service - Python library
# mysql -u root -ppassword -e "create database glance;"
# /etc/init.
-- output snipped --
glance-registry stop/waiting
glance-registry start/running, process 6468
# glance-manage db_sync
ERROR: There was an error migrating the database.
Details: Database 'mysql:
# glance-manage db_version
ERROR: There was an error migrating the database.
Details: database 'mysql:
-----
On 2012.1-0ubuntu1 packages, from:
http://
http://
http://
http://
http://
http://
# dpkg -l | grep glance
ii glance 2012.1-0ubuntu1 OpenStack Image Registry and Delivery Service - Daemons
ii glance-api 2012.1-0ubuntu1 OpenStack Image Registry and Delivery Service - API
ii glance-client 2012.1-0ubuntu1 OpenStack Image Registry and Delivery Service - Registry
ii glance-common 2012.1-0ubuntu1 OpenStack Image Registry and Delivery Service - Common
ii glance-registry 2012.1-0ubuntu1 OpenStack Image Registry and Delivery Service - Registry
ii python-glance 2012.1-0ubuntu1 OpenStack Image Registry and Delivery Service - Python library
# mysql -u root -ppassword -e "create database glance;"
# /etc/init.
-- output snipped --
glance-registry stop/waiting
glance-registry start/running, process 7287
# glance-manage db_sync
# glance-manage db_version
13
summary: |
- New database is not under version_controlled + New database is not under version_controll |
Justin-
Please see a bug filed against Glance earlier today: https:/ /bugs.launchpad .net/bugs/ 981081 As it turns out, Essex glance does not actually run migrations against a new database anymore, it instead cheats (see description in that bug). The new Ubuntu package contains a patch that requires an extra step in creation of the glance database, we need to properly version control it and set it at version 0, to ensure all migrations are actually run:
glance-manage version_control 0
glance-manage db_sync
I should note that previously 2012.1-0ubuntu1, db_sync does not actually create the schema but glance-registry startup. If you were to stop glance-registry entirely, run db_sync, and inspect the glance database, the only thing that is created is a migrate_versions table wrongly claiming the db is versioned at version 13. Startup of glance-registry is actually creating the schema, albeit poorly, and migrate is not being used at all.
I've opted to refuse attempts to db_sync without first version_control, because ending up in the situation that db_sync is run without version_control results in 1, a database schema that only represents the current sqlalchemy models 2, greatly complicates incrementally downgrading or upgrading the database in the future.
This is a new issue and its possible we might work out a better solution that can be applied upstream and to our packages. In the meantime, run 'glance-manage version_control 0 && glance-manage db_sync' before migrating a new database (this is needed for using vanilla stable/essex branch as well)