Bug 1255994

Summary: URL NotFound errors for local nested heat template on overcloud
Product: Red Hat OpenStack Reporter: jliberma <jliberma>
Component: rhosp-directorAssignee: Hugh Brock <hbrock>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Shai Revivo <srevivo>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.0 (Kilo)CC: jcoufal, jliberma, mburns, rhel-osp-director-maint, shardy
Target Milestone: ---   
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-09 23:22:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Heat validate command, error, trace
none
HOT for EAP 6 web app
none
HOT for Neutron private network none

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.