placement api 404 errors are logged poorly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Chris Dent |
Bug Description
In version 1.0 of the placement API, 404 errors are logged at level ERROR with a traceback:
```
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
2016-09-22 10:37:20.033 22918 ERROR nova.api.
```
This is then immediately followed by an INFO which provides most of what's needed to analyse why a 404 is a 404:
```
2016-09-22 10:37:20.034 22918 INFO nova.api.
```
(note this particular 404 represents a bug in the service ('' and '/' path info should be treated the same), which will be reported in another bug)
First off, a 404 should probably not be logged as an error if we are assuming this is an api that people will be making diverse queries against. However, if we are choosing to log a traceback the not found message should include more information. The reason, at the moment, that there's not much there is that the placement handlers allow a NotFound from the objects in nova/objects/
What should probably happen here is that in the api handler code those places where a NotFound could happen, they should be caught, a debug log message made, and the NotFound transformed into more verbose webob.exc.
Changed in nova: | |
status: | New → Confirmed |
Discussion with sdague decided no specific need for a LOG.debug, the info log is sufficient.
There are some cases where a NotFound happens for something that is not the resource identified by the URL. Those cases I think are already dealt with and usually lead to an HTTPBadRequest/400.
I'll make this so.