Stack fails to create when TimeoutInMinutes property is a string

Bug #1240903 reported by Simon Pasquier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Angus Salkeld
Havana
Fix Released
Medium
Steve Baker

Bug Description

Stack creation fails with the following template:
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "",
  "Mappings": {},
  "Outputs": {},
  "Parameters": {
    "KeyName": {
      "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
      "Type": "String"
    },
    "NbOfNodes": {
      "Type": "String",
      "Default": "1"
    }
  },
  "Resources": {
    "Nested": {
     "Type": "AWS::CloudFormation::Stack",
     "Properties": {
       "TemplateURL":"http://127.0.0.1/media/nested.json",
       "TimeoutInMinutes": "10",
       "Parameters": {
         "KeyName":{"Ref":"KeyName"},
         "NbOfNodes":{"Ref":"NbOfNodes"}
       }
     }
    }
  }
}

$ heat stack-show stack1
+----------------------+-------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+----------------------+-------------------------------------------------------------------------------------------------------------------------------+
| capabilities | [] |
| creation_time | 2013-10-17T10:00:49Z |
| description | |
| disable_rollback | True |
| id | 7522d3a5-7c64-4cfd-9239-81a6ceb5b1d6 |
| links | http://172.16.0.48:8004/v1/2bc5532bfd3e4263a949d810e6fc4e65/stacks/stack1/7522d3a5-7c64-4cfd-9239-81a6ceb5b1d6 |
| notification_topics | [] |
| parameters | { |
| | "AWS::StackId": "arn:openstack:heat::2bc5532bfd3e4263a949d810e6fc4e65:stacks/stack1/7522d3a5-7c64-4cfd-9239-81a6ceb5b1d6", |
| | "KeyName": "test", |
| | "AWS::Region": "ap-southeast-1", |
| | "AWS::StackName": "stack1", |
| | "NbOfNodes": "1" |
| | } |
| stack_name | stack1 |
| stack_status | CREATE_FAILED |
| stack_status_reason | Resource create failed: TypeError: unsupported operand |
| | type(s) for +: 'float' and 'unicode' |
| template_description | |
| timeout_mins | 60 |
| updated_time | 2013-10-17T10:00:50Z |
+----------------------+-------------------------------------------------------------------------------------------------------------------------------+

Heat engine logs:
2013-10-17 10:07:09.710 ERROR heat.engine.resource [-] CREATE : NestedStack "Nested"
2013-10-17 10:07:09.710 TRACE heat.engine.resource Traceback (most recent call last):
2013-10-17 10:07:09.710 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 358, in _do_action
2013-10-17 10:07:09.710 TRACE heat.engine.resource handle_data = handle()
2013-10-17 10:07:09.710 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/stack.py", line 69, in handle_create
2013-10-17 10:07:09.710 TRACE heat.engine.resource self.properties[PROP_TIMEOUT_MINS])
2013-10-17 10:07:09.710 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/stack_resource.py", line 108, in create_with_template
2013-10-17 10:07:09.710 TRACE heat.engine.resource stack_creator.start(timeout=self._nested.timeout_secs())
2013-10-17 10:07:09.710 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 134, in start
2013-10-17 10:07:09.710 TRACE heat.engine.resource self._timeout = Timeout(self, timeout)
2013-10-17 10:07:09.710 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 72, in __init__
2013-10-17 10:07:09.710 TRACE heat.engine.resource self._endtime = wallclock() + timeout
2013-10-17 10:07:09.710 TRACE heat.engine.resource TypeError: unsupported operand type(s) for +: 'float' and 'unicode'
2013-10-17 10:07:09.710 TRACE heat.engine.resource

Revision history for this message
Steven Hardy (shardy) wrote :
Changed in heat:
milestone: none → icehouse-1
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Angus Salkeld (asalkeld) wrote :

This is fixed by https://review.openstack.org/#/c/52564/
But I'll add a test case for this too.

Changed in heat:
status: Triaged → Fix Committed
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/52795

Angus Salkeld (asalkeld)
Changed in heat:
assignee: nobody → Angus Salkeld (asalkeld)
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/52795
Committed: http://github.com/openstack/heat/commit/a5e156f44b9e8d1be65b0bd6cdb9a8990f531e86
Submitter: Jenkins
Branch: master

commit a5e156f44b9e8d1be65b0bd6cdb9a8990f531e86
Author: Angus Salkeld <email address hidden>
Date: Sat Oct 19 12:04:04 2013 -1000

    Add a test for TimeoutInMinutes accepting a str int

    The nested stack resource should accept a number as a string
    for TimeoutInMinutes.
    The actual fix has been fixed by: https://review.openstack.org/#/c/52564/
    but this just proves it.

    Change-Id: I769a34eb536177b405a585158df383bbd3021cf9
    Partial-bug: #1240903

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

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/56835

Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Alan Pevec (apevec)
tags: removed: havana-backport-potential
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-1 → 2014.1
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.