Glance error when service has no 'type'

Bug #956178 reported by Brian Lamar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Brian Lamar

Bug Description

When the service catalog is returned, if any service doesn't have a "type" field, glance client will raise the following traceback:

http://paste.openstack.org/show/9717/

While I understand "type" should be there, I believe glance should ignore the endpoint (perhaps just give a WARN log?).

Brian Lamar (blamar)
Changed in glance:
assignee: nobody → Brian Lamar (blamar)
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi Brian,

So, the Keystone v2 API contract says that each returned endpoint shall list a type attribute... not sure I buy that a better solution would be to ignore the endpoint, as that will (IMHO) make debugging things harder (even with a WARN in the log file...)

Welcome your thoughts on this, I'm a bit on the fence about your proposed solution.

-jay

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/5400

Changed in glance:
status: New → In Progress
Revision history for this message
Jay Pipes (jaypipes) wrote :

Set to Low priority since this is only affecting broken keystone service catalogs... but wouldn't mind a solution that made the KeyError into a more user-friendly exception with some useful information about a broken identity API contract...

Changed in glance:
importance: Undecided → Low
tags: added: essex-rc-potential
Revision history for this message
Brian Lamar (blamar) wrote :

Hey Jay,

I'm not sure what there is to be on the fence about :) I really don't think stack-traces are ever really acceptable in this sort of situation. If the auth service is mis-configured to return a service without a 'type' then it's an invalid service (as you say). Instead of completely not working this change would make it so glance would still work.

I'm open to alternate solutions, so let me know what you might want to do instead. I can't think of anything more graceful, we're still going to raise NoServiceEndpoint or AmbiguousEndpoint errors in those situations.

Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi again, Brian :)

Will be reviewing your proposed fix and add some comments there...

best,
=jay

Revision history for this message
Jay Pipes (jaypipes) wrote :

And, yes, totally agree under no circumstances should a traceback be barfed up on the user. totally agree with you there.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/5400
Committed: http://github.com/openstack/glance/commit/5638fabe4b5f63bdcb68b8e8d237584b259589b8
Submitter: Jenkins
Branch: master

commit 5638fabe4b5f63bdcb68b8e8d237584b259589b8
Author: Brian Lamar <email address hidden>
Date: Thu Mar 15 12:52:58 2012 -0400

    Do not error when service does not have 'type'.

    Although 'type' should be present, it would seem a NoServiceEndpoint
    exception would be more appropriate in the case of a misconfigured
    authentication service.

    Fixes bug 956178

    (Patch Set 2) Updated to add logging

    Change-Id: Ic8f552d8921107664cdd472f8476a9bd04322131

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
tags: removed: essex-rc-potential
Thierry Carrez (ttx)
Changed in glance:
milestone: none → essex-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: essex-rc1 → 2012.1
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.