preview for autoscaling group is failed, because reference is None

Bug #1324493 reported by Sergey Kraynev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Sergey Kraynev

Bug Description

When I try to preview template with autoscaling group I get error:

2014-05-29 07:16:05.491 ERROR heat.openstack.common.rpc.amqp [req-019ea9a1-8c19-41a5-8780-74204434fbea demo demo] Exception during message handling
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp Traceback (most recent call last):
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/openstack/common/rpc/amqp.py", line 462, in _process_data
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp **args)
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/service.py", line 62, in wrapped
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp return func(self, ctx, *args, **kwargs)
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/service.py", line 505, in preview_stack
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp return api.format_stack_preview(stack)
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/api.py", line 147, in format_stack_preview
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp fmt_resources = map(format_resource, stack.preview_resources())
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/parser.py", line 452, in preview_resources
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp for resource in self.resources.itervalues()]
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/stack_resource.py", line 102, in preview
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp template = parser.Template(self.child_template())
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/resources/autoscaling.py", line 767, in child_template
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp return self._create_template(num_instances)
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/resources/autoscaling.py", line 313, in _create_template
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp instance_definition = self._get_instance_definition()
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/resources/autoscaling.py", line 296, in _get_instance_definition
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp instance_definition['Properties']['Tags'] = self._tags()
2014-05-29 07:16:05.491 TRACE heat.openstack.common.rpc.amqp KeyError: 'Properties'

It happens, because self.stack.resource_by_refid return incorrect resource.
During preview all ref_id is None, so we can get random resource. it should be fixed.

Changed in heat:
assignee: nobody → Sergey Kraynev (skraynev)
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/97543

Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → Critical
importance: Critical → High
Changed in heat:
assignee: Sergey Kraynev (skraynev) → Clint Byrum (clint-fewbar)
Changed in heat:
assignee: Clint Byrum (clint-fewbar) → Sergey Kraynev (skraynev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/97543
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=6ddfade84771f69b269a7f3ed0d19bc54c703e68
Submitter: Jenkins
Branch: master

commit 6ddfade84771f69b269a7f3ed0d19bc54c703e68
Author: Sergey Kraynev <email address hidden>
Date: Tue Jun 3 09:08:12 2014 -0400

    Using default FnGetRefId behavior for LaunchConfig

    FnGetRefId of LaunchConfig returns only physical_resource_name, but in
    the case where a resource is not created, resource.id equals None. So the
    result of FnGetRefId will be None too. It gives unpredictable behavior
    during preview, when other resources return None too.

    Change-Id: I425f777dbd0600e35354b0d5308cdaf701d85119
    Closes-Bug: #1324493

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-3 → 2014.2
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.