[SRU] Validating a stack fails as one nested stack can't find an id from another

Bug #1579891 reported by Felipe Reyes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Invalid
Undecided
Unassigned
Liberty
Fix Released
High
Felipe Reyes
heat (Ubuntu)
Fix Released
Undecided
Unassigned
Declined for Xenial by James Page
Wily
Fix Released
High
Felipe Reyes

Bug Description

[Impact]

when a user tries to create nested templates, the network id cannot be retrieved raising an error, this works fine in Kilo.

[Test Case]

* Deploy openstack with heat enabled
  $ bzr branch lp:openstack-charm-testing
  $ cd openstack-charm-testing
  $ juju deployer -c default.yaml -d -v -s 10 wily-liberty
  $ juju action do heat/0 domain-setup
  $ ./configure
  $ cat << EOF > minimal_portneutron.yaml
heat_template_version: 2014-10-16
description: "Works well in Darmstadt Liberty LAB"
resources:
  network:
    type: network.yaml
    properties:
      name:
        list_join:
          - '_'
          - [ heat, { get_param: 'OS::stack_name' } ]
  port:
    type: OS::Neutron::Port
    properties:
      network_id: { get_attr: [ network, network ] }
EOF
  $ cat << EOF > minimal_portnested.yaml
heat_template_version: 2014-10-16
description: "ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id"
resources:
  network:
    type: network.yaml
    properties:
      name:
        list_join:
          - '_'
          - [ heat, { get_param: 'OS::stack_name' } ]
  port:
    type: port.yaml # Fails with 'Either network or network_id should be specified.'
    properties:
      network_id: { get_attr: [ network, network ] }
  $ cat << EOF > port.yaml
heat_template_version: 2014-10-16
parameters:
  network_id:
    type: string
resources:
  port:
    type: OS::Neutron::Port
    properties:
      network_id: { get_param: network_id }
  $ cat << EOF > network.yaml
heat_template_version: 2014-10-16
description: >
  Creates a Neutron network/subnet combination, along with a security group
  that allows all traffic from the subnet.
parameters:
  name:
    description: The name for the created network.
    type: string
resources:
  network:
    type: OS::Neutron::Net
    properties:
      name: { get_param: name }
outputs:
  network:
    description: The neutron network created.
    value: { get_resource: network }
  $ source novarc
  $ heat stack-create -f minimal_portneutron.yaml minimal_portneutron
  $ heat stack-create -f minimal_portnested.yaml minimal_portnested

Expected:

The nested port is created

Actual result:

Traceback (most recent call last):
  File "/usr/bin/heat", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/heatclient/shell.py", line 705, in main
    HeatShell().main(args)
  File "/usr/lib/python2.7/dist-packages/heatclient/shell.py", line 655, in main
    args.func(client, args)
  File "/usr/lib/python2.7/dist-packages/heatclient/v1/shell.py", line 140, in do_stack_create
    hc.stacks.create(**fields)
  File "/usr/lib/python2.7/dist-packages/heatclient/v1/stacks.py", line 136, in create
    data=kwargs, headers=headers)
  File "/usr/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 176, in post
    return self.request(url, 'POST', **kwargs)
  File "/usr/lib/python2.7/dist-packages/heatclient/common/http.py", line 317, in request
    raise exc.from_response(resp)
heatclient.exc.HTTPBadRequest: ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id

[Regression Potential]

* This patch was tested in a production environment and also it was already merged in the Liberty stable branch https://review.openstack.org/306293 , so the regression potential is minimum.

[Other Info]

* Upstream bug 1518676

Revision history for this message
Felipe Reyes (freyes) wrote :

Xenial (mitaka) already contains the fix, it's just needed in Liberty

no longer affects: heat
Changed in heat (Ubuntu):
status: New → Fix Released
tags: added: sts
Revision history for this message
Felipe Reyes (freyes) wrote :
Felipe Reyes (freyes)
description: updated
Revision history for this message
James Page (james-page) wrote :

Declining xenial task as already fixed in Mitaka.

Changed in heat (Ubuntu Wily):
status: New → Triaged
importance: Undecided → High
James Page (james-page)
Changed in cloud-archive:
status: New → Invalid
Revision history for this message
James Page (james-page) wrote :

Update for wily uploaded for the SRU team to review.

Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Felipe, or anyone else affected,

