workflow execution stuck in running when description is null

Bug #1711423 reported by Michal Gershenzon
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Hardik Jasani

Bug Description

To reproduce create a workflow and run it via API with a "null" description. Execution will get stuck in running.

Example of a call on an server with auth_enable set to false:

curl --request POST --url http://localhost:8989/v2/executions --header 'content-type: application/json' --data '{"workflow_name": "wf", "description": null}'

Exception from the logs:
2017-08-17 17:24:58.863 2578 INFO workflow_trace [req-7388058b-0d43-4ea6-b38f-dedd5c1f7812 - - - - -] Workflow 'wf' [RUNNING -> SUCCESS, msg=None] (execution_id=a26623af-b562-4a78-9f82-e31c8807cf37)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler [req-7388058b-0d43-4ea6-b38f-dedd5c1f7812 - - - - -] Delayed call failed, method: <function _check_and_complete at 0x7f2024d41de8>, exception: expected string or buffer: TypeError: expected string or buffer
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler Traceback (most recent call last):
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/opt/stack/mistral/mistral/services/scheduler.py", line 181, in run_delayed_calls
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler target_method(**method_args)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 153, in wrapper
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler return f(*args, **kwargs)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/opt/stack/mistral/mistral/engine/workflow_handler.py", line 97, in _check_and_complete
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler incomplete_tasks_count = wf.check_and_complete()
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 153, in wrapper
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler return f(*args, **kwargs)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/opt/stack/mistral/mistral/engine/workflows.py", line 377, in check_and_complete
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler self._succeed_workflow(ctx)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/opt/stack/mistral/mistral/engine/workflows.py", line 393, in _succeed_workflow
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler self.set_state(states.SUCCESS, msg)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 153, in wrapper
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler return f(*args, **kwargs)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/opt/stack/mistral/mistral/engine/workflows.py", line 328, in set_state
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler triggers.on_workflow_complete(self.wf_ex)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/opt/stack/mistral/mistral/services/triggers.py", line 237, in on_workflow_complete
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler description = json.loads(wf_ex.description)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler return _default_decoder.decode(s)
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2017-08-17 17:24:58.866 2578 ERROR mistral.services.scheduler TypeError: expected string or buffer

Changed in mistral:
assignee: nobody → noa (noa-koffman)
milestone: none → queens-1
importance: Undecided → Medium
Changed in mistral:
milestone: queens-1 → queens-2
Changed in mistral:
milestone: queens-2 → queens-3
Changed in mistral:
assignee: noa (noa-koffman) → Hardik Jasani (hjasani)
Changed in mistral:
milestone: queens-3 → queens-rc1
Changed in mistral:
milestone: queens-rc1 → queens-rc2
Changed in mistral:
milestone: queens-rc2 → rocky-1
Revision history for this message
Hardik Jasani (hjasani) wrote :

Not reproducible. Server with auth_enable=false. Marking as Invalid.

curl -s --request POST --url http://localhost:8989/v2/executions --header 'content-type: application/json' --data '{"workflow_name": "wfx1", "description": null}' | jq

{
  "root_execution_id": null,
  "state_info": null,
  "description": null,
  "state": "RUNNING",
  "workflow_name": "wfx1",
  "task_execution_id": null,
  "updated_at": "2018-03-28 08:58:20",
  "workflow_id": "f97584fa-6bd9-4911-beb0-1fd2c4dbc6d4",
  "params": "{\"namespace\": \"\"}",
  "workflow_namespace": "",
  "output": "{}",
  "input": "{}",
  "created_at": "2018-03-28 08:58:20",
  "project_id": "<default-project>",
  "id": "67017220-edb7-4508-b884-160441054e0c"
}

Changed in mistral:
status: New → Invalid
Hardik Jasani (hjasani)
Changed in mistral:
status: Invalid → Confirmed
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.openstack.org/557336

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/557336
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=95f412ad309f6c56a83be600ca8757aa5441bfc7
Submitter: Zuul
Branch: master

commit 95f412ad309f6c56a83be600ca8757aa5441bfc7
Author: hardikj <email address hidden>
Date: Wed Mar 28 18:16:48 2018 +0530

    Fix WF execution getting stuck on null description

    Fix bug where creating wf execution with null description
    marks workflow as RUNNING even if all tasks are complete.

    Change-Id: If53012a41f6481c88fef44a43a1f17738d558f02
    Closes-bug: #1711423

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 7.0.0.0b1

This issue was fixed in the openstack/mistral 7.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.