Git Product home page Git Product logo

Comments (4)

amanda11 avatar amanda11 commented on July 20, 2024

I have reproduced the same problem on a single node 3.3.0 version of StackStorm running on CentOS 8 which is configured with redis.

If I use a workflow such as:


version: 1.0
tasks:
  # [536, 116]
  task1:
    action: core.echo
    next:
      - do:
          - task2
      - do:
          - task3
    input:
      message: start
  # [391, 251]
  task2:
    action: core.local
    next:
      - do:
          - task4
    input:
      cmd: ls
  # [765, 275]
  task3:
    action: core.local
    next:
      - do:
          - task4
        when: <% failed() %>
    input:
      cmd: ls /rubbish
  # [550, 436]
  task4:
    action: core.echo
    join: all
    input:
      message: joined

then it can fail on the join with the same error about partially satisified. Sometimes it passes, sometimes it fails.

However if I alter the workflow to add in a dummy task before the join then it works (which is the same workaround performed in #190), e.g. by adding a task5 after the task that fails but on that same branch, then the join works.

version: 1.0
tasks:
  # [536, 116]
  task1:
    action: core.echo
    next:
      - do:
          - task2
      - do:
          - task3
    input:
      message: start
  # [391, 251]
  task2:
    action: core.local
    next:
      - do:
          - task4
    input:
      cmd: ls
  # [765, 275]
  task3:
    action: core.local
    next:
      - do:
          - task5
        when: <% failed() %>
    input:
      cmd: ls /rubbish
  # [550, 436]
  task4:
    action: core.echo
    join: all
    input:
      message: joined
  # [773, 371]
  task5:
    action: core.echo
    next:
      - do:
          - task4
    input:
      message: hello

from orquesta.

wingiti avatar wingiti commented on July 20, 2024

I was not able to implement the workaround successful. I changed my workflow like following, to implement an intermediate task called "Workaround"


description: Test for GIT BUG

input:
  - ip: "127.0.0.1"
  - mac_address: "0"
  - dns_hostname: "test.testad.net"

vars:
  - mac_vendor: "DEFAULT-VALUE"
  - a_some_info: "unkown"
  - reverse_lookup_result: null
  - forward_lookup_result: null

tasks:
  Reverse_lookup:
    action: core.local
    input:
      cmd: "nslookup <% ctx().ip %>"
    next:
      - when: <% completed() %>
        publish:
          - reverse_lookup_result: <% result().stdout %>
        do:
          - Add_host_info_note

  Forward_lookup:
    action: core.local
    input:
      cmd: "dig <% ctx().dns_hostname %>"
    next:
      - when: <% completed() %>
        publish:
          - forward_lookup_result: <% result().stdout %>
        do:
          - Add_host_info_note

  MAC_vendor_lookup:
    action: core.http
    input:
      url: "https://api.macvendors.com/<% ctx().mac_address %>"
      method: "GET"
    next:
      - when: <% succeeded() %>
        publish:
          - mac_vendor: <% result().body %>
        do:
          - Workaround
      - when: <% failed() %>
        publish:
          - mac_vendor: "-"
        do:
          - Workaround

  Do_something_else:
    action: core.echo message="Test"
    next:
      - when: <% completed() %>
        publish:
          - a_some_info: <% result().stdout %>
        do:
          - Add_more_info

  Workaround:
    action: core.noop
    next:
      - when: <% succeeded() %>
        do:
          - Add_host_info_note
          
  Add_host_info_note:
    join: all
    action: core.echo message="<% ctx().reverse_lookup_result %> <% ctx().forward_lookup_result %> <% ctx().mac_vendor %>


  Add_more_info:
    action: core.echo message=<% ctx().a_some_info %>

If I execute it, I get the following error:

{
      "spec_path": "tasks.Add_host_info_note",
      "message": "The join task \"Add_host_info_note\" is unreachable. A join task is determined to be unreachable if there are nested forks from multi-referenced tasks that join on the said task. This is ambiguous to the workflow engine because it does not know at which level should the join occurs.",
      "type": "semantic",
      "schema_path": "properties.tasks.patternProperties.^\\w+$"
    }

Looks like the difference in regards to your workflow is that the "do" section in your wfl is not part of the when block.
If I change my wfl like this:

MAC_vendor_lookup:
    action: core.http
    input:
      url: "https://api.macvendors.com/<% ctx().mac_address %>"
      method: "GET"
    next:
      - do:
          - Workaround
      - when: <% succeeded() %>
        publish:
          - mac_vendor: <% result().body %>
      - when: <% failed() %>
        publish:
          - mac_vendor: "-"

The workflow is now executed successful from a flow perspective but the value published in this task for mac_vendor is not visible/usable in the final step "Add_host_info_note". It has always the value given in "vars" section.

I can not confirm any successful workaround so far.

from orquesta.

amanda11 avatar amanda11 commented on July 20, 2024

With my simplified way but with the publish I got the conditional publishing working with some Jinja (you might be able to do it in YAQL). But I simplified it down to getting the equivaletn of your MAC_vendor_lookup have one transition to workaround but the conditional being in the publish value.

e..g I had:

   next:
      - do:
          - task5
        when: <% completed() %>
        publish:
          - mac_vendor: "{% if succeeded() %} {{ result().stdout }} {% else %} - {% endif %} "

So you might be able to use something like:

MAC_vendor_lookup:
    action: core.http
    input:
      url: "https://api.macvendors.com/<% ctx().mac_address %>"
      method: "GET"
   next:
      - do:
          - Workaround
        when: <% completed() %>
        publish:
          - mac_vendor: "{% if succeeded() %} {{ result().body }} {% else %} - {% endif %} "

from orquesta.

m4dcoder avatar m4dcoder commented on July 20, 2024

I am able to reproduce the issue. Thanks for reporting this. StackStorm v3.4 is getting set to be released. Should expect fix in v3.5.

from orquesta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.