update fails for nested stack

Bug #1411103 reported by Removed by request
6
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Angus Salkeld
Juno
Fix Released
High
Zane Bitter

Bug Description

A stack has failed creation due to an issue with a nested template. After trying stack-update to try and fix it, the update failed with "stack not created"

Steps to reproduce:
   1. nova keypair-add keypair_heat
   2. Using below templates, run heat stack-create test-001 -f test_fail.yaml
   3. nova keypair-delete keypair_heat
   4. heat stack-update with the same template

Heat starts the updating progress but fails because 'Error: Cannot update server, stack not created'. If this is as designed, then it should be picked at validation, and update should not start.

== log: ==

2015-01-15 06:28:53.476 2364 INFO heat.engine.resource [-] UPDATE: TemplateResource "server" Stack "test-002" [11780e9b-0e19-4764-a6c1-a1b40527ed98]
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource Traceback (most recent call last):
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 435, in _action_recorder
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource yield
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 690, in update
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource args=[after, tmpl_diff, prop_diff])
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 286, in wrapper
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource step = next(subtask)
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 476, in action_handler_task
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource handler_data = handler(*args)
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resources/template_resource.py", line 256, in handle_update
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource self.child_params())
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/stack_resource.py", line 227, in update_with_template
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource % self.name)
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource Error: Cannot update server, stack not created
2015-01-15 06:28:53.476 2364 TRACE heat.engine.resource

== templates: ==

test_fail.yaml:

heat_template_version: 2013-05-23

parameters:

  flavor:
    type: string
    default: m1.tiny

resources:

  keypair:
    type: OS::Nova::KeyPair
    properties:
      name: keypair_heat
      save_private_key: false

  server:
    type: server_fail.yaml
    properties:
      flavor: {get_param: flavor}
      key_name: {get_resource: keypair}
    depends_on: keypair

server_fail.yaml:

heat_template_version: 2013-05-23

parameters:
  image:
    type: string
    default: cirros-0.3.3-x86_64-disk
  key_name:
    type: string
  flavor:
    type: string
  availability_zone:
    type: string
    default: nova

resources:
  server:
    type: OS::Nova::Server
    properties:
      availability_zone: { get_param: availability_zone }
      flavor: { get_param: flavor }
      image: { get_param: image }
      key_name: { get_param: key_name }

Revision history for this message
Removed by request (removed3381998) wrote :

Heat version is from Sat Jan 10 14:19:40 2015 (commit 15043074b1cc92e720a570936b761706dcd86c58) on a devstack environment

description: updated
Song Li (lisong-cruise)
Changed in heat:
assignee: nobody → Song Li (lisong-cruise)
assignee: Song Li (lisong-cruise) → nobody
Revision history for this message
Song Li (lisong-cruise) wrote :

I think there would be a lots of problems like this one.
Maybe we might need a blue print to implement a precheck.

Revision history for this message
Angus Salkeld (asalkeld) wrote :

Song Li, please not a blueprint for a bug fix.

Changed in heat:
status: New → Triaged
importance: Undecided → High
Angus Salkeld (asalkeld)
Changed in heat:
assignee: nobody → Angus Salkeld (asalkeld)
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/147463

Changed in heat:
status: Triaged → In Progress
Angus Salkeld (asalkeld)
Changed in heat:
milestone: none → kilo-2
Zane Bitter (zaneb)
tags: added: juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit aafbf6025ca826d76f5ea6e99dfe2c2e62fe0422
Author: Angus Salkeld <email address hidden>
Date: Tue Feb 3 15:31:47 2015 +1000

    Fix update on failed stack

    In the case of a dependant resource failing, a nested stack will not get
    created, so we need to at least create an empty nested stack to allow
    the update to work.

    Change-Id: I2e83546801bce0da566ec8ef1322e30d695ff02a
    Closes-bug: 1411103

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

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/153368

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

Reviewed: https://review.openstack.org/153368
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=f6dfcc23de9e5d71988cc1de915198688a2d7c2f
Submitter: Jenkins
Branch: stable/juno

commit f6dfcc23de9e5d71988cc1de915198688a2d7c2f
Author: Angus Salkeld <email address hidden>
Date: Tue Feb 3 15:31:47 2015 +1000

    Fix update on failed stack

    In the case of a dependant resource failing, a nested stack will not get
    created, so we need to at least create an empty nested stack to allow
    the update to work.

    Change-Id: I2e83546801bce0da566ec8ef1322e30d695ff02a
    Closes-bug: 1411103
    (cherry picked from commit aafbf6025ca826d76f5ea6e99dfe2c2e62fe0422)

Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-2 → 2015.1.0
Zane Bitter (zaneb)
tags: added: in-stable-juno
removed: juno-backport-potential
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.