CreateStack non-graceful failure for invalid template-url server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Medium
|
Jeff Peeler | ||
Grizzly |
Fix Released
|
Medium
|
Jeff Peeler |
Bug Description
If the server specified in --template-url is valid, but is not running an http server, the API gets stuck waiting for a response resulting in the following non-graceful failure at the client side.
I guess we need some more sanity checks in the API code to avoid this
[root@heatlt heat]# service httpd stop
Stopping httpd (via systemctl): [ OK ]
[root@heatlt heat]# heat -d create wordpress --template-url=http://
DEBUG:Debug level logging enabled
Traceback (most recent call last):
File "/usr/bin/heat", line 5, in <module>
pkg_
File "/usr/lib/
self.
File "/usr/lib/
execfile(
File "/usr/lib/
main()
File "/usr/lib/
result = cmd(opts, args)
File "/usr/lib/
ret = func(*arguments, **kwargs)
File "/usr/lib/
result = c.create_
File "/usr/lib/
return self.stack_
File "/usr/lib/
res = self.do_
File "/usr/lib/
return func(self, *args, **kwargs)
File "/usr/lib/
headers=
File "/usr/lib/
return func(self, method, url, body, headers)
File "/usr/lib/
res = c.getresponse()
File "/usr/lib64/
response.
File "/usr/lib64/
version, status, reason = self._read_status()
File "/usr/lib64/
raise BadStatusLine(line)
httplib.
shardy
=======
Couple of notes from my initial investigation:
Problem is in api/v1/stacks.py StackController
The httplib.
Behavior seems slightly different between F16 and F17 - on F16 IIRC the conn.request blocks for a long time causing a null response to the client, whereas IIRC on F17 the request actually does throw an error (which should make it easier as we can just try/catch around it)
Changed in heat: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in heat: | |
status: | Triaged → In Progress |
Changed in heat: | |
milestone: | none → grizzly-2 |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | grizzly-2 → 2013.1 |
I was looking at this and wasn't sure how catching the error in _get_template would be all that useful. Is it alright to just make the traceback a little better? Otherwise, try/except blocks would need to also be put in create_or_update as well as client.py: stack_request. Having a generic except block at such a high level would eliminate potential useful debugging information for unexpected errors, right?