"Items to join must be strings" - Intrinsic functions resolve before get_input in StructuredConfig resource

Bug #1344284 reported by Robert Collins
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Opinion
Medium
Unassigned

Bug Description

Trying to use Fn::Join with a software deployment using get_input -

Fn::Join:
 - ':'
 - - get_input: foo
   - "bar"

errors on stack-update, showing "Items to join must be strings"

https://review.openstack.org/108135 let me see what errors which is this:

 Items to join must be strings {u'get_input': u'controller_host'}

which can't be resolved by function.resolve as its not a function :).

Raising the log level on the server let me see this: (btw - shouldn't need to do that :/)

2014-07-18 10:40:52.282 20240 ERROR heat.engine.parser [req-8a28db27-f5ef-4df0-960a-36d562977414 None] Property error : SSLConfig: config Items to join must be strings
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser Traceback (most recent call last):
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/parser.py", line 418, in validate
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser result = res.validate()
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/resource.py", line 640, in validate
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser return self.properties.validate()
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/properties.py", line 322, in validate
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser raise exception.StackValidationFailed(message=msg)
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser StackValidationFailed: Property error : SSLConfig: config Items to join must be strings
2014-07-18 10:40:52.282 20240 TRACE heat.engine.parser

Tags: tripleo
Revision history for this message
Robert Collins (lifeless) wrote :

So it looks to me like its trying to get the property value, but you can't do that in a late bound config, you can only check that the structure is right, no ?

Changed in heat:
importance: Undecided → High
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/108157

Changed in heat:
assignee: nobody → Clint Byrum (clint-fewbar)
status: Triaged → In Progress
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/108158

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Clint 'SpamapS' Byrum (<email address hidden>) on branch: master
Review: https://review.openstack.org/108158
Reason: This is not going to be possible.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

This is not even close to a simple problem to solve.

The software config object is managed outside of the stack. So any intrinsic functions will not have any access to the stack itself. This is by design to support encapsulation. However, we do need these intrinsic functions to be passed in so they can be used from within the config:.

I feel that this is not going to be possible without some deep thought.

So, the work around for TripleO will need to be to do concatenation of inputs in the o-a-c template, rather than in the Heat templates.

summary: - Items to join must be strings from a software config
+ "Items to join must be strings" - Intrinsic functions resolve before
+ get_input in StructuredConfig resource
Changed in heat:
status: In Progress → Triaged
importance: High → Medium
assignee: Clint Byrum (clint-fewbar) → nobody
Changed in heat:
assignee: nobody → Steve Baker (steve-stevebaker)
milestone: none → juno-3
Revision history for this message
Tomas Sedovic (tsedovic) wrote :

I'm having a similar issue with joining attributes of ResourceGroup's inner resources:

  servers:
    type: OS::Heat::ResourceGroup
    properties:
      count: 3
      resource_def:
        type: OS::Nova::Server
        properties:
          image: overcloud-compute
          flavor: baremetal

  allNodesConfig:
    type: OS::Heat::StructuredConfig
    properties:
      config:
        completion-signal:
          get_input: deploy_signal_id
        names:
          list_join:
          - ','
          - {get_attr: [servers, name]}

heat stack-create reports: ERROR: Property error : allNodesConfig: config "list_join" must operate on a list.

Revision history for this message
Zane Bitter (zaneb) wrote :

What Tomas is seeing looks like an unrelated error - presumably due to get_attr returning None.

Revision history for this message
Tomas Sedovic (tsedovic) wrote :

Looks like you're right, Zane. Filed a separate bug here: https://bugs.launchpad.net/heat/+bug/1358831

Thierry Carrez (ttx)
Changed in heat:
milestone: juno-3 → juno-rc1
Changed in heat:
milestone: juno-rc1 → kilo-1
Steven Hardy (shardy)
tags: added: tripleo
Changed in heat:
milestone: kilo-1 → kilo-2
Changed in heat:
milestone: kilo-2 → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Clint 'SpamapS' Byrum (<email address hidden>) on branch: master
Review: https://review.openstack.org/108157
Reason: ENOTIME

Angus Salkeld (asalkeld)
Changed in heat:
milestone: kilo-3 → liberty-1
Changed in heat:
milestone: liberty-1 → liberty-2
assignee: Steve Baker (steve-stevebaker) → nobody
Kent Wang (k.wang)
Changed in heat:
assignee: nobody → Kent Wang (k.wang)
Kent Wang (k.wang)
Changed in heat:
assignee: Kent Wang (k.wang) → nobody
Changed in heat:
milestone: liberty-2 → next
Changed in heat:
assignee: nobody → Sharat Sharma (sharat-sharma)
Changed in heat:
status: Triaged → In Progress
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/314986

Changed in heat:
milestone: next → newton-1
Rabi Mishra (rabi)
Changed in heat:
milestone: newton-1 → newton-2
Thomas Herve (therve)
Changed in heat:
milestone: newton-2 → newton-3
Thomas Herve (therve)
Changed in heat:
milestone: newton-3 → next
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Sharat Sharma (<email address hidden>) on branch: master
Review: https://review.openstack.org/314986

Changed in heat:
assignee: Sharat Sharma (sharat-sharma) → nobody
status: In Progress → New
Revision history for this message
Zane Bitter (zaneb) wrote :

Realistically, this is never going to get fixed. Intrinsic functions can only be evaluated in the context of the template (since they may mean different things in different template versions), but software configs are created by a separate API that is not associated with a template. As long as get_input looks like an intrinsic function, this is not fixable.

The only alternative would be some sort of string-based substitution format, carefully chosen not to conflict with any likely to appear in the config payload.

Changed in heat:
status: New → Opinion
milestone: next → ongoing
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.