heat stack-update failure - ValueError: Incorrect arguments to "list_join" should be: "list_join" : [ " ", [ "str1", "str2"] ...]

Bug #1513060 reported by TonyWang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
huangtianhua
Liberty
Fix Released
High
huangtianhua

Bug Description

The heat version is Liberty.

I tried to create a Mistral workflow resource via heat in a nested stack:
  APPP_SCALE_OUT:
    type: OS::Mistral::Workflow
    properties:
      name: { "list_join": ["_", [ "scale_APP_for_stack", { get_param: "OS::stack_name" } ]] }
      type: direct
      input:
        stack_id: { get_param: "OS::stack_id" }
        stack_name: { get_param: "OS::stack_name" }
        tenant_id: { get_param: "OS::project_id" }
      output:
        result: <% $.scale_out_result %>
      tasks:
          ...

The stack was created successfully, but when I updated the stack, this nested stack was failed to update:
2015-11-04 05:21:34.278 144 INFO heat.engine.stack [-] Stack UPDATE IN_PROGRESS (vapp2-appP_1-73tsc4sxkmbx): Stack UPDATE started
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 457, in fire_timers
    timer()
  File "/usr/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line 117, in _start_with_trace
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/heat/engine/stack.py", line 974, in update
    updater()
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 174, in __call__
    self.run_to_completion(wait_time=wait_time)
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 230, in run_to_completion
    while not self.step():
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 217, in step
    next(self._runner)
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 320, in wrapper
    subtask = next(parent)
  File "/usr/lib/python2.7/site-packages/heat/engine/stack.py", line 1208, in update_task
    while not updater.step():
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 217, in step
    next(self._runner)
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 318, in wrapper
    subtask = parent.throw(*sys.exc_info())
  File "/usr/lib/python2.7/site-packages/heat/engine/update.py", line 66, in __call__
    yield self.updater()
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 309, in wrapper
    step = next(subtask)
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 394, in __call__
    raise_(exc_type, exc_val, traceback)
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 371, in __call__
    r.start()
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 194, in start
    self.step()
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 217, in step
    next(self._runner)
  File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 285, in wrapper
    subtask = next(parent)
  File "/usr/lib/python2.7/site-packages/heat/engine/update.py", line 145, in _process_new_resource_update
    new_res)
  File "/usr/lib/python2.7/site-packages/heat/engine/update.py", line 174, in _update_in_place
    self.new_stack.t)
  File "/usr/lib/python2.7/site-packages/heat/engine/rsrc_defn.py", line 137, in reparse
    properties=reparse_snippet(self._properties),
  File "/usr/lib/python2.7/site-packages/heat/engine/rsrc_defn.py", line 133, in reparse_snippet
    return template.parse(stack, copy.deepcopy(snippet))
  File "/usr/lib/python2.7/site-packages/heat/engine/template.py", line 220, in parse
    return parse(self.functions, stack, snippet)
  File "/usr/lib/python2.7/site-packages/heat/engine/template.py", line 289, in parse
    return dict((k, recurse(v)) for k, v in six.iteritems(snippet))
  File "/usr/lib/python2.7/site-packages/heat/engine/template.py", line 289, in <genexpr>
    return dict((k, recurse(v)) for k, v in six.iteritems(snippet))
  File "/usr/lib/python2.7/site-packages/heat/engine/template.py", line 288, in parse
    return Func(stack, fn_name, recurse(args))
  File "/usr/lib/python2.7/site-packages/heat/engine/hot/functions.py", line 390, in __init__
    'should be: %(example)s') % fmt_data)
ValueError: Incorrect arguments to "list_join" should be: "list_join" : [ " ", [ "str1", "str2"] ...]

This should be a common issue for heat.

Tags: heat
Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Revision history for this message
huangtianhua (huangtianhua) wrote :

I also met the problem, will look into this.

Changed in heat:
status: New → Confirmed
importance: Undecided → High
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/242408

Changed in heat:
status: Confirmed → In Progress
Steven Hardy (shardy)
Changed in heat:
milestone: none → mitaka-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit db11ae6d42cd0ea7e2e1d104269067e85cc88e25
Author: huangtianhua <email address hidden>
Date: Fri Nov 6 17:15:25 2015 +0800

    Correct list_join function

    Heat supports 'list_join' function to join one or more
    lists of strings in Liberty release. But when we resolve
    the function, we pop some arguments, this introduced
    errors if resolve the snippet again when updating a resource.

    This patch correct the behavior of 'list_join' function,
    also refactor some codes for the functions of Kilo/Liberty.

    Change-Id: Ia67a0171261ca1a864fe11f7d61c3bf5ef801040
    Closes-Bug: #1513060

Changed in heat:
status: In Progress → Fix Committed
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/246072

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b1

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

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

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

commit 209eb58030d9371d2a26ffa8f9549e9bce4d93bf
Author: huangtianhua <email address hidden>
Date: Fri Nov 6 17:15:25 2015 +0800

    Correct list_join function

    Heat supports 'list_join' function to join one or more
    lists of strings in Liberty release. But when we resolve
    the function, we pop some arguments, this introduced
    errors if resolve the snippet again when updating a resource.

    This patch correct the behavior of 'list_join' function,
    also refactor some codes for the functions of Kilo/Liberty.

    Change-Id: Ia67a0171261ca1a864fe11f7d61c3bf5ef801040
    Closes-Bug: #1513060
    (cherry picked from commit db11ae6d42cd0ea7e2e1d104269067e85cc88e25)

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

This issue was fixed in the openstack/heat 5.0.1 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.