glance-manage db_export_metadefs fails with NoSuchColumnError

Bug #1434237 reported by Ashish
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Ashish

Bug Description

Running the command glance-manage db_export_metadefs fails with following error trace:

015-03-19 18:39:17.059 INFO glance.db.sqlalchemy.metadata [-] Namespace IOOpsperHost saved in /etc/glance/metadefs/IOOpsperHost.json
> /opt/stack/glance/glance/db/sqlalchemy/metadata.py(103)_get_namespace_resource_types()
-> get_metadef_namespace_resource_types_table(meta)
(Pdb) c
[(6L, 13L, None, None, datetime.datetime(2015, 3, 18, 2, 59, 30), None)]
2015-03-19 18:39:17.230 CRITICAL glance [-] NoSuchColumnError: "Could not locate column in row for column 'name'"

2015-03-19 18:39:17.230 TRACE glance Traceback (most recent call last):
2015-03-19 18:39:17.230 TRACE glance File "/usr/local/bin/glance-manage", line 10, in <module>
2015-03-19 18:39:17.230 TRACE glance sys.exit(main())
2015-03-19 18:39:17.230 TRACE glance File "/opt/stack/glance/glance/cmd/manage.py", line 303, in main
2015-03-19 18:39:17.230 TRACE glance return CONF.command.action_fn()
2015-03-19 18:39:17.230 TRACE glance File "/opt/stack/glance/glance/cmd/manage.py", line 184, in export_metadefs
2015-03-19 18:39:17.230 TRACE glance self.command_object.export_metadefs(CONF.command.path)
2015-03-19 18:39:17.230 TRACE glance File "/opt/stack/glance/glance/cmd/manage.py", line 148, in export_metadefs
2015-03-19 18:39:17.230 TRACE glance path)
2015-03-19 18:39:17.230 TRACE glance File "/opt/stack/glance/glance/db/sqlalchemy/metadata.py", line 481, in db_export_metadefs
2015-03-19 18:39:17.230 TRACE glance _export_data_to_file(meta, metadata_path)
2015-03-19 18:39:17.230 TRACE glance File "/opt/stack/glance/glance/db/sqlalchemy/metadata.py", line 404, in _export_data_to_file
2015-03-19 18:39:17.230 TRACE glance 'name': resource_type['name'],
2015-03-19 18:39:17.230 TRACE glance File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/result.py", line 331, in _key_fallback
2015-03-19 18:39:17.230 TRACE glance expression._string_or_unprintable(key))
2015-03-19 18:39:17.230 TRACE glance NoSuchColumnError: "Could not locate column in row for column 'name'"

Changed in glance:
status: New → Triaged
importance: Undecided → High
Ashish (ashish-jain14)
Changed in glance:
assignee: nobody → Ashish (ashish-jain14)
tags: added: metadef
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: Triaged → In Progress
Changed in glance:
milestone: none → kilo-rc1
tags: added: kilo-rc-potential
Changed in glance:
milestone: kilo-rc1 → none
milestone: none → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/166909
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=fe7ef09b3808509e010048184fa8d5acbf8312e5
Submitter: Jenkins
Branch: master

commit fe7ef09b3808509e010048184fa8d5acbf8312e5
Author: Ashish Jain <email address hidden>
Date: Mon Mar 23 16:01:42 2015 +0000

    Fixes glance-manage exporting meta definitions issue

    While using glance-manage db_export_metadefs the command fails
    with NoSuchColumnError for column 'name'. The issue is with calling
    function _export_data_to_file populating the values for
    resource_type_associations. This resource_type_associations expect
    one of the fields as 'name' whereas the function call _get_resource_type
    is returning an 'id'. Modified the _get_resource_type method to return
    whole resource type object.

    Change-Id: I1fb3f8eb60fec354d4897debd9034bf61d1a57b4
    Closes-Bug: #1434237

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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