[Bugs] [Bug 1443349] New: [Eventing]: Unrelated error message displayed when path specified during a ' webhook-test/add' is missing a schema

bugzilla at redhat.com bugzilla at redhat.com
Wed Apr 19 06:47:10 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1443349

            Bug ID: 1443349
           Summary: [Eventing]: Unrelated error message displayed when
                    path specified during a 'webhook-test/add' is missing
                    a schema
           Product: GlusterFS
           Version: 3.10
         Component: eventsapi
          Severity: medium
          Assignee: bugs at gluster.org
          Reporter: avishwan at redhat.com
                CC: rhs-bugs at redhat.com, sanandpa at redhat.com,
                    storage-qa-internal at redhat.com
        Depends On: 1441945
            Blocks: 1441942



+++ This bug was initially created as a clone of Bug #1441945 +++

+++ This bug was initially created as a clone of Bug #1441942 +++

Description of problem:
=======================
On a gluster cluster with eventing enabled, the correct command to register a
webhook would be:
    gluster-eventsapi webhook-test
http://<ip>:<port_number><path_specified_in_webhook>

Say, we miss giving 'http', or 'tcp' or any such protocol in the path, then an
exception is thrown by one of the internal scripts
(/usr/libexec/glusterfs/peer_eventsapi.py):
    requests.exceptions.InvalidSchema: No connection adapters were found for
'10.70.35.21:9000/listen'

