Could not fetch remote template 'template.yaml': Invalid URL scheme

Bug #1534423 reported by Jeffrey Guan
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-heatclient
Invalid
Undecided
Unassigned

Bug Description

On the following heat 0.2.8 version, I tried to create stack by the following command:
heat stack-create -f ./templeate.hot.yaml -e ./templeate.env.yaml stack1

I received such error:
ERROR: Could not fetch remote template 'Third_template.yaml': Invalid URL scheme

Part of the template.hot.yaml is as follows:

resources:
  Third-networking:
    type: Third.template.yaml
    properties:
      eth0: {get_param: INTERNALnet0}
      internal_create_cnt: {get_param: gen_internal_net}

all the template are at the same directory.

Revision history for this message
Jeffrey Guan (double12gzh) wrote :

I tried to use the following command to get the debug info: heat --debug stack-create -f ./templeate.hot.yaml -e ./templeate.env.yaml stack1 and got the following errors.

Traceback (most recent call last):
  File "/usr/bin/heat", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.6/site-packages/heatclient/shell.py", line 429, in main
    HeatShell().main(args)
  File "/usr/lib/python2.6/site-packages/heatclient/shell.py", line 385, in main
    args.func(client, args)
  File "/usr/lib/python2.6/site-packages/heatclient/v1/shell.py", line 91, in do_stack_create
    hc.stacks.create(**fields)
  File "/usr/lib/python2.6/site-packages/heatclient/v1/stacks.py", line 109, in create
    data=kwargs, headers=headers)
  File "/usr/lib/python2.6/site-packages/heatclient/common/http.py", line 223, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/usr/lib/python2.6/site-packages/heatclient/common/http.py", line 188, in _http_request
    raise exc.from_response(resp)

Revision history for this message
Steve Baker (steve-stevebaker) wrote : Re: [Bug 1534423] [NEW] Could not fetch remote template 'template.yaml': Invalid URL scheme

Is this something to do with the difference between Third_template.yaml
and Third.template.yaml

How about renaming the file to Third_template.yaml and specifying "type:
Third_template.yaml"

On 15/01/16 15:45, Jeffrey G wrote:
> Public bug reported:
>
> On the following heat 0.2.8 version, I tried to create stack by the following command:
> heat stack-create -f ./templeate.hot.yaml -e ./templeate.env.yaml stack1
>
> I received such error:
> ERROR: Could not fetch remote template 'Third_template.yaml': Invalid URL scheme
>
>
> Part of the template.hot.yaml is as follows:
>
> resources:
> Third-networking:
> type: Third.template.yaml
> properties:
> eth0: {get_param: INTERNALnet0}
> internal_create_cnt: {get_param: gen_internal_net}
>
>
> all the template are at the same directory.
>
> ** Affects: python-heatclient
> Importance: Undecided
> Status: New
>

Revision history for this message
Jeffrey Guan (double12gzh) wrote :

Thank you very much for your rely. Just for your confirmation with the following:

How about renaming the file to Third_template.yaml and specifying "type:
Third_template.yaml"

I think, you meant that I should update the file name "Third_template.yaml" to Third.template.yaml, am I right?

I tried to use the template named Third.template.yaml. It seems that the issue is still there.

I also tried it on heat version 0.2.12, it works well. It might be a bug on 0.2.8.

Changed in python-heatclient:
status: New → Invalid
Revision history for this message
Hisham ELBARAMAWI (baramawi) wrote :

Hi, I could see same error on heat 1.0.0 on Mitaka .. any clue ?

Revision history for this message
onlyellow (onlyellow) wrote :

In Mitaka, the version of heat is 1.0.0 and the bug appeared again.

Revision history for this message
onlyellow (onlyellow) wrote :

P.S. I use centos7 to deploy openstack.

onlyellow (onlyellow)
Changed in python-heatclient:
status: Invalid → Confirmed
status: Confirmed → Incomplete
Revision history for this message
Jan Provaznik (jan-provaznik) wrote :

Hi, I hit the same on Centos 7.1 with centos-release-openstack-mitaka:
openstack-heat-engine-6.0.0-1.el7.noarch
python-heatclient-1.0.0-1.el7.noarch
openstack-heat-api-6.0.0-1.el7.noarch
openstack-heat-api-cfn-6.0.0-1.el7.noarch
openstack-heat-common-6.0.0-1.el7.noarch

The problem seems to be caused by python-heatclient sending a relative path when passing files referenced from the template. For example when creating openshift-on-openstack (see https://github.com/redhat-openstack/openshift-on-openstack) with the following command:
heat --debug stack-create my-openshift -t 180 -e openshift_parameters.yaml -f openshift-on-openstack/openshift.yaml
(openshift_parameters.yaml is attached)

It fails with:
heatclient.exc.HTTPBadRequest: ERROR: Could not fetch remote template "openshift-on-openstack/registry_ephemeral.yaml": Invalid URL scheme

When using the same setup with newer python-heatclient-1.2.0-1.el7ost.noarch it passes.
In centos output there is:
"...OOShift::RegistryVolume: openshift-on-openstack/registry_ephemeral.yaml\n..."

in rhel output there is:
"...\"OOShift::RegistryVolume\": \"file:///root/openshift-on-openstack/registry_ephemeral.yaml\"

My guess is that there is heat-engine <-> heatclient version incompatibility in Centos repository .

Revision history for this message
Jeffrey Guan (double12gzh) wrote :

I only tested it on Ubuntu 14.04 and hit this issue.

Revision history for this message
zhangdetong (zhangdetong) wrote :

Hi Jeffrey & Jan,

I hit the same on Centos 7, my environment is devstack and heat

I ran Jan's command and got the following error:

heat --debug stack-create my-openshift -t 180 -e openshift_parameters.yaml -f openshift-on-openstack/openshift.yaml

Traceback (most recent call last):
  File "/usr/bin/heat", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/heatclient/shell.py", line 612, in main
    HeatShell().main(args)
  File "/usr/lib/python2.7/site-packages/heatclient/shell.py", line 562, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/heatclient/v1/shell.py", line 139, in do_stack_create
    hc.stacks.create(**fields)
  File "/usr/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 172, in create
    data=kwargs, headers=headers)
  File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 193, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 318, in request
    raise exc.from_response(resp)
heatclient.exc.HTTPBadRequest: ERROR: The Parameter (flavor) was not defined in template.

I dont think there are errors in templates, i will try debugging for this issue, please tell me more about this if convenient, thank you.

Changed in python-heatclient:
assignee: nobody → zhangdetong (zhangdetong)
Revision history for this message
zhangdetong (zhangdetong) wrote :

Please refer to http://docs.openstack.org/developer/heat/template_guide/environment.html#override-a-resource-with-a-custom-resource.

In openshift_parameters.yaml the custom resource types are specified in relative paths, and use this env file will get an error. The error is gone after change the resource types into absolute paths and starts with file://.

So actually it is not heat-client's issue.

Changed in python-heatclient:
status: Incomplete → Invalid
assignee: zhangdetong (zhangdetong) → nobody
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.