Failed to add implicit dependency with external resource

Bug #1767149 reported by Rico Lin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
In Progress
Medium
Rico Lin

Bug Description

When validating new resource, we didn't avoid with adding implicit dependencies, some neutron/nova resource will fail if we happen to set external_id on other resources which it happens to check implicit dependency with.

For example if we try following template:

heat_template_version: queens

resources:
  router2:
    type: OS::Neutron::Router
    properties:
      external_gateway_info:
        network: 3fc38ae8-c5b8-451e-8430-7ea153e31af2

  ext_sub:
    type: OS::Neutron::Subnet
    external_id: 150514e8-228c-43de-b128-7f6e68b8e414

You will get following error log.
It failed because we try to find implicit dependencies during validate(and again during create/update), and the finding process try to use properties to validate the dependancy which external resource didn't provide. Therefore if failed.

DEBUG heat.engine.parameter_groups [None req-ddb54159-dc2d-4c3b-8778-8957de82b99c admin None] Validating Parameter Groups: OS::project_id, OS::stack_id {{(pid=7275) validate /opt/stack/heat/heat/engine/parameter_groups.py:42}}
ERROR oslo_messaging.rpc.server [None req-ddb54159-dc2d-4c3b-8778-8957de82b99c admin None] Exception during message handling: ValueError: Property network not assigned
ERROR oslo_messaging.rpc.server Traceback (most recent call last):
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch
ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch
ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 158, in wrapper
ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/common/context.py", line 409, in wrapped
ERROR oslo_messaging.rpc.server return func(self, ctx, *args, **kwargs)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/service.py", line 793, in create_stack
ERROR oslo_messaging.rpc.server template_id)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/service.py", line 701, in _parse_template_and_validate_stack
ERROR oslo_messaging.rpc.server stack.validate()
ERROR oslo_messaging.rpc.server File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 158, in wrapper
ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/stack.py", line 872, in validate
ERROR oslo_messaging.rpc.server iter_rsc = self.dependencies
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/stack.py", line 429, in dependencies
ERROR oslo_messaging.rpc.server ignore_errors=self.id is not None)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/stack.py", line 515, in _add_implicit_dependencies
ERROR oslo_messaging.rpc.server res.add_dependencies(deps)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/resources/openstack/neutron/router.py", line 268, in add_dependencies
ERROR oslo_messaging.rpc.server subnet_net = res.properties.get(subnet.Subnet.NETWORK)
ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/_abcoll.py", line 382, in get
ERROR oslo_messaging.rpc.server return self[key]
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/properties.py", line 510, in __getitem__
ERROR oslo_messaging.rpc.server return self._get_property_value(key)
ERROR oslo_messaging.rpc.server File "/opt/stack/heat/heat/engine/properties.py", line 502, in _get_property_value
ERROR oslo_messaging.rpc.server raise ValueError(_('Property %s not assigned') % key)
ERROR oslo_messaging.rpc.server ValueError: Property network not assigned
ERROR oslo_messaging.rpc.server

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/564547

Changed in heat:
status: Triaged → In Progress
Revision history for this message
Zane Bitter (zaneb) wrote :

Do we know which resources and how/why they fail?

Revision history for this message
Rico Lin (rico-lin) wrote :

I update the error message in desc now

description: updated
Rico Lin (rico-lin)
description: updated
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.