placement services logs 405 response as untrapped error

Bug #1708167 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Chris Dent

Bug Description

When the placement service gets a bad method for an existing URL it raises an HTTPMethodNotAllowed exception. It does this outside of the WebOb wsgify context, meaning the the exception is caught the the FautlWrapper middleware and perceived to be an uncaught exception and logged as such, muddying the log files with something that is normal.

We don't see this log messaages in CI because we don't accidentally cause 405s. Where we intentionally cause them (in gabbi tests) the log message is recorded in the subunit data but not in the test output because the tests pass (passing tests do not display those messages).[1]

The fix is to treat the HTTPMethodNotAllowed as a wsgi app instead of an exception and call it. When doing that, things work as desired. Fix forthcoming.

[1] I discovered this because the subunit files on https://review.openstack.org/362766 were cresting the 50M limit, because in that change the api sample tests were passing but having all kinds of errors with the placement fixture (I've since fixed the patch) generating vast amounts of log messagse on successful tests. Digging in there also revealed the error message that this bug wants to deal with.

Tags: placement
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/490021
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7a895c67b1c2be1a4be17203c06f023aaf371546
Submitter: Jenkins
Branch: master

commit 7a895c67b1c2be1a4be17203c06f023aaf371546
Author: Chris Dent <email address hidden>
Date: Wed Aug 2 14:19:34 2017 +0100

    [placement] Avoid error log on 405 response

    Treat HTTPMethodNotAllowed as a WSGI application rather than exception
    so that it is not treated as an uncaught exception and logged as an ERROR
    in the PlacementHandler before being caught in the FaultWrapper middleware.
    Bad method detection is happening outside the context of WebOb wsgify
    handling (which automatically catches Webob exceptions and transforms
    them into appropriate responses) so we need to do the transformation
    ourself.

    This will help to avoid spurious noise in the logs. See the bug report
    for more detail.

    Change-Id: I6de7c2bffb08f370fcfbd86070c94263ee202f93
    Closes-Bug: #1708167

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0rc1

This issue was fixed in the openstack/nova 16.0.0.0rc1 release candidate.

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.