heat-api-cfn 500 (Internal server error) on an unkonwn action

Bug #1473083 reported by Attila Fazekas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
zhufeng

Bug Description

 $ heat stack-create -f test2.yaml test5
 $ curl -v $(python signed_req.py 'http://127.0.0.1:8000/v1/?&StackName=test5&Action=DescribeStackResourceee&LogicalResourceId=CfnUser' `heat output-show test5 AccessKey | sed s/\"//g` `heat output-show test5 SecretAccessKey | sed s/\"//g` )
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET /v1/?SignatureVersion=2&AWSAccessKeyId=1d2c250fc32643c4aeadd52f9d835e01&StackName=test5&SignatureMethod=HmacSHA256&Signature=jqBkvZ11301aCD4G2ALyZlv6uwoPCXHPXFJIi7%2FHGDc%3D&Action=DescribeStackResourceee&LogicalResourceId=CfnUser HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 127.0.0.1:8000
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain
< Content-Length: 3741
< Date: Thu, 09 Jul 2015 13:47:06 GMT
< Connection: close
<
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/eventlet/wsgi.py", line 454, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/new/heat/heat/common/wsgi.py", line 593, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1317, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1281, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/osprofiler/web.py", line 99, in __call__
    return request.get_response(self.application)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1317, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1281, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 434, in __call__
    response = req.get_response(self._app)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1317, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1281, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/new/heat/heat/common/wsgi.py", line 593, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1317, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1281, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/new/heat/heat/common/wsgi.py", line 885, in __call__
    raise translate_exception(err, request.best_match_language())
AttributeError: 'StackController' object has no attribute 'default'
* Closing connection 0

The issue requites valid AWS credentials and a not existing actions.
If you use 'DescribeStackResource' instead of 'DescribeStackResourceee' it works.

$curl -v $(python signed_req.py 'http://127.0.0.1:8000/v1/?&StackName=test5&Action=DescribeStackResource&LogicalResourceId=CfnUser' `heat output-show test5 AccessKey | sed s/\"//g` `heat output-show test5 SecretAccessKey | sed s/\"//g` )
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET /v1/?SignatureVersion=2&AWSAccessKeyId=1d2c250fc32643c4aeadd52f9d835e01&StackName=test5&SignatureMethod=HmacSHA256&Signature=4hipPMrucGQUdzprDWqkD9ORQmaZmsbqBJqks882zh0%3D&Action=DescribeStackResource&LogicalResourceId=CfnUser HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 127.0.0.1:8000
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/xml; charset=UTF-8
< Content-Length: 684
< Date: Thu, 09 Jul 2015 13:49:35 GMT
<
* Connection #0 to host 127.0.0.1 left intact
<DescribeStackResourceResponse><DescribeStackResourceResult><StackResourceDetail><StackId>arn:openstack:heat::78743bd03e0649be82a780ebc417dd95:stacks/test5/97ccf188-f085-454e-b859-ce55d13699ae</StackId><ResourceStatus>CREATE_COMPLETE</ResourceStatus><Description></Description><ResourceType>AWS::IAM::User</ResourceType><ResourceStatusReason>state changed</ResourceStatusReason><LastUpdatedTimestamp>2015-07-09T12:47:04</LastUpdatedTimestamp><StackName>test5</StackName><PhysicalResourceId>31ad7f4ba1ad443ca9804aeffb412fe7</PhysicalResourceId><Metadata/><LogicalResourceId>CfnUser</LogicalResourceId></StackResourceDetail></DescribeStackResourceResult></DescribeStackResourceResponse>

The template and the helper script will be attached.

Revision history for this message
Attila Fazekas (afazekas) wrote :
Revision history for this message
Attila Fazekas (afazekas) wrote :
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
zhufeng (gfl1998)
Changed in heat:
assignee: nobody → zhufeng (gfl1998)
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/214966

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/214966
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=5c3607cdb1aa3b87f9b9002fa566eeb0ea2fd958
Submitter: Jenkins
Branch: master

commit 5c3607cdb1aa3b87f9b9002fa566eeb0ea2fd958
Author: zhufeng <gfl1998@163.com>
Date: Thu Aug 20 13:58:10 2015 +0800

    Fix heat-api-cfn 500 error on an unknown action

    Add a default function in heat-api-cfn StackController, and raise
    an HeatActionNotSupported exception.

    Change-Id: I9023817792e949bde558dd22e818f38d6185f0fd
    Closes-Bug: #1473083

Changed in heat:
status: In Progress → Fix Committed
Changed in heat:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-3 → 5.0.0
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.