You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are in the process of upgrading ZooKeeper from 3.4.6 to 3.6.1. Upon doing so, kazoo.client.KazooClient().server_version() now throws an exception when connected to a zookeeper instance running zookeeper-3.6.1. This previously returned a valid version tuple when connecting to zookeeper-3.4.6
The ZooKeeper servers have been verified to be running. Calls to other KazooClient methods are working as expected, and ZooKeeoer utilities such as zkCli.sh are working as expected. So far, only server_version() is misbehaving.
Expected Behavior
KazooClient.server_version() method returns a valid tuple containing the zookeeper server version
Actual Behavior
A KazooException is thrown (see below).
Snippet to Reproduce the Problem
Python 3.5.6 (default, Nov 16 2018, 15:50:58)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from kazoo.client import KazooClient
>>> kz = KazooClient(hosts='my-zookeeper-server:2181')
>>> kz.start()
>>> kz.server_version()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/hfs/mcp/pyvenv/lib64/python3.5/site-packages/kazoo/client.py", line 787, in server_version
% (1 + max(0, retries)))
kazoo.exceptions.KazooException: Unable to fetch useable server version after trying 4 times
>>>
Zookeeper configuration: put here any useful ZK configuration (authentication, encryption, number of ZK members, number of (concurrent?) clients, Java version, krb5 version, etc.)
no encryption
3 cluster members, all functioning normally
this was discovered in a test environment with only a handful of concurrent clients (<= 10).
java 1.8.0.252
Python version: 3.5.6
OS: CentOS 7
The text was updated successfully, but these errors were encountered:
This is actually due to the new 4lw.commands.whitelist configuration added in Zookeeper 3.5.3 (see the docs). By default only srvr is whitelisted, but envi is required to get the Zookeeper server version. Deploying your Zookeeper servers with 4lw.commands.whitelist=srvr, envi will fix your issue.
I guess we can try to give a little more detail when the server_version() fails (or try to parse the envi is not executed because it is not in the whitelist. response the ZK server sent)
Thank you for investigating and pointing this out. We're coming from ZooKeeper 3.4, where this configuration item didn't exist. I've verified in our setup that whitelisting envi prevents the exception from being thrown.
I agree that a better error message might have helped. I'm not sure it would be necessary to do any parsing on the underlying response message, though. Now that I see it, just forwarding it would, I think, have given me a pretty good starting point.
We are in the process of upgrading ZooKeeper from 3.4.6 to 3.6.1. Upon doing so, kazoo.client.KazooClient().server_version() now throws an exception when connected to a zookeeper instance running zookeeper-3.6.1. This previously returned a valid version tuple when connecting to zookeeper-3.4.6
The ZooKeeper servers have been verified to be running. Calls to other KazooClient methods are working as expected, and ZooKeeoer utilities such as
zkCli.sh
are working as expected. So far, onlyserver_version()
is misbehaving.Expected Behavior
KazooClient.server_version()
method returns a valid tuple containing the zookeeper server versionActual Behavior
A
KazooException
is thrown (see below).Snippet to Reproduce the Problem
Logs with logging in DEBUG mode
N/A
Specifications
pip list
command:The text was updated successfully, but these errors were encountered: