Should return 404 on resource not found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Low
|
Julien Danjou | ||
WSME |
Invalid
|
Undecided
|
Julien Danjou |
Bug Description
Based on current implement, InvalidInput, MissingArgument and UnknownArgument of wsme.exc are using both " and ' in the error message. But when the Debug level of CM is set as True, the return code is correct. But if the Debug level is set as False, the error code of InvalidInput, MissingArgument and UnknownArgument will return 500 instead of 400. The error trace is as below:
Traceback (most recent call last):
File "/usr/lib/
self.result = application(
File "/opt/stack/
return self.v2(environ, start_response)
File "/opt/stack/
return self.app(env, start_response)
File "/usr/local/
return self.applicatio
File "/opt/stack/
app_iter = self.app(environ, replacement_
File "/usr/local/
self.
File "/usr/local/
result = self.render(
File "/usr/local/
return renderer.
File "/usr/local/
return wsme.rest.
File "/usr/local/
return json.dumps(
File "/usr/lib/
return _default_
File "/usr/lib/
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/
return _iterencode(o, 0)
File "/usr/lib/
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: u'Unknown argument: "arg": fake' is not JSON serializable
127.0.0.1 - - [30/Aug/2013 15:38:54] "GET /v2/resources/fake HTTP/1.1" 500 59
Based on my investigation, I found current the method dumps of wsme/json.py can't parse dict like below, no matter the Debug level is True or False.
{'debuginfo': None, 'faultcode': 'Client', 'faultstring': u'Unknown argument: "arg": fake'}
But it works for the standard json lib. So it means the TypeError caused the 500.
However, it still can't explain why the Debug level will impact the return code.
Changed in ceilometer: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in ceilometer: | |
assignee: | nobody → Fei Long Wang (flwang) |
status: | Triaged → In Progress |
Changed in wsme: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Julien Danjou (jdanjou) |
Changed in ceilometer: | |
status: | In Progress → Triaged |
Changed in ceilometer: | |
milestone: | havana-rc1 → none |
tags: | added: havana-rc-potential |
Changed in wsme: | |
status: | Incomplete → Invalid |
importance: | Medium → Undecided |
Changed in ceilometer: | |
milestone: | none → havana-rc1 |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | havana-rc1 → 2013.2 |
i'm not sure i follow this. does this mean depending on whether we use a single quotation or double quotation in the error message, it will throw a different error code?