StackStorm / StackStorm/st2

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

Open
#5,016 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug workflows: orquesta
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with st2 execution re-run ... --task task1 and compare it with the successful task2 run. Read the referenced orquesta/tests/unit/conducting/test_workflow_conductor_with_items_pause_and_resume.py test, then trace the re-run handling for completed with-items tasks; done means the command successfully re-runs task1 without the NoneType error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.