Falcon error handlers not being consistently used, logging

Bug #1599843 reported by Domhnall Walsh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Backup/Restore and DR (Freezer)
In Progress
Undecided
Domhnall Walsh

Bug Description

The error handler mechanism as used in falcon provides a facility to log messages when bad requests occur - typically, these would mostly correspond to HTTP status codes in the 4xx range.

However, it appears that in a lot of cases the HTTP status code is being set explicitly in a manually generated, per-endpoint response rather than raising the appropriate exception, so the logging is not happening and the API is inconsistent in the way it communicates with its consumer(s).

The API should raise the appropriate exceptions for each of the error conditions for which one is defined (4xx, 500) instead of explicitly setting the HTTP status code, so that logging is consistently achieved and that every error message of a given type looks at least somewhat consistent.

Changed in freezer:
assignee: nobody → Domhnall Walsh (domhnall-walsh)
Revision history for this message
Domhnall Walsh (domhnall-walsh) wrote :

Mostly, this revolves around HTTP 404 (not found) errors, but I do note with some surprise a HTTP 753 (which I can't find anywhere online except the falcon docs) which apparently gets reported when you PUT/POST malformed JSON.

This error code seems wrong to me but I don't want to propose making changes there because it would change the behaviour of the API (even if it is under the conditions of user error) and therefore might require an API versioning bump.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to freezer-api (master)

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

Changed in freezer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on freezer-api (master)

Change abandoned by Saad Zaher (<email address hidden>) on branch: master
Review: https://review.openstack.org/339396
Reason: very old change, not valid any more

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.