Glance should ensure consistency in exception messages all the way to client

Bug #956469 reported by Gabriel Hurley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Wishlist
Unassigned

Bug Description

There is a systemic problem with the way Glance handles exceptions passed from underlying API and backend code to its client. The current model goes something like this:

1. Error happens.

2. Catch it, and log it.

3. Re-raise a different exception with no message, failing preserving either the message or traceback.

4. Allow client to transform neutered exception into an even-more-generic HTTP status code.

A perfect example of this is here: https://github.com/openstack/glance/blob/master/glance/registry/api/v1/images.py#L303

In that code, a very useful error message is logged with a very meaningful exception class, and then replace by a blank HTTPForbidden, which returns to the client as a 403 with no information.

This has lead to many hours of wasted developer time on bugs like https://bugs.launchpad.net/glance/+bug/955744 and https://bugs.launchpad.net/glance/+bug/952618.

This entire behavior needs to be re-thought and re-worked so that consumers of Glance's client can provide useful, meaningful experiences without spending hours digging through Glance's codebase.

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

I agree that more consistency should be used in how exceptions are handled in the controllers and how the client receives (and reraises non-HTTP exceptions.

Not sure I buy that the entire system needs to be overhauled though... and so I've changed the bug description accordingly.

best,
-jay

summary: - The way glance passes exceptions to the client needs to be completely
- re-evaluated
+ Glance should ensure consistency in exception messages all the way to
+ client
Changed in glance:
status: New → Incomplete
status: Incomplete → Confirmed
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in glance:
assignee: nobody → Brian Rosmaita (brian-rosmaita)
status: Triaged → In Progress
Changed in glance:
importance: Medium → Wishlist
status: In Progress → Triaged
assignee: Brian Rosmaita (brian-rosmaita) → nobody
Revision history for this message
Tom Fifield (fifieldt) wrote :

What is the status of this bug today, some two years later?

Changed in glance:
status: Triaged → Incomplete
Revision history for this message
Erno Kuvaja (jokke) wrote :

No response, Closing.

Changed in glance:
status: Incomplete → Invalid
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.