Bug 1255994 - URL NotFound errors for local nested heat template on overcloud
URL NotFound errors for local nested heat template on overcloud
Status: CLOSED INSUFFICIENT_DATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director (Show other bugs)
7.0 (Kilo)
Unspecified Unspecified
medium Severity unspecified
: ---
: 10.0 (Newton)
Assigned To: Hugh Brock
Shai Revivo
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-22 19:53 EDT by jliberma@redhat.com
Modified: 2016-10-09 19:22 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-10-09 19:22:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description jliberma@redhat.com 2015-08-22 19:53:12 EDT
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 19:55:50 EDT
Created attachment 1065959 [details]
HOT for EAP 6 web app
Comment 4 jliberma@redhat.com 2015-08-22 19:56:23 EDT
Created attachment 1065960 [details]
HOT for Neutron private network
Comment 5 Steven Hardy 2015-08-24 12:38:45 EDT
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 12:22:23 EDT
Jacob, can you verify this fixed your issue, please?
Comment 7 jliberma@redhat.com 2015-08-26 12:37:03 EDT
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 15:39:47 EDT
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 16:47:27 EDT
This bug did not make the OSP 8.0 release.  It is being deferred to OSP 10.
Comment 13 Jaromir Coufal 2016-10-09 19:22:44 EDT
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.