Property errors in implicit dependencies cause unhelpful error messages

Bug #1708209 reported by Zane Bitter on 2017-08-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Zane Bitter

Bug Description

Normally if there's an error in the property values supplied to a resource, then we'll get that error reported when we validate the resource - along with the proper context to tell us where exactly the error occurred. However, if we access the properties of a resource *before* it is validated, we won't get any of this context when an error occurs. We sometimes do this when calculating implicit dependencies. Here's an example (in Newton):

Unexpected error occurred serving API: Property network not
Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/", line 133, in _process_incoming
    res = self.dispatcher.dispatch(message)

  File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/", line 150, in dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/", line 121, in _do_dispatch
    result = func(ctxt, **new_args)

  File "/usr/lib/python2.7/site-packages/osprofiler/", line 154, in wrapper [231/1987]
    return f(*args, **kwargs)

  File "/usr/lib/python2.7/site-packages/heat/common/", line 424, in wrapped
    return func(self, ctx, *args, **kwargs)

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 802, in create_stack

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 701, in _parse_template_and_validate_stack

  File "/usr/lib/python2.7/site-packages/osprofiler/", line 154, in wrapper
    return f(*args, **kwargs)

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 817, in validate
    iter_rsc = self.dependencies

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 399, in dependencies is not None)

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 477, in _get_dependencies

  File "/usr/lib/python2.7/site-packages/heat/engine/resources/openstack/nova/", line 1088, in add_dependencies
    subnet_net =

  File "/usr/lib64/python2.7/", line 363, in get
    return self[key]

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 471, in __getitem__
    return self._get_property_value(key)

  File "/usr/lib/python2.7/site-packages/heat/engine/", line 468, in _get_property_value
    raise ValueError(_('Property %s not assigned') % key)

ValueError: Property network not assigned

The problem was an OS::Neutron::Subnet resource that didn't have a 'network' property, but you'd never have known that from the error message, which just said "ERROR: Property network not assigned"

Fix proposed to branch: master

Changed in heat:
status: Triaged → In Progress
Rabi Mishra (rabi) on 2017-08-12
Changed in heat:
milestone: pike-rc1 → pike-rc2
Rico Lin (rico-lin) on 2017-08-22
Changed in heat:
milestone: pike-rc2 → queens-1
Rico Lin (rico-lin) on 2017-10-25
Changed in heat:
milestone: queens-1 → queens-2
Rico Lin (rico-lin) on 2017-12-06
Changed in heat:
milestone: queens-2 → queens-3
Rico Lin (rico-lin) on 2018-01-29
Changed in heat:
milestone: queens-3 → queens-rc1
Rico Lin (rico-lin) on 2018-02-09
Changed in heat:
milestone: queens-rc1 → rocky-1
Rico Lin (rico-lin) on 2018-04-20
Changed in heat:
milestone: rocky-1 → rocky-2

Submitter: Zuul
Branch: master

commit b50df6b1fc460c7427dacb13ee9e6e41ec63eb22
Author: Zane Bitter <email address hidden>
Date: Wed Aug 2 14:12:12 2017 -0400

    Ignore property errors in implicit dependencies

    Implicit dependencies are calculated before resources are validated.
    Therefore, any error getting a property that occurs during processing on
    implicit dependencies will be raised without any of the context of which
    resource is in error. By ignoring such property errors in implicit
    dependency calculations, we can defer the error handling until the
    actual resource validation and thus give the user an error message they
    can actually use.

    Change-Id: If7e0e8fd46b1b06a29cdd89743635ed32a9392e7
    Closes-Bug: #1708209

Changed in heat:
status: In Progress → Fix Released

Submitter: Zuul
Branch: master

commit 4979b06bb4ce60620fba37003c287b6ab2e2eb02
Author: Zane Bitter <email address hidden>
Date: Wed Aug 2 14:49:22 2017 -0400

    Add catch-all for property errors in implicit dependencies

    The previous patch ensures that we ignore errors getting properties in
    all extant add_dependencies() methods for calculating implicit
    dependencies. To guard against similar errors in future, also ignore and
    log any uncaught ValueError or TypeError exceptions encountered during
    implicit dependency calculation.

    Change-Id: I2cac0add975e36a9c52b9cbb50f0660882322754
    Related-Bug: #1708209

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

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers