Problem auth st2 when resume workflow from another workflow or webhook


(ivan) #1

Hi, I have a mistral workflow in pause and I want resume from another workflow with:

st2 execute resume “ID_workflow” -t “token”

but the ouput is

ERROR: 401 Client Error: Unauthorized
MESSAGE: Unauthorized - One of Token or API key required. for url: http://st2api:9101/executions/5bf2d5b8b2efc800159997f8

The token its ok becouse when i use the following command works fine:

st2 execution list -t token

I tried use a webhook but get the same problem, so the question is how to resume workflow with another workflow or webhook?


(Lindsay Hill) #2

What does your workflow YAML look like? My first guess is that you’re not passing the token properly.


(ivan) #3

Hi, I tried with command st2 execute resume “workflow_id” -t “token” and get the same problem but not if I use st2 execute list -t “token”.
For now my solution is put credentials in /root/.st2/config


(Lindsay Hill) #4

What does your workflow YAML look like?


(ivan) #5

Hi, now I put credentiales st2 in /root/.st2/config becouse the command st2 execution resume “workflow_id” -t “token” isn’t working for me.

Now:
-
name: “obtener_workflowid”
ref: “core.local_sudo”
parameters:
cmd: “cat /opt/stackstorm/packs/default/event_workflow_id/{{message2}}”
on-success: “reanudar_workflow”

    - 
        name: "reanudar_workflow"
        ref: "core.local_sudo"
        parameters:
            cmd: "st2 execution resume {{obtener_workflowid.stdout}}"

Before:
-
name: “reanudar_workflow”
ref: “core.local_sudo”
parameters:
cmd: “st2 execution resume {{obtener_workflowid.stdout}} -t {{token}}”

In this case I check why failed the workflow with commando st2 execution get workflowid and the error is permission deny for execute st2 execution resume.