Action mistral.environments_get cannot handle more than one publish

Bug #1821180 reported by Martin Mágr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Incomplete
Medium
Renat Akhmerov

Bug Description

During testing [1] I've discovered weird behaviour, that the action freezes when there are more than <% task().result.variables.whatever %> statements in publish. If I comment any of those two, update workbook and run it, the get_database_credentials pass to next action. However in the implementation as is currently in [1], it always fails with:

+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | 41ba5fe0-a4ee-414b-9e4c-7ee8009fc234 |
| Workflow ID | 3b22ad9a-b3ca-4290-b3df-91b740838719 |
| Workflow name | tripleo.undercloud_backup.v1.backup |
| Workflow namespace | |
| Description | |
| Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | ERROR |
| State info | Failed to handle action completion [error=Can not evaluate YAQL expression [expression=task().result, error=Task execution not found [id=57457668-705e-4164-bee4-8bb7560dbfd8], data={}], wf=tripleo.undercloud_backup.v1.backup, task=get_database_credentials, action=mistral.environments_get]: |
| | Traceback (most recent call last): |
| | File "/usr/lib/python2.7/site-packages/mistral/engine/task_handler.py", line 113, in _on_action_complete |
| | task.on_action_complete(action_ex) |
| | File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 160, in wrapper |
| | result = f(*args, **kwargs) |
| | File "/usr/lib/python2.7/site-packages/mistral/engine/tasks.py", line 444, in on_action_complete |
| | self.complete(state, state_info) |
| | File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 160, in wrapper |
| | result = f(*args, **kwargs) |
| | File "/usr/lib/python2.7/site-packages/mistral/engine/tasks.py", line 248, in complete |
| | data_flow.publish_variables(self.task_ex, self.task_spec) |
| | File "/usr/lib/python2.7/site-packages/mistral/workflow/data_flow.py", line 215, in publish_variables |
| | task_ex.published = expr.evaluate_recursively(branch_vars, expr_ctx) |
| | File "/usr/lib/python2.7/site-packages/mistral/expressions/__init__.py", line 100, in evaluate_recursively |
| | data[key] = _evaluate_item(data[key], context) |
| | File "/usr/lib/python2.7/site-packages/mistral/expressions/__init__.py", line 79, in _evaluate_item |
| | return evaluate(item, context) |
| | File "/usr/lib/python2.7/site-packages/mistral/expressions/__init__.py", line 71, in evaluate |
| | return evaluator.evaluate(expression, context) |
| | File "/usr/lib/python2.7/site-packages/mistral/expressions/yaql_expression.py", line 159, in evaluate |
| | cls).evaluate(trim_expr, data_context) |
| | File "/usr/lib/python2.7/site-packages/mistral/expressions/yaql_expression.py", line 113, in evaluate |
| | ", data=%s]" % (expression, str(e), data_context) |
| | YaqlEvaluationException: Can not evaluate YAQL expression [expression=task().result, error=Task execution not found [id=57457668-705e-4164-bee4-8bb7560dbfd8], data={}] |
| | |
| Created at | 2019-03-21 12:08:19 |
| Updated at | 2019-03-21 12:13:29 |
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

[1] https://review.openstack.org/#/c/640344/2/workbooks/undercloud_backup.yaml

Revision history for this message
Martin Mágr (mmagr) wrote :
Download full text (10.4 KiB)

When db_host is commented in publish, the worflow obviously fails on next action with:

(undercloud) [stack@undercloud ~]$ mistral execution-get d7cc2fab-2c53-4527-b835-5352b23a16ac
+--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | d7cc2fab-2c53-4527-b835-5352b23a16ac |
| Workflow ID | 3b22ad9a-b3ca-4290-b3df-91b740838719 |
| Workflow name | tripleo.undercloud_backup.v1.backup |
| Workflow namespace | |
| Description | |
| Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | ERROR |
| State info | Failed to run task [error=Can not evaluate YAQL expression [expression=$.undercloud_db_host, error=u'undercloud_db_host', data={}], wf=tripleo.undercloud_backup.v1.backup, task=create_database_backup]: |
| | Traceback (most recent call last): |
| | File "/usr/lib/python2.7/site-packages/mis...

Revision history for this message
Martin Mágr (mmagr) wrote :
Download full text (10.6 KiB)

And when db_password is commented it fails with:

+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | 33c2a7ba-b7c2-4087-b997-904c5b0d7feb |
| Workflow ID | 3b22ad9a-b3ca-4290-b3df-91b740838719 |
| Workflow name | tripleo.undercloud_backup.v1.backup |
| Workflow namespace | |
| Description | |
| Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | ERROR |
| State info | Failed to run task [error=Can not evaluate YAQL expression [expression=$.undercloud_db_password, error=u'undercloud_db_password', data={}], wf=tripleo.undercloud_backup.v1.backup, task=create_database_backup]: |
| | Traceback (most recent call last): |
| | File "/usr/lib/python2.7/site-packages/mistral/engine/task_handler.py"...

Changed in mistral:
status: New → Triaged
importance: Undecided → Medium
Changed in mistral:
assignee: nobody → Renat Akhmerov (rakhmerov)
milestone: none → train-1
Revision history for this message
Renat Akhmerov (rakhmerov) wrote :

hi, is it still relevant? Can you provide a simple example to reproduce this?

Also, what version of Mistral does it apply to? We've made a number of fixes related to expressions in the recent months so it might have been fixed.

Thanks

Changed in mistral:
status: Triaged → Incomplete
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.