Bug 1415759

Summary: Trying to sparsify a direct lun via the REST API gives a NullPointerException
Product: [oVirt] ovirt-engine Reporter: Idan Shaby <ishaby>
Component: RestAPIAssignee: Shmuel Melamud <smelamud>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: high Docs Contact:
Priority: medium    
Version: futureCC: amureini, bugs, gklein, michal.skrivanek, slitmano, smelamud, tjelinek, tnisan
Target Milestone: ovirt-4.1.1Flags: rule-engine: ovirt-4.1+
rule-engine: planning_ack+
tjelinek: devel_ack+
mavital: testing_ack+
Target Release: 4.1.1.2   
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-04-21 09:46:56 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:

Description Idan Shaby 2017-01-23 16:23:45 UTC
Description of problem:
When trying to sparsify a direct lun via the REST API, a NullPointerException is returned as a "500 Internal Server Error".

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

How reproducible:
100%

Steps to Reproduce:
1. Have a direct lun.
2. Try to sparsify it via the REST API:
POST http://<host_name>:8080/ovirt-engine/api/disks/<direct_lun_id>/sparsify

Actual results:
500 Internal Server Error
<action>
  <fault>
    <detail>java.lang.NullPointerException</detail>
    <reason>Operation Failed</reason>
  </fault>
  <status>failed</status>
</action>

Expected results:
Should be passed to the backend and let it return an error message that direct luns can't be sparsified.

Comment 1 sefi litmanovich 2017-02-01 16:36:11 UTC
*** Bug 1418255 has been marked as a duplicate of this bug. ***

Comment 2 sefi litmanovich 2017-02-21 08:35:46 UTC
Trying with the new build rhevm-4.1.1.2-0.1.el7.noarch I do not get NullPointerException any more, but still the detail of the failure is incorrect, I get:

<action>
<async>false</async>
<fault>
<detail>[User is not authorized to perform this action.]</detail>
<reason>Operation Failed</reason>
</fault>
<grace_period>
<expiry>10</expiry>
</grace_period>
<status>failed</status>
</action>

This is although I'm running the cmd as admin with superUser permissions on the vm, just the same as other vms with which the sparsify action works or fails with specific msg, e.g.

[Cannot sparsify Virtual Disk. Sparsifying is not supported for preallocated disk bla_Disk1.]

Please check it out.

Comment 3 sefi litmanovich 2017-03-02 14:08:36 UTC
Verifying the bug as it handles the NullPointerException issue, but opening a new one regarding the new issue: https://bugzilla.redhat.com/show_bug.cgi?id=1428404