Cannot run glance-manage db_sync with PostgreSQL

Bug #1081172 reported by Phil Hopkins
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned

Bug Description

After configuring PostgreSQL and both glance api and glance registry to use postgresql, I run:
sudo -u glance glance-manage db_sync

I get the following error:

sudo -u glance glance-manage db_sync
Traceback (most recent call last):
  File "/usr/bin/glance-manage", line 126, in <module>
    main()
  File "/usr/bin/glance-manage", line 122, in main
    dispatch_cmd(args)
  File "/usr/bin/glance-manage", line 98, in dispatch_cmd
    cmd_func(args)
  File "/usr/bin/glance-manage", line 86, in do_db_sync
    glance.db.sqlalchemy.migration.db_sync(version, current_version)
  File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/migration.py", line 127, in db_sync
    upgrade(version=version)
  File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/migration.py", line 67, in upgrade
    return versioning_api.upgrade(sql_connection, repo_path, version)
  File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 185, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<string>", line 2, in _migrate
  File "/usr/lib/python2.6/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 364, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 90, in runchange
    change.run(self.engine, step)
  File "/usr/lib/python2.6/site-packages/migrate/versioning/script/py.py", line 145, in run
    script_func(engine)
  File "/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/migrate_repo/versions/006_key_to_name.py", line 75, in upgrade
    index.rename('ix_image_properties_image_id_name')
  File "/usr/lib/python2.6/site-packages/migrate/changeset/schema.py", line 620, in rename
    engine._run_visitor(visitorcallable, self, connection, **kwargs)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2303, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1973, in _run_visitor
    **kwargs).traverse_single(element)
  File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 55, in traverse_single
    ret = super(AlterTableVisitor, self).traverse_single(elem)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/sql/visitors.py", line 106, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 172, in visit_index
    (self.preparer.quote(self._validate_identifier(index.name,
AttributeError: 'PGSchemaChanger' object has no attribute '_validate_identifier'

I am running Scientific Linux 6.3 using postgresql-8.4.13-1.el6_3.x86_64 and openstack-glance from the EPEL rpm packaging ( openstack-glance-2012.2-3.el6.noarch, python-glance-2012.2-3.el6.noarch, python-glanceclient-0.5.1-1.el6.noarch)

Revision history for this message
Attila Fazekas (afazekas) wrote :

I think it is an sqlalchemy-migrate related issue
https://bugzilla.redhat.com/show_bug.cgi?id=879387

Revision history for this message
Pádraig Brady (p-draigbrady) wrote :

So since this seems to be an issue with the downstream version of python-migrate, I'm closing this,
and we can follow up at bug tracker in comment 1.

thanks,

Changed in glance:
status: New → Invalid
Revision history for this message
Phil Hopkins (phil-hopkins-a) wrote :

Thanks, I have verified that upgrading to SQLAlchemy 0.7.1 does fix the problem.

Phil

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.