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@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@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@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@dhcp47-165 ~]# [root@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@dhcp47-165 ~]# ^C [root@dhcp47-165 ~]# [root@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@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@dhcp47-165 ~]# [root@dhcp47-165 ~]# [root@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@dhcp47-165 ~]# gluster v list disp dist ozone [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# rpm -qa | grep gluster glusterfs-libs-3.8.4-22.el7rhgs.x86_64 glusterfs-cli-3.8.4-22.el7rhgs.x86_64 glusterfs-client-xlators-3.8.4-22.el7rhgs.x86_64 glusterfs-rdma-3.8.4-22.el7rhgs.x86_64 vdsm-gluster-4.17.33-1.1.el7rhgs.noarch glusterfs-3.8.4-22.el7rhgs.x86_64 glusterfs-api-3.8.4-22.el7rhgs.x86_64 glusterfs-events-3.8.4-22.el7rhgs.x86_64 gluster-nagios-common-0.2.4-1.el7rhgs.noarch gluster-nagios-addons-0.2.8-1.el7rhgs.x86_64 glusterfs-fuse-3.8.4-22.el7rhgs.x86_64 glusterfs-geo-replication-3.8.4-22.el7rhgs.x86_64 glusterfs-server-3.8.4-22.el7rhgs.x86_64 python-gluster-3.8.4-22.el7rhgs.noarch [root@dhcp47-165 ~]# [root@dhcp47-165 ~]#
Upstream patch sent https://review.gluster.org/17054
Downstream patch: https://code.engineering.redhat.com/gerrit/#/c/103716 Upstream 3.10 patch: https://review.gluster.org/17079
Verifying this on the build 3.8.4-23. I am able to see the below error, mentioning connection adapters. Aravinda, is this the expected error that is to be seen? I was assuming to see something related to 'invalid schema'. [root@dhcp47-121 ~]# gluster-eventsapi webhook-test 10.70.35.119:9001/listen +-----------------------------------+-------------+--------------------------------------------------------------------------+ | NODE | NODE STATUS | WEBHOOK STATUS | +-----------------------------------+-------------+--------------------------------------------------------------------------+ | dhcp47-113.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-114.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-115.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-116.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-117.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | localhost | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | +-----------------------------------+-------------+--------------------------------------------------------------------------+ [root@dhcp47-121 ~]#
Also, the above error that is seen is only for 'webhook-test'. I do not see the same error when I try webhook-add directly. Webhook-add completes successfully! Is there a default protocol that is taken, if not explicitly specified. If yes, shouldn't it be considered for 'webhook-test' as well? [root@dhcp47-121 ~]# gluster-eventsapi webhook-test 10.70.35.119:9001/listen +-----------------------------------+-------------+--------------------------------------------------------------------------+ | NODE | NODE STATUS | WEBHOOK STATUS | +-----------------------------------+-------------+--------------------------------------------------------------------------+ | dhcp47-113.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-114.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-115.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-116.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | dhcp47-117.lab.eng.blr.redhat.com | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | | localhost | UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' | +-----------------------------------+-------------+--------------------------------------------------------------------------+ [root@dhcp47-121 ~]# gluster-eventsapi webhook-add 10.70.35.119:9001/listen +-----------------------------------+-------------+-------------+ | NODE | NODE STATUS | SYNC STATUS | +-----------------------------------+-------------+-------------+ | dhcp47-113.lab.eng.blr.redhat.com | UP | OK | | dhcp47-114.lab.eng.blr.redhat.com | UP | OK | | dhcp47-115.lab.eng.blr.redhat.com | UP | OK | | dhcp47-116.lab.eng.blr.redhat.com | UP | OK | | dhcp47-117.lab.eng.blr.redhat.com | UP | OK | | localhost | UP | OK | +-----------------------------------+-------------+-------------+ [root@dhcp47-121 ~]# gluster-eventsapi status Webhooks: http://10.70.35.21:9000/listen 10.70.35.119:9001/listen +-----------------------------------+-------------+-----------------------+ | NODE | NODE STATUS | GLUSTEREVENTSD STATUS | +-----------------------------------+-------------+-----------------------+ | dhcp47-113.lab.eng.blr.redhat.com | UP | OK | | dhcp47-114.lab.eng.blr.redhat.com | UP | OK | | dhcp47-115.lab.eng.blr.redhat.com | UP | OK | | dhcp47-116.lab.eng.blr.redhat.com | UP | OK | | dhcp47-117.lab.eng.blr.redhat.com | UP | OK | | localhost | UP | OK | +-----------------------------------+-------------+-----------------------+ [root@dhcp47-121 ~]#
(In reply to Sweta Anandpara from comment #8) > Also, the above error that is seen is only for 'webhook-test'. I do not see > the same error when I try webhook-add directly. Webhook-add completes > successfully! > > Is there a default protocol that is taken, if not explicitly specified. > If yes, shouldn't it be considered for 'webhook-test' as well? No validations added during webhook-add, it registers whatever the url is added. But logs error while pushing messages on any event.
Have raised bz 1449538 to assess the correctness of the url specified in 'gluster-eventsapi webhook-add' Moving the present BZ to verified in 3.3 with the logs pasted in comment 7 and 8.
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/RHBA-2017:2774