Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1432340 - heketi-cli doesn't output the reason of error
heketi-cli doesn't output the reason of error
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: heketi (Show other bugs)
cns-3.4
Unspecified Unspecified
medium Severity medium
: ---
: CNS 3.10
Assigned To: Niels de Vos
Rachael
:
Depends On:
Blocks: 1542093 1568861
  Show dependency treegraph
 
Reported: 2017-03-15 03:39 EDT by Kenjiro Nakayama
Modified: 2018-09-12 05:23 EDT (History)
11 users (show)

See Also:
Fixed In Version: heketi-6.0.0-14.el7rhgs
Doc Type: Bug Fix
Doc Text:
Previously, a misconfigured router or proxy in Kubernetes or Openshift could fail to provide error messages in the HTTP response body, leading heketi-cli to display nothing for these error conditions. With this update, heketi-cli will display the HTTP status code, rather than nothing, for these error conditions.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-09-12 05:22:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github heketi/heketi/pull/1180 None None None 2018-05-15 04:30 EDT
Red Hat Product Errata RHEA-2018:2686 None None None 2018-09-12 05:23 EDT

  None (edit)
Description Kenjiro Nakayama 2017-03-15 03:39:27 EDT
In some condition, heketi-cli doesn't answer the error to the client. Please see the output of error:

  [root@knakayam-ose34-master1 ~]# heketi-cli topology info 
  Error: 
   
  [root@knakayam-ose34-master1 ~]# heketi-cli volume list
  Error: 
   
  [root@knakayam-ose34-master1 ~]# heketi-cli cluster list
  Error: 

Expected results:

Whenever heketi-cli returns error, please output some clue for the error.
Comment 2 Kenjiro Nakayama 2017-03-15 05:37:11 EDT
For example (this is just one example), if server returns 404, heketi-cli didn't output any information about the error.

[root@knakayam-ose34-master1 ~]# heketi-cli topology info --server=http://access.redhat.com 
Error: 
[root@knakayam-ose34-master1 ~]#
Comment 3 Humble Chirammal 2017-03-15 05:46:49 EDT
Can you please share the env variable value of  HEKETI_CLI_SERVER ?
Comment 4 Kenjiro Nakayama 2017-03-15 06:04:30 EDT
I'm sorry, but why do you need to know it? I have already debugged the reason why I got the "Error:". What I wanted to ask you is that improvement of the error message. For example, if 404 was returned as c#2, please output the "404 error".
Comment 5 Humble Chirammal 2017-03-15 07:56:45 EDT

