ERROR: Authorization Failed: The resource could not be found. (HTTP 404)

Asked by tapash raha

Hi,

While creating a stack through heat we are getting this error (we are getting the same error from admin and demo users . The command is -

# heat stack-create mystack --template-file=my.template

and this is my.template , just to create a single instance -

# cat my.template
heat_template_version: 2013-05-23

description: Simple template to deploy a single compute instance

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      key_name: heat_key
      image: F17
      flavor: m1.small

Below is our heat-engine.log -

2013-11-08 11:57:57.918 6896 INFO heat.engine.service [-] template is {u'heat_template_version': u'2013-05-23', u'description': u'Simple template to deploy a single compute instance', u'resources': {u'my_instance': {u'type': u'OS::Nova::Server', u'properties': {u'key_name': u'heat_key', u'image': u'F17', u'flavor': u'm1.small'}}}}
2013-11-08 11:57:57.944 6896 INFO heat.engine.resource [-] Validating Server "my_instance"
2013-11-08 11:57:57.986 6896 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): 192.168.2.5
2013-11-08 11:57:57.990 6896 ERROR heat.engine.parser [-] Authorization Failed: The resource could not be found. (HTTP 404)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser Traceback (most recent call last):
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/engine/parser.py", line 308, in validate
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser result = res.validate()
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/engine/resources/server.py", line 371, in validate
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser nova_utils.get_keypair(self.nova(), key_name)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 315, in nova
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser return self.stack.clients.nova(service_type)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/engine/clients.py", line 111, in nova
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser management_url = self.url_for(service_type=service_type)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/engine/clients.py", line 86, in url_for
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser return self.keystone().url_for(**kwargs)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/common/heat_keystoneclient.py", line 309, in url_for
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser return self.client_v2.service_catalog.url_for(**kwargs)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/common/heat_keystoneclient.py", line 73, in client_v2
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser self._client_v2 = self._v2_client_init()
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/heat/common/heat_keystoneclient.py", line 103, in _v2_client_init
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser client_v2 = kc.Client(**kwargs)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py", line 139, in __init__
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser self.authenticate()
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/keystoneclient/httpclient.py", line 458, in authenticate
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser resp, body = self.get_raw_token_from_identity_service(**kwargs)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser File "/usr/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py", line 166, in get_raw_token_from_identity_service
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser "%s" % e)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser AuthorizationFailure: Authorization Failed: The resource could not be found. (HTTP 404)
2013-11-08 11:57:57.990 6896 TRACE heat.engine.parser
2013-11-08 11:57:57.990 6896 ERROR heat.openstack.common.rpc.amqp [-] Exception during message handling
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp Traceback (most recent call last):
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 461, in _process_data
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp **args)
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 60, in wrapped
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp return func(self, ctx, *args, **kwargs)
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 281, in create_stack
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp stack.validate()
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp File "/usr/lib/python2.7/dist-packages/heat/engine/parser.py", line 314, in validate
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp raise StackValidationFailed(message=str(ex))
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp StackValidationFailed: Authorization Failed: The resource could not be found. (HTTP 404)
2013-11-08 11:57:57.990 6896 TRACE heat.openstack.common.rpc.amqp
2013-11-08 11:57:57.991 6896 ERROR heat.openstack.common.rpc.common [-] Returning exception Authorization Failed: The resource could not be found. (HTTP 404) to caller
2013-11-08 11:57:57.991 6896 ERROR heat.openstack.common.rpc.common [-] ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 461, in _process_data\n **args)\n', ' File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 60, in wrapped\n return func(self, ctx, *args, **kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 281, in create_stack\n stack.validate()\n', ' File "/usr/lib/python2.7/dist-packages/heat/engine/parser.py", line 314, in validate\n raise StackValidationFailed(message=str(ex))\n', 'StackValidationFailed: Authorization Failed: The resource could not be found. (HTTP 404)\n']

Any help is appreciated.

Regards,

Tapash

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Heat Edit question
Assignee:
No assignee Edit question
Solved by:
tapash raha
Solved:
Last query:
Last reply:
Revision history for this message
Liang Chen (cbjchen) said :
#1

Did you customized your keystone-paste.ini ?

Revision history for this message
Bruce Martins (bmartins) said :
#2

I am seeing the same thing on one of my test setups as well, I have not customized the keystone-paste.ini

Revision history for this message
Bruce Martins (bmartins) said :
#3

just to add to my previous comment the heat-api log shows the below, validated the service auth, endpoint URL's etc. I haven't tried submitting this through the API yet, but was validating this setup as I normally do using the heat cli.

2013-11-09 14:19:57.903 1723 ERROR root [-] Unexpected error occurred serving API: Authorization Failed: The resource could not be found. (HTTP 404)
2013-11-09 14:19:57.903 1723 TRACE root Traceback (most recent call last):
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/common/wsgi.py", line 661, in __call__
2013-11-09 14:19:57.903 1723 TRACE root request, **action_args)
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/common/wsgi.py", line 729, in dispatch
2013-11-09 14:19:57.903 1723 TRACE root return method(*args, **kwargs)
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/api/openstack/v1/util.py", line 30, in handle_stack_method
2013-11-09 14:19:57.903 1723 TRACE root return handler(controller, req, **kwargs)
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/api/openstack/v1/stacks.py", line 221, in create
2013-11-09 14:19:57.903 1723 TRACE root data.args())
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/rpc/client.py", line 88, in create_stack
2013-11-09 14:19:57.903 1723 TRACE root params=params, files=files, args=args))
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/proxy.py", line 126, in call
2013-11-09 14:19:57.903 1723 TRACE root result = rpc.call(context, real_topic, msg, timeout)
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/__init__.py", line 141, in call
2013-11-09 14:19:57.903 1723 TRACE root return _get_impl().call(CONF, context, topic, msg, timeout)
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/impl_kombu.py", line 816, in call
2013-11-09 14:19:57.903 1723 TRACE root rpc_amqp.get_connection_pool(conf, Connection))
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 574, in call
2013-11-09 14:19:57.903 1723 TRACE root rv = list(rv)
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 539, in __iter__
2013-11-09 14:19:57.903 1723 TRACE root raise result
2013-11-09 14:19:57.903 1723 TRACE root StackValidationFailed_Remote: Authorization Failed: The resource could not be found. (HTTP 404)
2013-11-09 14:19:57.903 1723 TRACE root Traceback (most recent call last):
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 461, in _process_data
2013-11-09 14:19:57.903 1723 TRACE root **args)
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2013-11-09 14:19:57.903 1723 TRACE root result = getattr(proxyobj, method)(ctxt, **kwargs)
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 60, in wrapped
2013-11-09 14:19:57.903 1723 TRACE root return func(self, ctx, *args, **kwargs)
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 281, in create_stack
2013-11-09 14:19:57.903 1723 TRACE root stack.validate()
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root File "/usr/lib/python2.7/dist-packages/heat/engine/parser.py", line 314, in validate
2013-11-09 14:19:57.903 1723 TRACE root raise StackValidationFailed(message=str(ex))
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root StackValidationFailed: Authorization Failed: The resource could not be found. (HTTP 404)
2013-11-09 14:19:57.903 1723 TRACE root
2013-11-09 14:19:57.903 1723 TRACE root

