Bug 1432340 - heketi-cli doesn't output the reason of error
Summary: heketi-cli doesn't output the reason of error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: heketi
Version: cns-3.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: CNS 3.10
Assignee: Niels de Vos
QA Contact: Rachael
URL:
Whiteboard:
Depends On:
Blocks: 1724792 1568861
TreeView+ depends on / blocked
 
Reported: 2017-03-15 07:39 UTC by Kenjiro Nakayama
Modified: 2019-06-28 16:04 UTC (History)
12 users (show)

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.
Clone Of:
Environment:
Last Closed: 2018-09-12 09:22:12 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github heketi heketi pull 1180 0 None closed utils: improve error reporting if service does not provide a message 2020-04-28 08:28:33 UTC
Red Hat Product Errata RHEA-2018:2686 0 None None None 2018-09-12 09:23:25 UTC

Description Kenjiro Nakayama 2017-03-15 07:39:27 UTC
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 09:37:11 UTC
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 09:46:49 UTC
Can you please share the env variable value of  HEKETI_CLI_SERVER ?

Comment 4 Kenjiro Nakayama 2017-03-15 10:04:30 UTC
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 11:56:45 UTC

(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 13:00:50 UTC
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 10:35:27 UTC
(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 11:08:28 UTC
That's QE/QA's work.

Comment 9 Mark LaBonte 2017-06-12 16:17:14 UTC
I'm seeing this issue also.
Let me know if you need any additional info:


root.231.221 ~ $ echo $HEKETI_CLI_SERVER
http://heketi-cns0.cloudapps.mystorage.com
root.231.221 ~ $ heketi-cli volume list
Error: 
root.231.221 ~ $ heketi-cli -v
heketi-cli 4.0.0

Comment 11 Mark LaBonte 2017-07-27 00:56:17 UTC
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 05:45:23 UTC
(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 15:22:21 UTC
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 06:58:51 UTC
(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 15:12:29 UTC
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 09:00:06 UTC
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 19:45:10 UTC
https://github.com/heketi/heketi/commit/ed3c92e4d635c4b644864344471a0e197f7e4804 has been merged upstream.

Comment 22 Rachael 2018-06-05 12:00:29 UTC
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 KD 2018-08-30 13:36:15 UTC
Updated doc text in the Doc Text field. Please review for technical accuracy.

Comment 25 Anjana KD 2018-09-07 18:30:03 UTC
Thanks John , I have updated the doc text based on your feed back

Comment 26 John Mulligan 2018-09-07 19:04:10 UTC
Doc Text looks OK

Comment 28 errata-xmlrpc 2018-09-12 09:22:12 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://access.redhat.com/errata/RHEA-2018:2686


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