(In reply to Kenjiro Nakayama from comment #4)
> I'm sorry, but why do you need to know it? I have already debugged the
> reason why I got the "Error:". What I wanted to ask you is that improvement
> of the error message. For example, if 404 was returned as c#2, please output
> the "404 error".

Can you please let me know which version of Heketi is in use here ? If you are not using heekti version 4, can you reproduce the same with v4?
Comment 6 Kenjiro Nakayama 2017-03-15 09:00:50 EDT
heketi version 4 is provided via RH repository? I think I am using the latest package.

# rpm -qf `which heketi-cli`
heketi-client-3.1.0-14.el7rhgs.x86_64

# heketi-cli -v
heketi-cli 3.1.0
Comment 7 Humble Chirammal 2017-04-27 06:35:27 EDT
(In reply to Kenjiro Nakayama from comment #6)
> heketi version 4 is provided via RH repository? I think I am using the
> latest package.
> 
> # rpm -qf `which heketi-cli`
> heketi-client-3.1.0-14.el7rhgs.x86_64
> 
> # heketi-cli -v
> heketi-cli 3.1.0

Its available in RH repository.Please retest with the same.
Comment 8 Kenjiro Nakayama 2017-04-27 07:08:28 EDT
That's QE/QA's work.
Comment 9 Mark LaBonte 2017-06-12 12:17:14 EDT
I'm seeing this issue also.
Let me know if you need any additional info:


root@10.19.231.221 ~ $ echo $HEKETI_CLI_SERVER
http://heketi-cns0.cloudapps.mystorage.com
root@10.19.231.221 ~ $ heketi-cli volume list
Error: 
root@10.19.231.221 ~ $ heketi-cli -v
heketi-cli 4.0.0
Comment 11 Mark LaBonte 2017-07-26 20:56:17 EDT
Any update for this issue?

I'm seeing this happen after certain CNS node fail/restore tests and it's blocking me from getting volume status, etc.

I can provide my config info if needed.
Comment 12 Humble Chirammal 2017-07-27 01:45:23 EDT
(In reply to Mark LaBonte from comment #11)
> Any update for this issue?
> 
> I'm seeing this happen after certain CNS node fail/restore tests and it's
> blocking me from getting volume status, etc.
> 
> I can provide my config info if needed.

Thanks Mark!  Actually the communication is from heketi-cli to heketi service. The client has to get return from heketi server on the queries. What we normally do to make sure the server give response is via 'curl' command. 

For eg# 

[root@client] curl http://deploy-heketi-storage-project.cloudapps.mystorage.com/hello

Hello from Heketi

Reference #https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.2/html-single/container-native_storage_for_openshift_container_platform/#idm140543670015568


So, for your specifc setup, can you issue curl command against your heketi service and give a check ?
Comment 13 Mark LaBonte 2017-07-27 11:22:21 EDT
Thanks Humble - the root cause in my case is a failed heketi-db volume.

Regarding the empty error, the issue exists in heketi-cli 4.0.0 - what release is the fix targeted for?
Comment 14 Humble Chirammal 2017-07-28 02:58:51 EDT
(In reply to Mark LaBonte from comment #13)
> Thanks Humble - the root cause in my case is a failed heketi-db volume.

Does that mean, heketi service was not running properly? 

> 
> Regarding the empty error, the issue exists in heketi-cli 4.0.0 - what
> release is the fix targeted for?

Mark, I am not completely sure on to what extent this has been fixed. However I recollected some enhancements in this area as you can see here https://bugzilla.redhat.com/show_bug.cgi?id=1351646 and was asking to test latest version of heketi. I still have to check on what are covered and what is not.
Comment 15 Mark LaBonte 2017-08-16 11:12:29 EDT
Humble, 
Yes, the service was down but we should really be returning something other than an empty error here.
Comment 17 Niels de Vos 2018-05-09 05:00:06 EDT
This seems to need small fixes in the heketi-client side in order to prevent an empty "Error: " message. It is possible that a router/proxy returns an HTTP error status (like 404), but without contents (error message) in the body.

From client/api/go-client/volume.go:
132 func (c *Client) VolumeList() (*api.VolumeListResponse, error) {
133 
134         // Create request
135         req, err := http.NewRequest("GET", c.host+"/volumes", nil)
136         if err != nil {
137                 return nil, err
138         }

The err variable can get set to an empty string (""), which in turn gets displayed as an error message through heketi-cli.

We'll need to review all http.NewRequest() calls and add a more descriptive error message in case none is set.
Comment 18 Niels de Vos 2018-05-15 15:45:10 EDT
https://github.com/heketi/heketi/commit/ed3c92e4d635c4b644864344471a0e197f7e4804 has been merged upstream.
Comment 22 Rachael 2018-06-05 08:00:29 EDT
The following commands were run to reproduce the issue:

[root@dhcp46-144 ~]# heketi-cli topology info --server=http://abc.com
Error: server did not provide a message (status 404: Not Found)

[root@dhcp46-144 ~]# heketi-cli volume list --server=http://example.com
Error: server did not provide a message (status 404: Not Found)

[root@dhcp46-144 ~]# heketi-cli cluster list --server=http://example.com
Error: server did not provide a message (status 404: Not Found)

heketidbstorage volume was stopped and the same commands were run:

[root@dhcp46-144 ~]# heketi-cli volume list
Error: Get http://172.31.217.233:8080/volumes: dial tcp 172.31.217.233:8080: getsockopt: connection refused

[root@dhcp46-144 ~]# heketi-cli cluster list
Error: Get http://172.31.217.233:8080/clusters: dial tcp 172.31.217.233:8080: getsockopt: connection refused

[root@dhcp46-144 ~]# heketi-cli topology info
Error: Get http://172.31.217.233:8080/clusters: dial tcp 172.31.217.233:8080: getsockopt: connection refused

Since no empty error messages were seen, moving this bug to verified.
Comment 23 Anjana 2018-08-30 09:36:15 EDT
Updated doc text in the Doc Text field. Please review for technical accuracy.
Comment 25 Anjana 2018-09-07 14:30:03 EDT
Thanks John , I have updated the doc text based on your feed back
Comment 26 John Mulligan 2018-09-07 15:04:10 EDT
Doc Text looks OK
Comment 28 errata-xmlrpc 2018-09-12 05:22:12 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://access.redhat.com/errata/RHEA-2018:2686

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