This error message is expected to be caught and displayed by the
gluster-eventsapi command, but instead it prints out:
    gluster.cliutils.cliutils.GlusterCmdException: (1, '', 'Unable to end.
Error : Success\n', 'gluster system:: execute eventsapi.py node-webhook-test
10.70.35.21:9000/listen .

The above message is misleading and does not give an idea as to what is wrong.
The correct error message if displayed would guide the user to take the
appropriate corrective action.

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


How reproducible:
=================
2:2


Additional info:
================



[root at dhcp47-165 ~]# gluster-eventsapi webhook-test 10.70.35.21:9000/listen
Traceback (most recent call last):
  File "/usr/sbin/gluster-eventsapi", line 602, in <module>
    runcli()
  File "/usr/lib/python2.7/site-packages/gluster/cliutils/cliutils.py", line
224, in runcli
    cls.run(args)
  File "/usr/sbin/gluster-eventsapi", line 411, in run
    out = execute_in_peers("node-webhook-test", [url, bearer_token])
  File "/usr/lib/python2.7/site-packages/gluster/cliutils/cliutils.py", line
126, in execute_in_peers
    raise GlusterCmdException((rc, out, err, " ".join(cmd)))
gluster.cliutils.cliutils.GlusterCmdException: (1, '', 'Unable to end. Error :
Success\n', 'gluster system:: execute eventsapi.py node-webhook-test
10.70.35.21:9000/listen .')
[root at dhcp47-165 ~]# python /usr/libexec/glusterfs/peer_eventsapi.py
node-webhook-test 10.70.35.21:9000/listen
usage: peer_eventsapi.py node-webhook-test [-h] [--json] url bearer_token
peer_eventsapi.py node-webhook-test: error: too few arguments
[root at dhcp47-165 ~]# python /usr/libexec/glusterfs/peer_eventsapi.py
node-webhook-test 10.70.35.21:9000/listen .
Traceback (most recent call last):
  File "/usr/libexec/glusterfs/peer_eventsapi.py", line 602, in <module>
    runcli()
  File "/usr/lib/python2.7/site-packages/gluster/cliutils/cliutils.py", line
224, in runcli
    cls.run(args)
  File "/usr/libexec/glusterfs/peer_eventsapi.py", line 386, in run
    resp = requests.post(args.url, headers=http_headers)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 109, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 465, in
request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 567, in
send
    adapter = self.get_adapter(url=request.url)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 641, in
get_adapter
    raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for
'10.70.35.21:9000/listen'
[root at dhcp47-165 ~]#
[root at dhcp47-165 ~]# python /usr/libexec/glusterfs/peer_eventsapi.py
node-webhook-test http://10.70.35.21:9000/listen .
{"output": "", "ok": true, "nodeid": "834d66eb-fb65-4ea3-949a-e7cb4c198f2b"}
[root at dhcp47-165 ~]# ^C
[root at dhcp47-165 ~]# 
[root at dhcp47-165 ~]# python /usr/libexec/glusterfs/peer_eventsapi.py
node-webhook-test http://10.70.35.21:9000/listen .
{"output": "", "ok": true, "nodeid": "834d66eb-fb65-4ea3-949a-e7cb4c198f2b"}
[root at dhcp47-165 ~]# gluster-eventsapi webhook-test
http://10.70.35.21:9000/listen+-----------------------------------+-------------+----------------+
|                NODE               | NODE STATUS | WEBHOOK STATUS |
+-----------------------------------+-------------+----------------+
| dhcp47-164.lab.eng.blr.redhat.com |          UP |             OK |
| dhcp47-162.lab.eng.blr.redhat.com |          UP |             OK |
| dhcp47-157.lab.eng.blr.redhat.com |          UP |             OK |
|             localhost             |          UP |             OK |
+-----------------------------------+-------------+----------------+
[root at dhcp47-165 ~]#

[root at dhcp47-165 ~]# 
[root at dhcp47-165 ~]# gluster peer status
Number of Peers: 3

Hostname: dhcp47-164.lab.eng.blr.redhat.com
Uuid: afa697a0-2cc6-4705-892e-f5ec56a9f9de
State: Peer in Cluster (Connected)

Hostname: dhcp47-162.lab.eng.blr.redhat.com
Uuid: 95491d39-d83a-4053-b1d5-682ca7290bd2
State: Peer in Cluster (Connected)

Hostname: dhcp47-157.lab.eng.blr.redhat.com
Uuid: d0955c85-94d0-41ba-aea8-1ffde3575ea5
State: Peer in Cluster (Connected)
[root at dhcp47-165 ~]# gluster v list
disp
dist
ozone

--- Additional comment from Worker Ant on 2017-04-13 03:45:04 EDT ---

REVIEW: https://review.gluster.org/17054 (eventsapi: Fix webhook-test when no
schema specified in URL) posted (#1) for review on master by Aravinda VK
(avishwan at redhat.com)

--- Additional comment from Worker Ant on 2017-04-13 09:55:06 EDT ---

REVIEW: https://review.gluster.org/17054 (eventsapi: Fix webhook-test when no
schema specified in URL) posted (#2) for review on master by Atin Mukherjee
(amukherj at redhat.com)

--- Additional comment from Worker Ant on 2017-04-17 06:25:30 EDT ---

COMMIT: https://review.gluster.org/17054 committed in master by Aravinda VK
(avishwan at redhat.com) 
------
commit a9b5333d7bae6e20ffef07dffcda49eaf9d6823b
Author: Aravinda VK <avishwan at redhat.com>
Date:   Thu Apr 13 12:56:09 2017 +0530

    eventsapi: Fix webhook-test when no schema specified in URL

    If no schema specifed like `http` or `https` while testing webhook,
    it was failing with Schema Exception and not communicated the error
    to CLI caller.

    With this patch exception is handled and responded back to CLI caller.

    BUG: 1441945
    Change-Id: I9be11d36e9f65be873516fef370c327f1cdbc93e
    Signed-off-by: Aravinda VK <avishwan at redhat.com>
    Reviewed-on: https://review.gluster.org/17054
    Smoke: Gluster Build System <jenkins at build.gluster.org>
    Reviewed-by: Prashanth Pai <ppai at redhat.com>
    CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
    NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1441942
[Bug 1441942] [Eventing]: Unrelated error message displayed when path
specified during a 'webhook-test/add' is missing a schema
https://bugzilla.redhat.com/show_bug.cgi?id=1441945
[Bug 1441945] [Eventing]: Unrelated error message displayed when path
specified during a 'webhook-test/add' is missing a schema
-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Bugs mailing list