Bug 1415759 - Trying to sparsify a direct lun via the REST API gives a NullPointerException
Summary: Trying to sparsify a direct lun via the REST API gives a NullPointerException
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: future
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ovirt-4.1.1
: 4.1.1.2
Assignee: Shmuel Melamud
QA Contact: sefi litmanovich
URL:
Whiteboard:
: 1418255 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-23 16:23 UTC by Idan Shaby
Modified: 2017-04-21 09:46 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-21 09:46:56 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
tjelinek: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 71543 0 master MERGED restapi: Null-safe handling of incorrect disks in Sparsify 2017-02-06 11:48:25 UTC
oVirt gerrit 72267 0 ovirt-engine-4.1 MERGED restapi: Null-safe handling of incorrect disks in Sparsify 2017-02-14 22:26:45 UTC

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


Note You need to log in before you can comment on or make changes to this bug.