[Openstack] can't get db_sync to work

Greg Hill gnhill at liquidweb.com
Wed Apr 10 22:15:07 UTC 2013


I made a bad assumption, it is using 0.7.8 and still gets the error:

[root at glance site-packages]# glance-manage -v db_sync
2013-04-10 22:08:09.970 2966 INFO glance.db.sqlalchemy.migration [-] 
Upgrading database to version latest
2013-04-10 22:08:10.019 2966 CRITICAL glance [-] 'PGSchemaChanger' 
object has no attribute '_validate_identifier'
2013-04-10 22:08:10.019 2966 TRACE glance Traceback (most recent call last):
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/bin/glance-manage", line 134, in <module>
2013-04-10 22:08:10.019 2966 TRACE glance     main()
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/bin/glance-manage", line 128, in main
2013-04-10 22:08:10.019 2966 TRACE glance     CONF.command.func()
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/bin/glance-manage", line 80, in do_db_sync
2013-04-10 22:08:10.019 2966 TRACE glance CONF.command.current_version)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/migration.py", 
line 127, in db_sync
2013-04-10 22:08:10.019 2966 TRACE glance upgrade(version=version)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/migration.py", 
line 66, in upgrade
2013-04-10 22:08:10.019 2966 TRACE glance     return 
versioning_api.upgrade(sql_connection, repo_path, version)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 185, 
in upgrade
2013-04-10 22:08:10.019 2966 TRACE glance     return _migrate(url, 
repository, version, upgrade=True, err=err, **opts)
2013-04-10 22:08:10.019 2966 TRACE glance   File "<string>", line 2, in 
_migrate
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/versioning/util/__init__.py", 
line 160, in with_engine
2013-04-10 22:08:10.019 2966 TRACE glance     return f(*a, **kw)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 364, 
in _migrate
2013-04-10 22:08:10.019 2966 TRACE glance schema.runchange(ver, change, 
changeset.step)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 
90, in runchange
2013-04-10 22:08:10.019 2966 TRACE glance change.run(self.engine, step)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/versioning/script/py.py", line 
145, in run
2013-04-10 22:08:10.019 2966 TRACE glance     script_func(engine)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/glance/db/sqlalchemy/migrate_repo/versions/006_key_to_name.py", 
line 85, in upgrade
2013-04-10 22:08:10.019 2966 TRACE glance 
index.rename('ix_image_properties_image_id_name')
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/changeset/schema.py", line 
620, in rename
2013-04-10 22:08:10.019 2966 TRACE glance 
engine._run_visitor(visitorcallable, self, connection, **kwargs)
2013-04-10 22:08:10.019 2966 TRACE glance   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
2013-04-10 22:08:10.019 2966 TRACE glance 
conn._run_visitor(visitorcallable, element, **kwargs)
2013-04-10 22:08:10.019 2966 TRACE glance   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
2013-04-10 22:08:10.019 2966 TRACE glance **kwargs).traverse_single(element)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 
55, in traverse_single
2013-04-10 22:08:10.019 2966 TRACE glance     ret = 
super(AlterTableVisitor, self).traverse_single(elem)
2013-04-10 22:08:10.019 2966 TRACE glance   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
2013-04-10 22:08:10.019 2966 TRACE glance     return meth(obj, **kw)
2013-04-10 22:08:10.019 2966 TRACE glance   File 
"/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 
172, in visit_index
2013-04-10 22:08:10.019 2966 TRACE glance 
(self.preparer.quote(self._validate_identifier(index.name,
2013-04-10 22:08:10.019 2966 TRACE glance AttributeError: 
'PGSchemaChanger' object has no attribute '_validate_identifier'
2013-04-10 22:08:10.019 2966 TRACE glance

I'll keep digging, but any help is appreciated.

Greg

On 04/10/2013 01:56 PM, Greg Hill wrote:
> Trying to get openstack going with postgresql 9.2 as the database. 
> Started with glance.  I got all the grizzly RPMs from this repo:
>
> http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/epel-6/
>
> The database is created and the connection seems to work fine, but I 
> get this error:
>
> [root at glance site-packages]# glance-manage db_sync
> 2013-04-10 20:36:47.482 2786 CRITICAL glance [-] 'PGSchemaChanger' 
> object has no attribute '_validate_identifier'
>
> I googled that and found a reference that it was an upstream 
> SQLAlchemy bug that was fixed in 0.7.1.
>
> Luckily, the repo above provides version 0.7.8 of SQLAlchemy.  I 
> noticed that both version 0.5.5 and 0.7.8 of SQLAlchemy are installed:
>
> [root at glance glance]# yum list installed python-sqlalchemy*
> Installed Packages
> python-sqlalchemy.noarch 0.5.5-3.el6_2 @system-base
> python-sqlalchemy0.7.x86_64 0.7.8-1.el6 @epel
>
> But forcing removal of 0.5.5 and restarting everything does not cause 
> the issue to go away.  Is there something else I can check? Is there 
> some way to just dump the SQL commands to manually create the 
> database?  Is there some way to force glance to use the 0.7.8 version 
> of SQLAlchemy?
>
> Not that I believe it's relevant, but here's the connection string 
> from the config file (scrubbed).  Both the api and registry configs 
> have this set, and it's the only config value I changed from the default.
>
> sql_connection = postgresql://$user:$pass@$ip/glance
>
> Greg
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp





More information about the Openstack mailing list