Bug 1156055

Summary: [external-task] Couldn't clear external job
Product: Red Hat Enterprise Virtualization Manager Reporter: sefi litmanovich <slitmano>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: gklein, lpeer, lsurette, oourfali, pstehlik, rbalakri, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:26:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine log none

Description sefi litmanovich 2014-10-23 13:39:36 UTC
Created attachment 949888 [details]
engine log

Description of problem:

after adding an external job and some steps and sub steps and ending all of them, failed to clear the job.

Version-Release number of selected component (if applicable):

rhevm-3.5.0-0.17.beta.el6ev.noarch

How reproducible:

always.

Steps to Reproduce:
1. add an external job

Content-Type:application/xml
Accept:application/xml

https://{engine_server}/api/jobs POST
body:

<job>
    <description>job1</description>
    <auto_cleared>[true|false]</auto_cleared]
</job>

2.add two a step (or more) to the job:

Content-Type:application/xml
Accept:application/xml

https://{engine_server}/api/jobs/{job_id}/ POST
body:

<step>
    <description>step 1</description> 
    <type>EXECUTING</type>
    <status>
          <state>STARTED</state>
    </status>
</step>

3.add sub steps:

Content-Type:application/xml
Accept:application/xml

https://{engine_server}/api/jobs/{job_id}/steps POST
body:

<step>
    <parent_step  id="<parent step id>" />
    <description>sub step 1</description> 
    <type>EXECUTING</type>
    <status>
          <state>STARTED</state>
    </status>
</step>

4. end each step:


Content-Type:application/xml
Accept:application/xml

https://{engine_server}/api/jobs/{job_id}/steps/{step_id}/end POST

body:
<action>
  <succeeded>true</succeeded>
</action>

5. end the job:

Content-Type:application/xml
Accept:application/xml

https://{engine_server}/api/jobs/{job_id}/end POST

body:

<action>
  <status>
     <state>FINISHED</state>
  </status>>
  <force>false</force>
</action>

6. clear the job:

Content-Type:application/xml
Accept:application/xml

https://{engine_server}/api/jobs/{job_id}/clear POST

body:

<action>
</action>



Actual results:

Operation failed.

from engine log:

2014-10-23 15:58:45,423 INFO [org.ovirt.engine.core.bll.ClearExternalJobCommand] (ajp-/127.0.0.1:8702-8) [4e4adc87] Running command: ClearExternalJobCommand internal: false. Entities affected :  ID: aaa00000-0000-0000-0000-123456789aaa Type: SystemAction group INJECT_EXTERNAL_TASKS with role type ADMIN

2014-10-23 15:58:45,428 ERROR [org.ovirt.engine.core.bll.ClearExternalJobCommand] (ajp-/127.0.0.1:8702-8) [4e4adc87] Transaction rolled-back for command: org.ovirt.engine.core.bll.ClearExternalJobCommand.

2014-10-23 15:58:45,428 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-8) Operation Failed: []


Expected results:

operation succeeds jab is clear and doesn't appear any more on through GET in api or on task in the ui.


Additional info:

Comment 1 sefi litmanovich 2015-06-01 15:04:59 UTC
verified with ovirt-engine-3.6.0-0.0.master.20150519172219.git9a2e2b3.el6.noarch according to steps in description.