Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1221163 - [TEXT][REST] Wrong error is thrown when attempting an update command on a detached storage domain
[TEXT][REST] Wrong error is thrown when attempting an update command on a det...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.5.1
Unspecified Unspecified
unspecified Severity low
: ovirt-4.0.0-alpha
: 4.0.0
Assigned To: Idan Shaby
Raz Tamir
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-13 08:00 EDT by Ori Gofen
Modified: 2016-08-23 16:24 EDT (History)
14 users (show)

See Also:
Fixed In Version: ovirt 4.0.0 alpha1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-23 16:24:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 47657 master MERGED backend: improve storage domain illegal status message Never
oVirt gerrit 47850 ovirt-engine-3.6 ABANDONED backend: improve storage domain illegal status message Never
Red Hat Product Errata RHEA-2016:1743 normal SHIPPED_LIVE Red Hat Virtualization Manager 4.0 GA Enhancement (ovirt-engine) 2016-09-02 17:54:01 EDT

  None (edit)
Description Ori Gofen 2015-05-13 08:00:49 EDT
Description of problem:
When executing domain.update() on a domain which is not attached to any datacenter an error is thrown:

>>> sd.update()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/brokers.py", line 16793, in update
    headers={"Correlation-Id":correlation_id}
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 78, in update
    return self.request('PUT', url, body, headers)
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 118, in request
    persistent_auth=self._persistent_auth)
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 146, in __doRequest
    persistent_auth=persistent_auth
  File "/usr/lib/python2.7/site-packages/ovirtsdk/web/connection.py", line 134, in doRequest
    raise RequestError, response
RequestError:
status: 409
reason: Conflict
detail: Cannot edit Storage. The relevant Storage Domain's status is Unknown."

while the relevant storage domain's status is well known to oVirt engine:

>>> sd.get_status().get_state()
'unattached'


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

How reproducible:
100%

Steps to Reproduce:
1.detach a storage domain
2. try to update this domain from api:
sd = api.storagedomains.get($STORAGE_NAME)
sd.update()

Actual results:
a wrong and misleading error message

Expected results:
should change to "Cannot edit Storage. The relevant Storage Domain's status is unattached." 

Additional info:
Comment 1 Juan Hernández 2015-05-13 09:45:06 EDT
Apparently what is happening here is that the backend "UpdateStorageDomainCommand" is getting the status of the storage domain using the "StorageDomain.getStatus()" method, but this is implemented as "getStoragePoolIsoMapData().getStatus()" which, if I understand correctly, is valid only when the storage command is attached to a data center.
Comment 2 Allon Mureinik 2015-05-13 11:19:23 EDT
(In reply to Juan Hernández from comment #1)
> Apparently what is happening here is that the backend
> "UpdateStorageDomainCommand" is getting the status of the storage domain
> using the "StorageDomain.getStatus()" method, but this is implemented as
> "getStoragePoolIsoMapData().getStatus()" which, if I understand correctly,
> is valid only when the storage command is attached to a data center.
Yup.
Should be rethought in 3.6.0
Comment 3 Sandro Bonazzola 2015-10-26 08:48:02 EDT
this is an automated message. oVirt 3.6.0 RC3 has been released and GA is targeted to next week, Nov 4th 2015.
Please review this bug and if not a blocker, please postpone to a later release.
All bugs not postponed on GA release will be automatically re-targeted to

- 3.6.1 if severity >= high
- 4.0 if severity < high
Comment 4 Raz Tamir 2016-04-10 07:19:25 EDT
Response body from PUT on api/storagedomains/{sd_id}

<storage_domain>
  <name>nfs_x</name>
</storage_domain>

status: 409
<fault>
    <detail>[Cannot edit Storage. The relevant Storage Domain's status is Unattached.]</detail>
    <reason>Operation Failed</reason>
</fault>
Comment 7 errata-xmlrpc 2016-08-23 16:24:09 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-1743.html

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