Create stack via --template-url fails if it is url not to a template in a raw format

Bug #1495993 reported by Alexander Nagovitsyn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
Medium
Peter Razumovsky

Bug Description

Step
1 ssh to one of controllers

2 execute: . openrc

3 create stack using aws format template:
heat stack-create --template-url https://github.com/openstack/heat-templates/blob/master/cfn/F17/Neutron_floating.template -P internal_network=<id> -P external_network=<id> -P internal_subnet=<id>

Where <id> your existing networks

Result:
Error parsing template https://github.com/openstack/heat-templates/blob/master/cfn/F17/Neutron_floating.template mapping values are not allowed in this context
  in "<unicode string>", line 6, column 19

But when we change template format ( Raw view on GitHub) command works correctly
( https://raw.githubusercontent.com/openstack/heat-templates/master/cfn/F17/Neutron_floating.template )

ERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "7.0"
  openstack_version: "2015.1.0-7.0"
  api: "1.0"
  build_number: "288"
  build_id: "288"
  nailgun_sha: "93477f9b42c5a5e0506248659f40bebc9ac23943"
  python-fuelclient_sha: "1ce8ecd8beb640f2f62f73435f4e18d1469979ac"
  fuel-agent_sha: "082a47bf014002e515001be05f99040437281a2d"
  fuel-nailgun-agent_sha: "d7027952870a35db8dc52f185bb1158cdd3d1ebd"
  astute_sha: "a717657232721a7fafc67ff5e1c696c9dbeb0b95"
  fuel-library_sha: "121016a09b0e889994118aa3ea42fa67eabb8f25"
  fuel-ostf_sha: "1f08e6e71021179b9881a824d9c999957fcc7045"
  fuelmain_sha: "6b83d6a6a75bf7bca3177fcf63b2eebbf1ad0a85"

Tags: area-heat
Revision history for this message
Sergey Kraynev (skraynev) wrote :

We need to provide more recognizable error message or try to say, that template is wrong due to ...

Changed in mos:
status: New → Triaged
importance: Undecided → Medium
assignee: MOS Heat (mos-heat) → Peter Razumovsky (prazumovsky)
Revision history for this message
Sergey Kraynev (skraynev) wrote :

After some investigating this issue, I can say, that it's not possible to handle each particular case for wrong files types (in this case it's html instead of real yaml)

I suggested to add some option to heatclient, which allows force switching between yaml loaders.
SafeLoader also return part of file where error happend, CSafeLoader is more faster, but have less informative error message

Changed in mos:
milestone: none → 8.0
summary: - Create stack with AWS resources
+ Create stack using template with AWS resources via --template-url
summary: - Create stack using template with AWS resources via --template-url
+ Create stack via --template-url fails if it is url not to a template in
+ a raw format
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/heat (openstack-ci/fuel-8.0/liberty)

Change abandoned by Sergey Kraynev <email address hidden> on branch: openstack-ci/fuel-8.0/liberty
Review: https://review.fuel-infra.org/12886
Reason: It was merged as part of the sync https://review.fuel-infra.org/#/c/13660/

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/python-heatclient (openstack-ci/fuel-8.0/liberty)

Change abandoned by Sergey Kraynev <email address hidden> on branch: openstack-ci/fuel-8.0/liberty
Review: https://review.fuel-infra.org/12887
Reason: The mentioned above patch with merge sync was merged.

Revision history for this message
Sergey Kraynev (skraynev) wrote :

It was improved by fixes above. current behavior is:

root@node-2:~# heat stack-create --template-url https://github.com/openstack/heat-templates/blob/master/cfn/F17/Neutron_floating.template -P internal_network=8f939a85-090b-4dab-a993-5e7925e5919a -P external_network=d21d662e-5ea3-4a01-bb97-2f2303f3982a -P internal_subnet=2c620923-e472-46e9-abfd-ce6745b8bd88 test
Error parsing template https://github.com/openstack/heat-templates/blob/master/cfn/F17/Neutron_floating.template mapping values are not allowed here
  in "<unicode string>", line 7, column 19:
      <head prefix="og: http://ogp.me/ns# fb: http://o ...

So now user can realize, that has wrong template and understand where exactly template should be fixed.
I will mark bug as Fix Commited

Changed in mos:
status: Triaged → Fix Committed
tags: added: area-heat
removed: heat
Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :

Does it mean that it was really fixed?

root@node-1:~# heat stack-create --template-url https://github.com/openstack/heat-templates/blob/master/cfn/F17/Neutron_floating.template -P internal_network=0e97d2a3-1fa0-4dbe-921c-82a33317f3d1 -P external_network=cf43a0a5-b8ed-452a-8085-aaee4627b178 -P internal_subnet=10fa5c0b-9717-45b2-914a-4d23c1bf011a test-stack
Error parsing template https://github.com/openstack/heat-templates/blob/master/cfn/F17/Neutron_floating.template mapping values are not allowed here
  in "<unicode string>", line 7, column 19:
      <head prefix="og: http://ogp.me/ns# fb: http://o ...

why it is fail?

Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :

Previous trace was reproduced on the following build:

[root@fuel ~]# cat /etc/fuel/version.yaml
VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "8.0"
  api: "1.0"
  build_number: "510"
  build_id: "510"
  fuel-nailgun_sha: "41170db11c366af5fe04c1c539c11b2e3e388ef9"
  python-fuelclient_sha: "4f234669cfe88a9406f4e438b1e1f74f1ef484a5"
  fuel-agent_sha: "658be72c4b42d3e1436b86ac4567ab914bfb451b"
  fuel-nailgun-agent_sha: "b2bb466fd5bd92da614cdbd819d6999c510ebfb1"
  astute_sha: "b81577a5b7857c4be8748492bae1dec2fa89b446"
  fuel-library_sha: "ec7e212972ead554f21b52b9e165156665f659df"
  fuel-ostf_sha: "5fe41945c2a49f26c849df1fd46329f6db1ab6b0"
  fuel-mirror_sha: "351d568fa3b3e4dd062054b91d766aa54d379867"
  fuelmenu_sha: "234cb4cbb30fbd2df00f388c28f31606d9cae15f"
  shotgun_sha: "63645dea384a37dde5c01d4f8905566978e5d906"
  network-checker_sha: "a43cf96cd9532f10794dce736350bf5bed350e9d"
  fuel-upgrade_sha: "616a7490ec7199f69759e97e42f9b97dfc87e85b"
  fuelmain_sha: "94507c5e4dad6d8cfbd8f5d41aa8389d5335990a"

Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :
Changed in mos:
status: Fix Committed → Fix Released
Revision history for this message
Sergey Kraynev (skraynev) wrote :

Timur:
Let me clarify the real behavior. Heat expects that input template will be RAW format [1].
There is raw template used in mentioned documentation for creating stack. [2]

So it's expected behavior for Heat. (I suppose, we just need add extra highlight for this case in upstream documentation)

Regarding current bug: it was created, because existing traceback was poor and user could not understand the root cause of issue.
It was fixed in upstream and backported to liberty/MOS 8.0. So now User can get small snippet with reference on error in template.
I think, that it fully covers bug's target.

[1] http://docs.openstack.org/developer/heat/getting_started/create_a_stack.html#launching-a-stack
[2] http://git.openstack.org/cgit/openstack/heat-templates/plain/hot/F20/WordPress_Native.yaml

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.