Accepted heat into wily-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/heat/1:5.0.1-0ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in heat (Ubuntu Wily):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
James Page (james-page) wrote :

Hello Felipe, or anyone else affected,

Accepted heat into liberty-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:liberty-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-liberty-needed to verification-liberty-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-liberty-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-liberty-needed
Revision history for this message
Felipe Reyes (freyes) wrote :

The version in wily-proposed fixes the problem

Evidence:

$ heat stack-create -f minimal_portneutron.yaml minimal_portneutron
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_IN_PROGRESS | 2016-05-12T16:59:24 | None |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
$ heat stack-list
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_COMPLETE | 2016-05-12T16:59:24 | None |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
$ heat stack-create -f minimal_portnested.yaml minimal_portnested
ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id

# install heat from proposed

$ heat stack-create -f minimal_portnested.yaml minimal_portnested
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_COMPLETE | 2016-05-12T16:59:24 | None |
| 9081062e-b6c9-42cd-8fe2-6f7fe2eade52 | minimal_portnested | CREATE_IN_PROGRESS | 2016-05-12T17:03:16 | None |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
$ heat stack-list
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_COMPLETE | 2016-05-12T16:59:24 | None |
| 9081062e-b6c9-42cd-8fe2-6f7fe2eade52 | minimal_portnested | CREATE_COMPLETE | 2016-05-12T17:03:16 | None |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+

tags: added: verification-done
removed: verification-needed
Revision history for this message
James Page (james-page) wrote :

Felipe

Any chance you could also verify liberty-proposed in the UCA?

Revision history for this message
Felipe Reyes (freyes) wrote :

James, sure, I'll do it.

Revision history for this message
Felipe Reyes (freyes) wrote :

Heat from liberty-proposed fixes the issue

Evidence:

$ heat stack-create -f minimal_portneutron.yaml minimal_portneutron
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| 40315bc4-6c8b-41b4-a53e-ec8e3ec18ae4 | minimal_portneutron | CREATE_IN_PROGRESS | 2016-05-17T21:25:58 | None |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
$ heat stack-list
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| 40315bc4-6c8b-41b4-a53e-ec8e3ec18ae4 | minimal_portneutron | CREATE_COMPLETE | 2016-05-17T21:25:58 | None |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
$ heat stack-create -f minimal_portnested.yaml minimal_portnested
heatclient.exc.HTTPBadRequest: ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id

# upgrade from cloud-archive:liberty-proposed

$ heat -d stack-create -f minimal_portnested.yaml minimal_portnested
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| 40315bc4-6c8b-41b4-a53e-ec8e3ec18ae4 | minimal_portneutron | CREATE_COMPLETE | 2016-05-17T21:25:58 | None |
| 1ac7b1c8-4053-4eda-b2ce-8a34d0691254 | minimal_portnested | CREATE_IN_PROGRESS | 2016-05-17T21:29:45 | None |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
$ heat stack-list
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| id | stack_name | stack_status | creation_time | updated_time |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| 40315bc4-6c8b-41b4-a53e-ec8e3ec18ae4 | minimal_portneutron | CREATE_COMPLETE | 2016-05-17T21:25:58 | None |
| 1ac7b1c8-4053-4eda-b2ce-8a34d0691254 | minimal_portnested | CREATE_COMPLETE | 2016-05-17T21:29:45 | None |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+

tags: added: verification-liberty-done
removed: verification-liberty-needed
Felipe Reyes (freyes)
Changed in heat (Ubuntu Wily):
assignee: nobody → Felipe Reyes (freyes)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package heat - 1:5.0.1-0ubuntu3

---------------
heat (1:5.0.1-0ubuntu3) wily; urgency=medium

  * Fix nested stacks validation (LP: #1579891)
    - d/p/Fix-Translate-properties-before-update.patch

 -- Felipe Reyes <email address hidden> Tue, 10 May 2016 10:21:25 +0100

Changed in heat (Ubuntu Wily):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for heat has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
James Page (james-page) wrote :

The verification of the Stable Release Update for heat has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
James Page (james-page) wrote :

This bug was fixed in the package heat - 1:5.0.1-0ubuntu3~cloud0
---------------

 heat (1:5.0.1-0ubuntu3~cloud0) trusty-liberty; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 heat (1:5.0.1-0ubuntu3) wily; urgency=medium
 .
   * Fix nested stacks validation (LP: #1579891)
     - d/p/Fix-Translate-properties-before-update.patch

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.