Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot re-run orquesta workflow with --task on a with items task that has succeeded #5016

Open
amanda11 opened this issue Aug 7, 2020 · 4 comments

Comments

@amanda11
Copy link
Contributor

amanda11 commented Aug 7, 2020

SUMMARY

If I have an orquesta workflow with a with items task, then I cannot use execution re-run and name the with-items task in the --task field if all of those tasks have passed. If I use a task that isn't a with items task, then the re-run works fine.
The documentation for orquesta refers to re-runs with with-items, and there is a unit-test in orquesta repo for it - https://github.com/StackStorm/orquesta/blob/master/orquesta/tests/unit/conducting/test_workflow_conductor_with_items_pause_and_resume.py.
However if I attempt to re-run using the st2 execution re-run command then I get a failure.

result: 
  errors:
  - message: '''NoneType'' object has no attribute ''get'''
  output: null

STACKSTORM VERSION

st2 3.3dev (397e2f7), on Python 2.7.5

OS, environment, install method

CentOS7 standalone. One line install of 3.3.0, and upgrade to 3.3dev

Steps to reproduce the problem

  1. Create orquesta workflow with a simple task and a with items task,e .g.
version: 1.0

vars:
  - xs:
      - fee
      - fi
      - fo
      - fum
tasks:
  task1:
    with: <% ctx(xs) %>
    action: core.echo message=<% item() %>
    next:
      - when: <% succeeded() %>
        do: task2
  task2:
    action: core.noop
  1. In the UI run that workflow

  2. re-run the execution using --task task2 -> result re-run is fine

  3. re-run the execution using --task task1 -> get error indicating '''NoneType'' object has no attribute ''get'''

Expected Results

To be able to re-run the with-items task.

Actual Results

[centos@centos-7-test actions]$ st2 execution re-run 5f2d76d82efa012f1f6f603f --task task2
.
id: 5f2d76f02efa012f1f6f6042
action.ref: examples.amanda
parameters: None
status: succeeded
start_timestamp: Fri, 07 Aug 2020 15:44:48 UTC
end_timestamp: Fri, 07 Aug 2020 15:44:49 UTC
result: 
  output: null
+--------------------------+------------------------+-------+-----------+-----------------+
| id                       | status                 | task  | action    | start_timestamp |
+--------------------------+------------------------+-------+-----------+-----------------+
| 5f2d76f179debc2e8dac24b4 | succeeded (0s elapsed) | task2 | core.noop | Fri, 07 Aug     |
|                          |                        |       |           | 2020 15:44:49   |
|                          |                        |       |           | UTC             |
+--------------------------+------------------------+-------+-----------+-----------------+
[centos@centos-7-test actions]$ st2 execution re-run 5f2d76d82efa012f1f6f603f --task task1
.
id: 5f2d76f42efa012f1f6f6044
action.ref: examples.amanda
parameters: None
status: failed
start_timestamp: Fri, 07 Aug 2020 15:44:52 UTC
end_timestamp: Fri, 07 Aug 2020 15:44:53 UTC
result: 
  errors:
  - message: '''NoneType'' object has no attribute ''get'''
  output: null

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

@amanda11
Copy link
Contributor Author

amanda11 commented Aug 7, 2020

Only thing in log I can see in the action.log
2020-08-07 15:57:41,078 140266355055664 WARNING workflow [-] Determining if exception <class 'st2common.exceptions.workflow.WorkflowExecutionRerunException'> should be retried.

Putting on debug.

@amanda11
Copy link
Contributor Author

amanda11 commented Aug 7, 2020

Adding extra debug found where exception is raised:

Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/services/workflows.py", line 521, in request_rerun
    conductor.request_workflow_rerun(task_requests=task_requests)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/orquesta/conducting.py", line 1266, in request_workflow_rerun
    self._request_task_rerun(task['id'], task['route'], reset_items=reset_items)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/orquesta/conducting.py", line 1181, in _request_task_rerun
    for item in staged_task.get('items', []):
AttributeError: 'NoneType' object has no attribute 'get'

@amanda11 amanda11 changed the title Cannot re-run orquesta workflow with --task as a with items task Cannot re-run orquesta workflow with --task on a with items task that has succeeded Aug 7, 2020
@amanda11
Copy link
Contributor Author

amanda11 commented Aug 7, 2020

Updated description, as it appears it is only if the with-items task all completed, then we get the error.
Re-ran when all the task1 had all failed, and then the re-run --task task1 re-ran all the tasks.

@amanda11
Copy link
Contributor Author

amanda11 commented Aug 7, 2020

Confirmed that its only if every instance of the sub-task had passed, that the re-run fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants