Open shusugmt opened 6 years ago
fix pseudo code
parent = liveaction_db.context.get("parent")
if parent:
parent_execution = ActionExecution.get(id=parent['execution_id'])
parent_liveaction = LiveAction.get(id=parent_execution.liveaction['id'])
# Check parent liveaction status
if parent_liveaction.status != action_constants.LIVEACTION_STATUS_PAUSED:
# RFC: better error message
abort(http_client.BAD_REQUEST, 'Unable to resume liveaction "%s" because it is not in a paused state.' % parent_liveaction.id)
@kaishuu0123 This won't work since liveaction_db
is not accessible where the line this check logic should be brought into. I'm looking at here before https://github.com/StackStorm/st2/blob/master/st2api/st2api/controllers/exp/inquiries.py#L135
Seeing same issue are there any good workarounds currently? Would be of great help as we're seeing this happen across our wfs.
Noticed that wf will still be running and this is consistently reproduce able on workflows that were left pending/paused at the inquiry state for longer than 4 days.
Update turns out reason they arent resuming is due to the inquiry default timeout of 24 hours i will confirm it is working after timeout is changed
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.
ISSUE TYPE
STACKSTORM VERSION
OS / ENVIRONMENT / INSTALL METHOD
SUMMARY
I'm facing the issue that in the mistral workflow there is
core.ask
action, and when I respond that withst2 inquiry respond
too fast, the parent workflow state is sometimes still in pausing state (that means it is still transitioning from running to pause), and it fails to resume theparentroot workflow sayingERROR: 500 Server Error: Internal Server Error
but the inquiry itself is already in success state and you can't respond it again to resume theparententire workflow.The workaround is, wait 10 sec before you respond.I figured it out that this seems tp be just random. Sometimes the state of root workflow is set to paused properly, sometimes not and stuck in pausing. see #4138If you face the above error, you can just
st2 execution resume
to resume the parent workflow, but this apparently is not the desired situation.Relevant code: https://github.com/StackStorm/st2/blob/master/st2api/st2api/controllers/exp/inquiries.py#L174 https://github.com/StackStorm/st2/blob/master/st2common/st2common/services/action.py#L320
Here's the log: you can see that LiveAction id
5b02dcfc069c4301d1f654ca
was in pausing state when the inquiry respond was trying to resume it.