Bug 1255994 - URL NotFound errors for local nested heat template on overcloud
Summary: URL NotFound errors for local nested heat template on overcloud
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: 10.0 (Newton)
Assignee: Hugh Brock
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-22 23:53 UTC by jliberma@redhat.com
Modified: 2016-10-09 23:22 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-09 23:22:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Heat validate command, error, trace (16.62 KB, text/plain)
2015-08-22 23:53 UTC, jliberma@redhat.com
no flags Details
HOT for EAP 6 web app (11.46 KB, text/plain)
2015-08-22 23:55 UTC, jliberma@redhat.com
no flags Details
HOT for Neutron private network (1.79 KB, text/plain)
2015-08-22 23:56 UTC, jliberma@redhat.com
no flags Details

Description jliberma@redhat.com 2015-08-22 23:53:12 UTC
Created attachment 1065947 [details]
Heat validate command, error, trace

Description of problem:

Nested Heat templates with local file references fail to validate and create with URL NotFound error.


Version-Release number of selected component (if applicable):
openstack-heat-common-2015.1.0-4.el7ost.noarch
python-heatclient-0.6.0-1.el7ost.noarch

Steps to Reproduce:
1. Deploy Undercloud and Overcloud (1 compute, 1 controller is fine)
2. Create a tenant and nested heat template with file refernce (not URL)
3. Validate or create nested heat template

Actual results:
Fails with trace:

heatclient.exc.HTTPNotFound: ERROR: Not found
Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/heat/common/context.py", line 300, in wrapped
    return func(self, ctx, *args, **kwargs)

  File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line 815, in validate_template
    ResourceClass = env.get_class(res['Type'])

  File "/usr/lib/python2.7/site-packages/heat/engine/environment.py", line 513, in get_class
    return self.registry.get_class(resource_type, resource_name)

  File "/usr/lib/python2.7/site-packages/heat/engine/environment.py", line 408, in get_class
    return info.get_class()

  File "/usr/lib/python2.7/site-packages/heat/engine/environment.py", line 146, in get_class
    env)

  File "/usr/lib/python2.7/site-packages/heat/engine/resources/template_resource.py", line 30, in generate_class
    data = TemplateResource.get_template_file(template_name, ('file',))

  File "/usr/lib/python2.7/site-packages/heat/engine/resources/template_resource.py", line 90, in get_template_file
    raise exception.NotFound(msg_fmt=msg)

NotFound: Could not fetch remote template "file:///home/stack/templates/lib/private_network.yaml": Failed to retrieve template: <urlopen error [Errno 2] No such file or directory: '/home/stack/templates/lib/private_network.yaml'>

Expected results:

Deploys nested stack

Additional info:

Attaching debug output from heat validate as HOTs

Comment 3 jliberma@redhat.com 2015-08-22 23:55:50 UTC
Created attachment 1065959 [details]
HOT for EAP 6 web app

Comment 4 jliberma@redhat.com 2015-08-22 23:56:23 UTC
Created attachment 1065960 [details]
HOT for Neutron private network

Comment 5 Steven Hardy 2015-08-24 16:38:45 UTC
I downloaded the template files uploaded, and there's an error in eapws5.yaml, I had to modify the resource definition to match the parameters defined in lib/private_network.yaml:

  network:
    type: lib/private_network.yaml
    properties:
      public_net_id: { get_param: public_net_id }

With that change, heat template-validate works fine with upstream heat - I've yet to test with heat deployed by OSPd but hopefully a useful data-point.

Comment 6 chris alfonso 2015-08-26 16:22:23 UTC
Jacob, can you verify this fixed your issue, please?

Comment 7 jliberma@redhat.com 2015-08-26 16:37:03 UTC
Chris, I am still testing.

I made the suggested change and hit new errors.

Its looks promising, I should know today.

Comment 8 jliberma@redhat.com 2015-08-27 19:39:47 UTC
Chris, I implemented the fix but heat template-validate for nested templates still fails. Heat can build the stack from the template, it is only the validate command that fails.


[stack@rhos0 ~(demo_member)]$ ls /home/stack/templates/lib/product-service.yaml 
/home/stack/templates/lib/product-service.yaml

[stack@rhos0 ~(demo_member)]$  heat --debug -v template-validate --template-file templates/eapws5_nested.yaml 
...
heatclient.exc.HTTPNotFound: ERROR: Not found
Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/heat/common/context.py", line 300, in wrapped
    return func(self, ctx, *args, **kwargs)

  File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line 815, in validate_template
    ResourceClass = env.get_class(res['Type'])

  File "/usr/lib/python2.7/site-packages/heat/engine/environment.py", line 513, in get_class
    return self.registry.get_class(resource_type, resource_name)

  File "/usr/lib/python2.7/site-packages/heat/engine/environment.py", line 408, in get_class
    return info.get_class()

  File "/usr/lib/python2.7/site-packages/heat/engine/environment.py", line 146, in get_class
    env)

  File "/usr/lib/python2.7/site-packages/heat/engine/resources/template_resource.py", line 30, in generate_class
    data = TemplateResource.get_template_file(template_name, ('file',))

  File "/usr/lib/python2.7/site-packages/heat/engine/resources/template_resource.py", line 90, in get_template_file
    raise exception.NotFound(msg_fmt=msg)

NotFound: Could not fetch remote template "file:///home/stack/templates/lib/product-service.yaml": Failed to retrieve template: <urlopen error [Errno 2] No such file or directory: '/home/stack/templates/lib/product-service.yaml'>

Comment 11 Mike Burns 2016-04-07 20:47:27 UTC
This bug did not make the OSP 8.0 release.  It is being deferred to OSP 10.

Comment 13 Jaromir Coufal 2016-10-09 23:22:44 UTC
This seems obsolete. Please, re-open if could be reproduced.


Note You need to log in before you can comment on or make changes to this bug.