There may be some unstated environmental dependencies at issue here. If you
run the dtests on an Ubuntu 16.04 LTS environment with the configuration
described in the dtest README.md, then when you run cqlsh by calling the a
ccm Node object's run_cqlsh() function, it will run cqlsh with Python 2.7.
For example, in this kind of environment, I was able to run
cql_tracing_test.py successfully on trunk and cassandra-3.11.

The error you're experiencing is interesting. I did an experiment on an
environment without Python 2.7, and when I tried to run the
cql_tracing_test dtests, I got errors like this instead:
    <class 'ccmlib.node.ToolError'>
    Subprocess ['cqlsh', 'TRACING ON', None] exited with non-zero status;
exit status: 1;
stderr: No appropriate python interpreter found.

In contrast, the errors you posted look like trying to run the Python 2.7
scripts in a Python 3.x interpreter. Are you testing with a modified
version of cqlsh? Or, do you have a "python2.7" in your path that points to
Python 3.x?

Patrick Bannister



On Thu, May 10, 2018 at 2:22 AM, Rajiv Dimri <rajiv.di...@oracle.com> wrote:

> Thank you for the response,
>
>
>
> Single test command
>
> pytest --cassandra-dir=$CASSANDRA_HOME cql_tracing_test.py::
> TestCqlTracing::test_tracing_simple
>
>
>
> pytest is being run from within the virtual env (Python 3.6.5)
>
> however cqlsh is a part of Cassandra distribution present in
> $CASSANDRA_HOME/bin
>
> Even if I install cqlsh in the virtualenv, node.py in ccmlib will pick
> cqlsh present in the Cassandra source directory.
>
>
>
> *From:* kurt greaves <k...@instaclustr.com>
> *Sent:* Thursday, May 10, 2018 11:37 AM
> *To:* User <user@cassandra.apache.org>
> *Subject:* Re: dtests failing with - ValueError: unsupported hash type md5
>
>
>
> What command did you run? Probably worth checking that cqlsh is installed
> in the virtual environment and that you are executing pytest from within
> the virtual env.
>
>
>
> On 10 May 2018 at 05:06, Rajiv Dimri <rajiv.di...@oracle.com> wrote:
>
> Hi All,
>
>
>
> We have setup a dtest environment to run against Cassandra db version
> 3.11.1 and 3.0.5
>
> As per instruction on https://github.com/apache/cassandra-dtest
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_cassandra-2Ddtest&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=upnXohQU-Prt8noQKNsgGweRpR-6zqCD_G43z-KiGAY&m=edPZKKf-HAxUyTYlDyt3iCMAFmUdLAoET9BZE00hZ3o&s=8cTnSjXdX2IoD95YkkFKRGCRj5KwXGGSzZke8KLO_ag&e=>
> we have setup the environment with python 3.6.5 along with other
> dependencies.
>
> The server used is Oracle RHEL (Red Hat Enterprise Linux Server release
> 6.6 (Santiago))
>
>
>
> During the multiple tests are failing with specific error as mentioned
> below.
>
>
>
> process = <subprocess.Popen object at 0x7fe4783f23c8>, cmd_args =
> ['cqlsh', 'TRACING ON', None]
>
>
>
>     def handle_external_tool_process(process, cmd_args):
>
>         out, err = process.communicate()
>
>         rc = process.returncode
>
>
>
>         if rc != 0:
>
> >           raise ToolError(cmd_args, rc, out, err)
>
> E           ccmlib.node.ToolError: Subprocess ['cqlsh', 'TRACING ON',
> None] exited with non-zero status; exit status: 1;
>
> E           stderr: ERROR:root:code for hash md5 was not found.
>
> E           Traceback (most recent call last):
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 139, in <module>
>
> E               globals()[__func_name] = __get_hash(__func_name)
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>
> E               raise ValueError('unsupported hash type ' + name)
>
> E           ValueError: unsupported hash type md5
>
> E           ERROR:root:code for hash sha1 was not found.
>
> E           Traceback (most recent call last):
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 139, in <module>
>
> E               globals()[__func_name] = __get_hash(__func_name)
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>
> E               raise ValueError('unsupported hash type ' + name)
>
> E           ValueError: unsupported hash type sha1
>
> E           ERROR:root:code for hash sha224 was not found.
>
> E           Traceback (most recent call last):
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 139, in <module>
>
> E               globals()[__func_name] = __get_hash(__func_name)
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>
> E               raise ValueError('unsupported hash type ' + name)
>
> E           ValueError: unsupported hash type sha224
>
> E           ERROR:root:code for hash sha256 was not found.
>
> E           Traceback (most recent call last):
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 139, in <module>
>
> E               globals()[__func_name] = __get_hash(__func_name)
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>
> E               raise ValueError('unsupported hash type ' + name)
>
> E           ValueError: unsupported hash type sha256
>
> E           ERROR:root:code for hash sha384 was not found.
>
> E           Traceback (most recent call last):
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 139, in <module>
>
> E               globals()[__func_name] = __get_hash(__func_name)
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>
> E               raise ValueError('unsupported hash type ' + name)
>
> E           ValueError: unsupported hash type sha384
>
> E           ERROR:root:code for hash sha512 was not found.
>
> E           Traceback (most recent call last):
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 139, in <module>
>
> E               globals()[__func_name] = __get_hash(__func_name)
>
> E             File "/ade_autofs/ade_infra/nfsdo_
> linux.x64/PYTHON/2.7.8/LINUX.X64/141106.0120/python/lib/python2.7/hashlib.py",
> line 91, in __get_builtin_constructor
>
> E               raise ValueError('unsupported hash type ' + name)
>
> E           ValueError: unsupported hash type sha512
>
> E           Traceback (most recent call last):
>
> E             File "/scratch/dtest/workspace/cassandra-3.11/bin/cqlsh.py",
> line 153, in <module>
>
> E               from cassandra.cluster import Cluster
>
> E             File "/scratch/dtest/workspace/cassandra-3.11/bin/../lib/
> cassandra-driver-internal-only-3.10.zip/cassandra-
> driver-3.10/cassandra/cluster.py", line 61, in <module>
>
> E             File "/scratch/dtest/workspace/cassandra-3.11/bin/../lib/
> cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/metadata.py",
> line 19, in <module>
>
> E           ImportError: cannot import name md5
>
>
>
> It seems like cqlsh is trying to refer to python 2.7 libraries even though
> the virtualenv for dtests is pointing to python 3.6.5
>
> Any test case invoking cqlsh sub process is failing with the error above.
>
>
>
> Could you please suggest a solution to the error mentioned above.
>
>
>
> Regards,
>
> Rajiv
>
>
>

Reply via email to