Heat template fail from Kilo release on validation (use to work till Juno)

Bug #1488475 reported by Guy Paz
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Rabi Mishra
Kilo
Fix Released
Medium
Unassigned

Bug Description

We are having some heat template that started to fail on validation from Kilo release (it is working till Juno).
I have also tested that on Liberty (devstack) and getting the same issue.
So currently we are not able to deploy our application on Openstack from Kilo release and newer.

You can see what happened when I m using the same heat template on two different versions.

=================================================
Here when I m creating a stack on Juno (work ok):
=================================================
[root@os-keystone-01 ~(keystone_admin)]# heat stack-create -f /tmp/cic/hot.yaml -e /tmp/cic/env.yaml stack01
+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+
| 1179b829-0127-4abd-8830-d4d45ae3067b | stack01 | CREATE_IN_PROGRESS | 2015-08-25T10:48:35Z |
+--------------------------------------+------------+--------------------+----------------------+

=======================
Here on Kilo / Liberty:
=======================
[stack@gpaz-devstack example(keystone_admin)]$ heat stack-create -f ./hot.yaml -e ./env.yaml stack01
ERROR: Failed to validate: : resources.APP-server01pair: : sequence item 0: expected string, NoneType found

Attached the heat template that we are using.

Revision history for this message
Guy Paz (guy-paz) wrote :
description: updated
Revision history for this message
Guy Paz (guy-paz) wrote :

In order to reproduce that just use the files that I have attached and execute :
"heat stack-create -f ./hot.yaml -e ./env.yaml stack01"

description: updated
Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
Revision history for this message
Rabi Mishra (rabi) wrote :

I think it's failing as the output 'OpenSec' is None for APP-secgroup.template.yaml, before the nested stack is created. When you are creating a list it's creating a list like '[None]'.

You can work around this by changing the following in APP-secgroup.template.yaml:
......
  OpenSec:
    description: Open security group.
    value: [{ get_resource: APP-open-sec }]

and then in hot.yaml don't create a list

    APP-server01pair:
        type: APP::VmPair
        depends_on:
            - APPnetworking
        properties:
 .....
            eth0_sec_groups: {get_attr: [APPnetworking, OpenSec]}

At least this works with master. I'll check how it used to work in Juno.

Revision history for this message
Guy Paz (guy-paz) wrote :

Thanks.
We deployed with the suggested workaround and deploy succeeded.

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

This looks like a duplicate bug. Fixed in master, still needs to be
backported to stable/kilo

Revision history for this message
Rabi Mishra (rabi) wrote :

I tried the templates with latest master and we still have the issue with the shared templates.

ERROR: Failed to validate: : resources.APP-server01pair: : sequence item 0: expected string, NoneType found.

Changed in heat:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Is the problem with hot.yaml#55, which isn't valid yaml:

            eth0_otherAllowed: { LIST: [
                "ip_address": { get_param: [NET_info, Net1, cidr] },
            ] }

should probably be

            eth0_otherAllowed: { LIST: [
                {"ip_address": { get_param: [NET_info, Net1, cidr] }},
            ] }

Revision history for this message
Rabi Mishra (rabi) wrote :

The issue is with hot.yaml#54, if you see my comment#3. I've given them a workaround that works.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/220402

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/220402
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=9652d232620cae88332ca076c18413f3a618f7de
Submitter: Jenkins
Branch: master

commit 9652d232620cae88332ca076c18413f3a618f7de
Author: Rabi Mishra <email address hidden>
Date: Fri Sep 4 11:08:34 2015 +0530

    Fix validation failure for TemplateResource

    When None is returned from `get_attr`, creating a list property
    of TemplateResource with it fails during validation. This
    sanitizes the None values to empty strings.

    Change-Id: I3f1b50854a23cdb3fa16ac976e81aef1473c21eb
    Closes-Bug: #1488475

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/220872

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/220872
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=e9e2f50151020b7562389f67ff1d758f689ac553
Submitter: Jenkins
Branch: stable/kilo

commit e9e2f50151020b7562389f67ff1d758f689ac553
Author: Rabi Mishra <email address hidden>
Date: Fri Sep 4 11:08:34 2015 +0530

    Fix validation failure for TemplateResource

    When None is returned from `get_attr`, creating a list property
    of TemplateResource with it fails during validation. This
    sanitizes the None values to empty strings.

    Change-Id: I3f1b50854a23cdb3fa16ac976e81aef1473c21eb
    Closes-Bug: #1488475
    (cherry picked from commit 9652d232620cae88332ca076c18413f3a618f7de)

Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-rc1 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.