Unable to delete stack when get_attr argument is not string

Bug #1536515 reported by Rabi Mishra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Rabi Mishra
Kilo
Fix Released
Undecided
Unassigned

Bug Description

Steps to reproduce:

1. Create a stack with the following templates.

a. port.yaml
------------------
heat_template_version: 2015-04-30
resources:
  port:
    type: OS::Neutron::Port
    properties:
      network: private
      fixed_ips:
        - subnet: private-subnet

outputs:
  port_resource:
    description: Port Resource
    value: {get_resouce: port} <<< Typo here..

b. server.yaml
----------------------
heat_template_version: 2015-04-30
resources:
  instance_port:
    type: port.yaml

  test_instance:
    type: OS::Nova::Server
    properties:
      name: test
      key_name: heat_key
      image: cirros-0.3.4
      flavor: m1.nano
      networks:
        - port: {get_attr: [instance_port, port_resource]}

Note : stack create fails with "StackValidationFailed: Property error: test_instance.Properties.networks[0].port: Value must be a string".

2. Try to do resource-list or stack-delete, it fails with the following traceback, it's not possible to delete the stack.

2016-01-21 13:09:10.498 35601 DEBUG oslo_messaging._drivers.amqpdriver [req-5328d8ad-a743-42fc-8ed5-27cdf3f37eb1 - demo - default default] sending reply msg_id: 3872e4f1fe7e41bd8514240950980404 reply queue: reply_e0e8e760990b4e5fbca9922cfc8ea2eb _send_reply /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:70
2016-01-21 13:09:10.512 35600 DEBUG oslo_messaging._drivers.amqpdriver [-] received message msg_id: ae0ec3ee3c5149d18843c876d1af0e37 reply to reply_e0e8e760990b4e5fbca9922cfc8ea2eb __call__ /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:196
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher [req-1b5116c7-b682-4c7c-8e95-2b145006a7b6 - demo - default default] Exception during message handling: Value must be a string
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 143, in _dispatch_and_reply
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher executor_callback))
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 189, in _dispatch
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher executor_callback)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/common/context.py", line 325, in wrapped
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher return func(self, ctx, *args, **kwargs)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/service.py", line 1527, in list_stack_resources
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher for resource in stack.iter_resources(depth)]
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/api.py", line 315, in format_stack_resource
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher rpc_api.RES_REQUIRED_BY: resource.required_by(),
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/resource.py", line 539, in required_by
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher return [r.name for r in self.stack.dependencies.required_by(self)]
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/stack.py", line 313, in dependencies
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher six.itervalues(self.resources))
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/stack.py", line 389, in _get_dependencies
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher res.add_dependencies(deps)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/resources/openstack/nova/server.py", line 954, in add_dependencies
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher nets = self.properties[self.NETWORKS]
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/properties.py", line 456, in __getitem__
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher return self._get_property_value(key)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/properties.py", line 449, in _get_property_value
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher return self.get_user_value(key, validate)
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/properties.py", line 441, in get_user_value
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher raise ValueError(six.text_type(e))
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher ValueError: Value must be a string
2016-01-21 13:09:10.551 35600 ERROR oslo_messaging.rpc.dispatcher
2016-01-21 13:09:10.566 35600 ERROR oslo_messaging._drivers.common [req-1b5116c7-b682-4c7c-8e95-2b145006a7b6 - demo - default default] Returning exception Value must be a string to caller

Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
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/270672

Changed in heat:
status: New → In Progress
Rabi Mishra (rabi)
Changed in heat:
importance: Undecided → Medium
milestone: none → mitaka-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/270672
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=0c0c497a330ebbfd5703b1677ca07141da199adb
Submitter: Jenkins
Branch: master

commit 0c0c497a330ebbfd5703b1677ca07141da199adb
Author: Rabi Mishra <email address hidden>
Date: Thu Jan 21 13:32:21 2016 +0530

    Ignore ValueError when adding dependencies

    When adding dependencies, we can ignore ValueError.

    Change-Id: Iaca3d364d0f68f50eb3ce5243b5aa33cc54072e6
    Closes-Bug: #1536515

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/272372

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/272373

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

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

commit 793809b960fbe285dbbf26b723b2a52f5b9b3cff
Author: Rabi Mishra <email address hidden>
Date: Thu Jan 21 13:32:21 2016 +0530

    Ignore ValueError when adding dependencies

    When adding dependencies, we can ignore ValueError.

    Change-Id: Iaca3d364d0f68f50eb3ce5243b5aa33cc54072e6
    Closes-Bug: #1536515
    (cherry picked from commit 0c0c497a330ebbfd5703b1677ca07141da199adb)

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

Reviewed: https://review.openstack.org/272372
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=f8bbea83ecd589055d9075a2d092285b3aac974c
Submitter: Jenkins
Branch: stable/liberty

commit f8bbea83ecd589055d9075a2d092285b3aac974c
Author: Rabi Mishra <email address hidden>
Date: Thu Jan 21 13:32:21 2016 +0530

    Ignore ValueError when adding dependencies

    When adding dependencies, we can ignore ValueError.

    Change-Id: Iaca3d364d0f68f50eb3ce5243b5aa33cc54072e6
    Closes-Bug: #1536515
    (cherry picked from commit 0c0c497a330ebbfd5703b1677ca07141da199adb)

tags: added: in-stable-liberty
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b3

This issue was fixed in the openstack/heat 6.0.0.0b3 development milestone.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 2015.1.4

This issue was fixed in the openstack/heat 2015.1.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 5.0.2

This issue was fixed in the openstack/heat 5.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 2015.1.4

This issue was fixed in the openstack/heat 2015.1.4 release.

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.