HTTP error codes are all kinds of broke
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
High
|
Zane Bitter | ||
Kilo |
Fix Released
|
High
|
Zane Bitter | ||
Liberty |
Fix Released
|
High
|
Zane Bitter |
Bug Description
The "fix" for the (non-) bug 1447194 ("Invalid exceptions raised in service.py") changed the perfectly valid exceptions raised in service.py to completely invalid ones.
Creating a new stack or updating an existing stack with a typo in one of the resource types in the template now results in a 404 error indicating that the stack doesn't exist.
Creating or updating a stack with a malformatted resource type (e.g. an empty string, or another type like an integer) in the template may now result in a 500 error.
In both cases we should obviously be returning 400, since the input is wrong.
The only improvement is that when querying the API for a resource schema for a template resource defined in the global environment, the patch now apparently unintentionally but arguably correctly returns 500 instead of 400. (This seems better since the problem is in the provider template installed on the server, not in any data the user has sent.)
The offending patch has only just been backported to Kilo and has not appeared in a release yet. Since the case of an invalid provider template in the global environment is pretty rare, and IMHO does not rise to the level that would justify changing API return codes in a stable branch, I propose to just revert the patch.
For master I'll come up with a fix that incorporates the improvement, and makes it explicit instead of implicit, and backport that to Liberty.
Changed in heat: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Zane Bitter (zaneb) |
tags: | added: liberty-backport-potential |
Changed in heat: | |
status: | In Progress → Fix Committed |
Changed in heat: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/248325
Review: https:/