Revision history for this message
Bruce Martins (bmartins) said :
#4

I was able to resolve my problem by adding the below to the /etc/heat/api-paste.ini

auth_uri = http://${keystone-server}:35357/v2.0

replace the ${keystone-server} with your keystone server and restart the heat services

service heat-engine restart
service heat-api restart
service heat-api-cfn restart

Revision history for this message
Steve Baker (steve-stevebaker) said :
#5

Actually, api-paste.ini is not meant to be modified ever.

Instead could you please try setting auth_uri in /etc/heat/heat.conf, sections [keystone_authtoken] and [ec2authtoken]

Revision history for this message
Bruce Martins (bmartins) said :
#6

Steven thanks, but [keystone_authtoken] does not exist in the default package for heat.conf ?

removing that configuration from the /etc/heat/api-paste.ini and placing it in /etc/heat/heat.conf as you suggested causes the heat-api and heat-api-cfn to fail to start.

modifying this file is indicated in the installation guide on the openstack site and many others including redhat's installation guide for openstack

Revision history for this message
Bruce Martins (bmartins) said :
#7

sorry typo in my config which caused the API to fail to start, so you are correct

but if what you say is true all of the installation guides should be changed than to modify the heat.conf and not the api-paste.ini

anyway hopefully what I posted helps the original poster with their problem.

Revision history for this message
Steve Baker (steve-stevebaker) said :
#8

I've asked that section 7 of http://docs.openstack.org/havana/install-guide/install/apt/content/heat-install.html be updated to refer to heat.conf instead of api-paste.ini.

I haven't found any other install guide which mentions api-paste.ini. If you know of any then please let me know so they can be corrected.

thanks.

Revision history for this message
tapash raha (rahatapash) said :
#9

I have only added auth_url in /etc/heat/api-paste.ini as below

[filter:authtoken]
paste.filter_factory = heat.common.auth_token:filter_factory
auth_host = 192.168.2.5
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = heat
admin_password = service_pass
auth_uri = http://192.168.2.5:35357/v2.0

And restarted heat related services, Now i am successfully creating satck. My problem was solved.

Thanks for your help.

Revision history for this message
Julien (julienitsme) said :
#10

Hi i did the same and it also solved my issue : StackValidationFailed: Authorization Failed: The resource could not be found. (HTTP 404)

# Auth middleware that validates token against keystone
[filter:authtoken]
paste.filter_factory = heat.common.auth_token:filter_factory
## Bugg manual add
auth_uri = http://172.17.1.99:35357/v2.0

Thanks