Bug 1418255

Summary: Error message is too general when trying to sparsify a direct lun disk
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: BLL.VirtAssignee: Michal Skrivanek <michal.skrivanek>
Status: CLOSED DUPLICATE QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 16:36:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine log none

Description sefi litmanovich 2017-02-01 11:43:24 UTC
Created attachment 1246616 [details]
engine log

Description of problem:
In bz: https://bugzilla.redhat.com/show_bug.cgi?id=1414867 the ability to invoke the sparsify action is disabled in UI if the disk is a direct lun disk.
On REST API when trying to invoke the sparsify action on the same disk, the action fails as expected but the error is too general:
<detail>java.lang.NullPointerException</detail>



Version-Release number of selected component (if applicable):
rhevm-4.1.0.3-0.1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Create a vm.
2. Create a disk for the vm which is a direct lun disk.
3. Invoke sparsify action from rest api:

https://{engine_url}/ovirt-engine/api/disks/{disk_id}/sparsify

body:
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
</action>

Actual results:

<action>
<async>false</async>
<fault>
<detail>java.lang.NullPointerException</detail>
<reason>Operation Failed</reason>
</fault>
<grace_period>
<expiry>10</expiry>
</grace_period>
<status>failed</status>
</action>

attached is engine log with fool trace of the NullPointerException.

Expected results:
An informative message explaining that the action is disabled for this disk type.

Additional info:

Comment 1 sefi litmanovich 2017-02-01 16:36:11 UTC

*** This bug has been marked as a duplicate of bug 1415759 ***