Bug 1341141

Summary: heketi-cli: proper error message to stdout for cluster/node/device delete
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Neha <nerawat>
Component: heketiAssignee: Jose A. Rivera <jarrpa>
Status: CLOSED ERRATA QA Contact: Prasanth <pprakash>
Severity: medium Docs Contact:
Priority: medium    
Version: rhgs-3.1CC: annair, hchiramm, madam, mzywusko, pprakash, rcyriac
Target Milestone: ---Keywords: ZStream
Target Release: CNS 3.4   
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-01-18 21:55:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1385246    

Description Neha 2016-05-31 11:00:33 UTC
Description of problem:

heketi-cli doesn't print proper error message to stdout.

=> docker exec heketi heketi-cli --server http://localhost:8080 cluster delete 46d613cf778d1a11ab2f36a2dd3dc803
Error: Conflict

=>docker exec heketi heketi-cli --server http://localhost:8080 node delete 53bb0c58ceaa2042c5088377de9c872f
Error: Conflict

=> docker exec heketi heketi-cli --server http://localhost:8080 device delete 77fddc8c8ed815ab09965095941cf899
Error: Conflict

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


How reproducible:
Always

Steps to Reproduce:
1. Try to delete a cluster which contains node/devices
2. Try to delete a node which contains devices
3. Try to delete a device which contains volumes/bricks

Actual results:
Error Conflict

Expected results:
Should display proper error message to stdout

Additional info:

For example heketi logs:

[negroni] Started DELETE /clusters/46d613cf778d1a11ab2f36a2dd3dc803
[heketi] WARNING 2016/05/27 12:01:01 Unable to delete cluster [46d613cf778d1a11ab2f36a2dd3dc803] because it contains volumes and/or nodes
[negroni] Completed 409 Conflict in 466.033µs

Comment 2 Neha 2016-05-31 11:07:03 UTC
also for node/device it doesn't log to heketi logs.  

upstream issue:
https://github.com/heketi/heketi/issues/355

Comment 5 Humble Chirammal 2016-07-05 10:03:50 UTC
@naha, @Luis, I see the patch with this upstream PR https://github.com/heketi/heketi/pull/356. Moving this bug to POST. Please revert if I am wrong.

Comment 6 Luis Pabón 2016-07-13 19:52:56 UTC
Yeah, POST is the right thing, thanks Humble

Comment 7 Neha 2016-07-20 04:42:59 UTC
The above PR was created to fix the "server side error" for node and device [BZ 1341961].

Comment 11 Michael Adam 2016-10-19 16:33:50 UTC
was fixed by jarrpa

Comment 16 Prasanth 2016-11-17 09:41:39 UTC
Verified as fixed in the latest heketi build (heketi-cli 3.0.0)


##########
# heketi-cli cluster delete 67bc66e74759bb4a067c5c2a3c866f0d
Error: Unable to delete cluster [67bc66e74759bb4a067c5c2a3c866f0d] because it contains volumes and/or nodes

# heketi-cli node delete 27f8060541a2361a5cd83e46f08b07a1
Error: Unable to delete node [27f8060541a2361a5cd83e46f08b07a1] because it contains devices

# heketi-cli device delete ba452b20b76491fe06a9d4b688a92246
Error: Unable to delete device [ba452b20b76491fe06a9d4b688a92246] because it contains bricks
##########

Comment 18 errata-xmlrpc 2017-01-18 21:55:00 UTC
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-2017-0148.html