OpenStack Image Registry and Delivery Service (Glance)

sqlalchemy.exc.ProgrammingError: (ProgrammingError) relation "ix_image_properties_image_id_get" does not exist

Reported by Paul Belanger on 2012-03-12
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
High
J. Daniel Schmidt

Bug Description

Will attempting to test glance and pgsql (I'm adding dbconfig-common support) I get the following exception from glance-manage:

---
Traceback (most recent call last):
  File "/usr/bin/glance-manage", line 128, in <module>
    main()
  File "/usr/bin/glance-manage", line 124, in main
    dispatch_cmd(conf, args)
  File "/usr/bin/glance-manage", line 99, in dispatch_cmd
    cmd_func(conf, args)
  File "/usr/bin/glance-manage", line 87, in do_db_sync
    glance.registry.db.migration.db_sync(conf, version=db_version)
  File "/usr/lib/python2.7/dist-packages/glance/registry/db/migration.py", line 123, in db_sync
    upgrade(conf, version=version)
  File "/usr/lib/python2.7/dist-packages/glance/registry/db/migration.py", line 66, in upgrade
    return versioning_api.upgrade(sql_connection, repo_path, version)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<string>", line 2, in _migrate
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 159, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 91, in runchange
    change.run(self.engine, step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 145, in run
    script_func(engine)
  File "/usr/lib/python2.7/dist-packages/glance/registry/db/migrate_repo/versions/006_key_to_name.py", line 76, in upgrade
    index.rename('ix_image_properties_image_id_name')
  File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 642, in rename
    engine._run_visitor(visitorcallable, self, connection, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2234, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1904, in _run_visitor
    **kwargs).traverse_single(element)
  File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 53, in traverse_single
    ret = super(AlterTableVisitor, self).traverse_single(elem)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 86, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 183, in visit_index
    self.execute()
  File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 42, in execute
    return self.connection.execute(self.buffer.getvalue())
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1405, in execute
    params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1582, in _execute_text
    statement, parameters
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1646, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1639, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 330, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (ProgrammingError) relation "ix_image_properties_image_id_get" does not exist
 'ALTER INDEX ix_image_properties_image_id_get RENAME TO ix_image_properties_image_id_name' {}

Brian Waldon (bcwaldon) wrote :

At this point, we don't officially support pgsql. We've got several bugs filed related to the issue: https://bugs.launchpad.net/glance/+bugs?field.tag=postgresql. I am interested if you ran into any of the other bugs filed.

As for this specific issue: it appears that we simply need to look up the index name before attempting to rename it.

tags: added: postgresql

Fix proposed to branch: master
Review: https://review.openstack.org/5997

Changed in glance:
assignee: nobody → J. Daniel Schmidt (jdsn)
status: New → In Progress

Reviewed: https://review.openstack.org/5997
Committed: http://github.com/openstack/glance/commit/5eddae290dae6efc7c71cdbb35a3b76d37266451
Submitter: Jenkins
Branch: master

commit 5eddae290dae6efc7c71cdbb35a3b76d37266451
Author: Bernhard M. Wiedemann <email address hidden>
Date: Fri Mar 30 17:31:53 2012 +0200

    rename the right index

    fixes bug 953159
    This did not affect sqlite and mysql, because those can not rename indexes
    and thus used a separate sql file to drop and create the right one.

    Change-Id: Iab80a65464a591b732ecce4c00d04df50624e912

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-04-03
Changed in glance:
importance: Undecided → High
tags: added: essex-rc-potential
Thierry Carrez (ttx) on 2012-04-03
Changed in glance:
milestone: none → essex-rc3
tags: removed: essex-rc-potential

Reviewed: https://review.openstack.org/6142
Committed: http://github.com/openstack/glance/commit/6390447090b7fde8b71b780a665860f4a7a3d31c
Submitter: Jenkins
Branch: milestone-proposed

commit 6390447090b7fde8b71b780a665860f4a7a3d31c
Author: Bernhard M. Wiedemann <email address hidden>
Date: Fri Mar 30 17:31:53 2012 +0200

    rename the right index

    fixes bug 953159
    This did not affect sqlite and mysql, because those can not rename indexes
    and thus used a separate sql file to drop and create the right one.

    Change-Id: Iab80a65464a591b732ecce4c00d04df50624e912

Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-rc3 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers