Non standard {Role}NetworkDeploymentActions results in GetOvercloudConfig action failing with ERROR: None

Bug #1812604 reported by Rabi Mishra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Rabi Mishra

Bug Description

Heat does not validation deployment 'actions' in a nested stack. It's possible to provide a role specific (non-standard) NetworkDeploymentActions that would result in heat deployments without resource_id and overcloud deploy would fail.

Here is an example stack trace that we find:
{"message": "The resource could not be found.<br /><br />\n\n\n", "code": "404 Not Found", "title": "Not Found"}
 log_http_response /usr/lib/python2.7/site-packages/heatclient/common/http.py:157
2019-01-16 10:35:17.418 1 WARNING mistral.executors.default_executor [req-36f0f06d-5ce3-4de2-820c-8481b43409e7 6612b704f7a34876b5799e29298021bd 0254bbcb255d445083b5b16db74011e8 - default default] The action raised an exception [action_ex_id=f25ce5c2-61cf-4bc4-b817-006574c70802, action_cls='<class 'mistral.actions.action_factory.GetOvercloudConfig'>', attributes='{}', params='{u'container_config': u'overcloud-config', u'container': u'overcloud'}']
 ERROR: None: HTTPNotFound: ERROR: None
ERROR mistral.executors.default_executor Traceback (most recent call last):
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/mistral/executors/default_executor.py", line 114, in run_action
ERROR mistral.executors.default_executor result = action.run(action_ctx)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/tripleo_common/actions/config.py", line 87, in run
ERROR mistral.executors.default_executor commit_message=message)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/tripleo_common/utils/config.py", line 465, in download_config
ERROR mistral.executors.default_executor self.write_config(stack, name, config_dir, config_type)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/tripleo_common/utils/config.py", line 273, in write_config
ERROR mistral.executors.default_executor config_dict = self.get_config_dict(deployment)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/tripleo_common/utils/config.py", line 86, in get_config_dict
ERROR mistral.executors.default_executor deployment_resource_id)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/heatclient/v1/software_deployments.py", line 57, in get
ERROR mistral.executors.default_executor resp = self.client.get('/software_deployments/%s' % deployment_id)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 289, in get
ERROR mistral.executors.default_executor return self.client_request("GET", url, **kwargs)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 282, in client_request
ERROR mistral.executors.default_executor resp, body = self.json_request(method, url, **kwargs)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 271, in json_request
ERROR mistral.executors.default_executor resp = self._http_request(url, method, **kwargs)
ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 234, in _http_request
ERROR mistral.executors.default_executor raise exc.from_response(resp)
ERROR mistral.executors.default_executor HTTPNotFound: ERROR: None
ERROR mistral.executors.default_executor

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/632011

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-common (stable/rocky)

Change abandoned by Rabi Mishra (<email address hidden>) on branch: stable/rocky
Review: https://review.openstack.org/632011

Changed in tripleo:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/632023

Changed in tripleo:
milestone: none → stein-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/632023
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=54c448f68354d48df49ca83a71932938e9c84810
Submitter: Zuul
Branch: master

commit 54c448f68354d48df49ca83a71932938e9c84810
Author: Rabi Mishra <email address hidden>
Date: Fri Jan 18 22:21:03 2019 +0530

    Check for physical_resource_id before getting deployments

    Heat does non-strict validation of nested stack resources.
    Most constraints are not enforced for nested stack resources
    It's possible to set {Role}DeploymentActions as something like
    [''] and it would not fail in validation. This would result in
    a deployment resource with no physical_resource_id. The existing
    check[1] for config-download would not be sufficient for some
    cases as it can be another nested stack (we alias
    both OS::Tripleo::SoftwareDeployment and
    OS::Heat::StructuredDeployment).

    [1]
    deployment.attributes['value'].get('deployment') == \
         'TripleOSoftwareDeployment'

    This adds a new check not to try and download heat deployments with
    no physical_resource_id.

    Change-Id: I234e629cc5377cda8d5d01bfe4416ad967cdc067
    Closes-Bug: #1812604

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/rocky)

Reviewed: https://review.openstack.org/632011
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=9b3e9b2c45e3d694e46505eb5179e6cbb8cb6a96
Submitter: Zuul
Branch: stable/rocky

commit 9b3e9b2c45e3d694e46505eb5179e6cbb8cb6a96
Author: Rabi Mishra <email address hidden>
Date: Fri Jan 18 22:21:03 2019 +0530

    Check for physical_resource_id before getting deployments

    Heat does non-strict validation of nested stack resources.
    Most constraints are not enforced for nested stack resources
    It's possible to set {Role}DeploymentActions as something like
    [''] and it would not fail in validation. This would result in
    a deployment resource with no physical_resource_id. The existing
    check[1] for config-download would not be sufficient for some
    cases as it can be another nested stack (we alias
    both OS::Tripleo::SoftwareDeployment and
    OS::Heat::StructuredDeployment).

    [1]
    deployment.attributes['value'].get('deployment') == \
         'TripleOSoftwareDeployment'

    This adds a new check not to try and download heat deployments with
    no physical_resource_id.

    Change-Id: I234e629cc5377cda8d5d01bfe4416ad967cdc067
    Closes-Bug: #1812604
    (cherry picked from commit 54c448f68354d48df49ca83a71932938e9c84810)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 10.4.0

This issue was fixed in the openstack/tripleo-common 10.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 9.5.0

This issue was fixed in the openstack/tripleo-common 9.5.0 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.