Signal API makes POST body mandatory

Bug #1231926 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Steven Hardy

Bug Description

When posting to a signal URL, the body should not be mandatory, and we fail with a big ugly stacktrace if you try to post without a body:

# curl -X POST "http://127.0.0.1:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A8451068ec4d84d1a865334243675593b%3Astacks%2Ftest_stack7%2F5e8ea9e0-0c6f-4db8-b0e1-84dc435aa8aa%2Fresources%2Finstance_restarter?Timestamp=2013-09-27T10%3A51%3A06Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=e43e800726fb419cbe74bc8655b99659&SignatureVersion=2&Signature=oEIwrcfBAyTaVFp62VRG0WAVmahd0cHzGVFsVLslHPA%3D"
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/eventlet/wsgi.py", line 384, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/heat/common/wsgi.py", line 367, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/site-packages/keystoneclient/middleware/auth_token.py", line 545, in __call__
    return self.app(env, start_response)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/heat/common/wsgi.py", line 367, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/request.py", line 1296, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/request.py", line 1260, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/site-packages/Routes-1.12.3-py2.7.egg/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/WebOb-1.2.3-py2.7.egg/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/heat/common/wsgi.py", line 670, in __call__
    raise exception.HTTPExceptionDisguise(http_exc)
HTTPExceptionDisguise

In the api-cfn.log:

resources/instance_restarter'} __call__ /usr/lib/python2.7/site-packages/Routes-1.12.3-py2.7.egg/routes/middleware.py:103
2013-09-27 11:51:28.405 12107 ERROR root [-] Exception handling resource: signal() takes exactly 4 arguments (3 given)

Fix is to default the body to None in the controller

Steven Hardy (shardy)
Changed in heat:
assignee: nobody → Steven Hardy (shardy)
milestone: none → havana-rc1
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/48625
Committed: http://github.com/openstack/heat/commit/525e0fef97b0fd641f36f8c0bec179015488c99e
Submitter: Jenkins
Branch: master

commit 525e0fef97b0fd641f36f8c0bec179015488c99e
Author: Steven Hardy <email address hidden>
Date: Fri Sep 27 11:55:56 2013 +0100

    api : default signal body to None

    Default the signal body to None, so requests without a body don't fail

    Change-Id: Ia42d71a338459c8b6543b3d4c5b296d005f4c9ee
    Closes-Bug: #1231926

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
Faramir (faramir) wrote : AUTO: Hai Liang Wang is on vacation from 09-29 to 10-08 (returning 10/09/2013)

I am out of the office until 10/09/2013.

Conact me by phone for anything urgency.
Phone Number - 15801213126 . thanks !

Note: This is an automated response to your message "[Bug 1231926] Re:
Signal API makes POST body mandatory" sent on 09/28/2013 17:10:56.

This is the only notification you will receive while this person is away.

Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: havana-rc1 → 2013.2
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.