execution-update command doesn't work

Bug #1449557 reported by Anastasia Kuznetsova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Nikolay Makhotkin
Liberty
Fix Released
High
Nikolay Makhotkin

Bug Description

Steps to reproduce:
1. Create following workflow:
---
version: "2.0"
wf_main:
  tasks:
    invoke_wf:
      with-items:
       - i in [1,2,3,4,5,6,7,8,9]
      workflow: wf_work var="<% $.i %>"
      publish:
        res: <% $.invoke_wf %>

wf_work:
  input:
    - var
  output:
    var: <% $.echo %>
  tasks:
    echo:
      action: std.echo output=<% $.var %>

2. Execute "mistral execution-create wf_main"
3. Execute "mistral execution-update <exec_id> ERROR"

Observed result:
'module' object has no attribute 'DBError'
2015-04-28 13:09:03.939 2138 ERROR oslo_messaging._drivers.common [-] Returning exception (ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '} WHERE executions_v2.id = 'e48920ea-871e-4892-836c-ce9fa6c36c64'' at line 1") 'UPDATE executions_v2 SET updated_at=%s, state_info=%s WHERE executions_v2.id = %s' (datetime.datetime(2015, 4, 28, 13, 9, 3, 930547), {}, 'e48920ea-871e-4892-836c-ce9fa6c36c64')

NOTE:
Another scenario:
SUCCESS - > RUNNING
'NoneType' object has no attribute 'to_dict'
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py", line 82, in callfunction
    result = f(self, *args, **kwargs)

  File "/home/ubuntu/mistral/mistral/api/controllers/v2/execution.py", line 162, in put
    wf_ex if isinstance(wf_ex, dict) else wf_ex.to_dict()

AttributeError: 'NoneType' object has no attribute 'to_dict'

description: updated
Changed in mistral:
importance: Undecided → Low
importance: Low → High
Revision history for this message
Nikolay Makhotkin (nmakhotkin) wrote :

However, resume command works fine:

  mistral execution-update <id> RUNNING

it successfully resumes workflow execution.

Revision history for this message
Nikolay Makhotkin (nmakhotkin) wrote :

Pasue cmd also works as designed.

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/185013

Changed in mistral:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/185013
Committed: https://git.openstack.org/cgit/stackforge/mistral/commit/?id=3b16cd8dd2f4a995deac07031645885a12465fb6
Submitter: Jenkins
Branch: master

commit 3b16cd8dd2f4a995deac07031645885a12465fb6
Author: Nikolay Mahotkin <email address hidden>
Date: Fri May 22 16:03:42 2015 +0300

    Fixing execution-update API

     * Fixed handling wrong using execution-update
     * Fixed session hanging in case incorrect using execution update API:
         in case of exception neither commit_tx nor rollback_tx has not
         been invoked -> session acquired semaphore but didn't release it.
       Note: it is related only to sqlite (used in unit tests).

    Closes-Bug: #1449557

    Change-Id: Ic8874b2d498167cac1a88f6d138e8ac0e1d9a67f

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
milestone: 1.0.0 → none
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.