This Issue resolved:

 

Since I only had Python 3.6 installed on my machine cqlsh was referring to some 
default location when it tried to call python2.7 libraries.

Obviously these libraries did not have all the dependencies installed for cqlsh.

 

In order to make a valid environment for cqlsh to operate,I had to install a 
python2.7 along with dependent packages (cqlsh and Cassandra-driver) locally on 
the server.

Basically 2 python versions at the same time.

 

Once this was done I had to hide the python2.7 path behind the python3.6 path 
before pytest are initiated.

export PATH=$PYTHON3_INSTALL_PATH/bin:$PYTHON27_INSTALL_PATH/bin:$PATH

 

This seems to have resolved the issue.

 

From: Rajiv Dimri 
Sent: Thursday, May 10, 2018 11:52 AM
To: user@cassandra.apache.org
Subject: RE: dtests failing with - ValueError: unsupported hash type md5

 

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 <HYPERLINK 
"mailto:k...@instaclustr.com"k...@instaclustr.com> 
Sent: Thursday, May 10, 2018 11:37 AM
To: User <HYPERLINK "mailto:user@cassandra.apache.org"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 <HYPERLINK 
"mailto:rajiv.di...@oracle.com"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 HYPERLINK 
"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="https://github.com/apache/cassandra-dtest
 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