<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I was able to force this to work by
      updating SQLAlchemy's migrate utility to the latest version, FYI.<br>
      <br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <a
href="https://code.google.com/p/sqlalchemy-migrate/downloads/detail?name=sqlalchemy-migrate-0.7.2.tar.gz">https://code.google.com/p/sqlalchemy-migrate/downloads/detail?name=sqlalchemy-migrate-0.7.2.tar.gz</a><br>
      <br>
      Hopefully the RH guys can get that RPM updated on the EPEL repo at
      some point to prevent other future adventurers from repeating the
      same errors I did.<br>
      <br>
      Greg<br>
      <br>
      On 04/10/2013 03:15 PM, Greg Hill wrote:<br>
    </div>
    <blockquote cite="mid:5165E46B.4000604@liquidweb.com" type="cite">I
      made a bad assumption, it is using 0.7.8 and still gets the error:
      <br>
      <br>
      [root@glance site-packages]# glance-manage -v db_sync
      <br>
      2013-04-10 22:08:09.970 2966 INFO glance.db.sqlalchemy.migration
      [-] Upgrading database to version latest
      <br>
      2013-04-10 22:08:10.019 2966 CRITICAL glance [-] 'PGSchemaChanger'
      object has no attribute '_validate_identifier'
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance Traceback (most recent
      call last):
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance   File
      "/usr/bin/glance-manage", line 134, in <module>
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     main()
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance   File
      "/usr/bin/glance-manage", line 128, in main
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     CONF.command.func()
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance   File
      "/usr/bin/glance-manage", line 80, in do_db_sync
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      CONF.command.current_version)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance upgrade(version=version)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     return
      versioning_api.upgrade(sql_connection, repo_path, version)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     return _migrate(url,
      repository, version, upgrade=True, err=err, **opts)
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance   File "<string>",
      line 2, in _migrate
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     return f(*a, **kw)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance schema.runchange(ver,
      change, changeset.step)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance change.run(self.engine,
      step)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     script_func(engine)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      index.rename('ix_image_properties_image_id_name')
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      engine._run_visitor(visitorcallable, self, connection, **kwargs)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      conn._run_visitor(visitorcallable, element, **kwargs)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      **kwargs).traverse_single(element)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     ret =
      super(AlterTableVisitor, self).traverse_single(elem)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance     return meth(obj,
      **kw)
      <br>
      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
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      (self.preparer.quote(self._validate_identifier(index.name,
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance AttributeError:
      'PGSchemaChanger' object has no attribute '_validate_identifier'
      <br>
      2013-04-10 22:08:10.019 2966 TRACE glance
      <br>
      <br>
      I'll keep digging, but any help is appreciated.
      <br>
      <br>
      Greg
      <br>
      <br>
      On 04/10/2013 01:56 PM, Greg Hill wrote:
      <br>
      <blockquote type="cite">Trying to get openstack going with
        postgresql 9.2 as the database. Started with glance.  I got all
        the grizzly RPMs from this repo:
        <br>
        <br>
<a class="moz-txt-link-freetext" href="http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/epel-6/">http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/epel-6/</a>
        <br>
        <br>
        The database is created and the connection seems to work fine,
        but I get this error:
        <br>
        <br>
        [root@glance site-packages]# glance-manage db_sync
        <br>
        2013-04-10 20:36:47.482 2786 CRITICAL glance [-]
        'PGSchemaChanger' object has no attribute '_validate_identifier'
        <br>
        <br>
        I googled that and found a reference that it was an upstream
        SQLAlchemy bug that was fixed in 0.7.1.
        <br>
        <br>
        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:
        <br>
        <br>
        [root@glance glance]# yum list installed python-sqlalchemy*
        <br>
        Installed Packages
        <br>
        python-sqlalchemy.noarch 0.5.5-3.el6_2 @system-base
        <br>
        python-sqlalchemy0.7.x86_64 0.7.8-1.el6 @epel
        <br>
        <br>
        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?
        <br>
        <br>
        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.
        <br>
        <br>
        sql_connection = postgresql://$user:$pass@$ip/glance
        <br>
        <br>
        Greg
        <br>
        <br>
        _______________________________________________
        <br>
        Mailing list: <a class="moz-txt-link-freetext" href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a>
        <br>
        Post to     : <a class="moz-txt-link-abbreviated" href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>
        <br>
        Unsubscribe : <a class="moz-txt-link-freetext" href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a>
        <br>
        More help   : <a class="moz-txt-link-freetext" href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a>
        <br>
      </blockquote>
      <br>
      <br>
      _______________________________________________
      <br>
      Mailing list: <a class="moz-txt-link-freetext" href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a>
      <br>
      Post to     : <a class="moz-txt-link-abbreviated" href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>
      <br>
      Unsubscribe : <a class="moz-txt-link-freetext" href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a>
      <br>
      More help   : <a class="moz-txt-link-freetext" href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a>
      <br>
    </blockquote>
    <br>
  </body>
</html>