typedb-driver icon indicating copy to clipboard operation
typedb-driver copied to clipboard

Misleading error when connecting to a cluster w/o encryption

Open izmalk opened this issue 1 year ago • 1 comments

Description

The Python client requires mandatory encryption enabled on the TypeDB Cluster server to be able to connect. If the encryption on the server is disabled you get the error message like that:

E0320 12:00:47.322331000 4606785024 ssl_transport_security.cc:1501]    Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
Traceback (most recent call last):

Environment

  1. OS (where TypeDB server runs): macOS 12.6.3
  2. TypeDB version (and platform): 2.16.1
  3. Other environment details:

Reproducible Steps

  1. Start a TypeDB cluster. Do not set encryption = True (it is set to False by default).
  2. Try to connect with the Python client to a TypeDB Cluster with the default config (Encryption = False).

Expected Output

Something about TypeDB Cluster does not have Encryption enabled. Or TypeDB Cluster failed to provide any suitable encryption method. Check the servers configuration.

Actual Output

Fetching list of cluster servers from 127.0.0.1:1729...
E0321 18:32:32.646661000 4612298240 ssl_transport_security.cc:1501]    Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
Traceback (most recent call last):
  File "/Users/vladimir/Documents/GitHub/typedb_test_queries/cluster.py", line 10, in <module>
    with TypeDB.cluster_client("127.0.0.1:1729", credentials) as client:  # Connect to TypeDB cluster
  File "/Users/vladimir/Library/Python/3.9/lib/python/site-packages/typedb/client.py", line 76, in cluster_client
    return _ClusterClient([addresses], credential, parallelisation)
  File "/Users/vladimir/Library/Python/3.9/lib/python/site-packages/typedb/connection/cluster/client.py", line 42, in __init__
    self._server_clients: Dict[str, _ClusterServerClient] = {addr: _ClusterServerClient(addr, credential, parallelisation) for addr in self._fetch_server_addresses(addresses)}
  File "/Users/vladimir/Library/Python/3.9/lib/python/site-packages/typedb/connection/cluster/client.py", line 62, in _fetch_server_addresses
    raise TypeDBClientException.of(CLUSTER_UNABLE_TO_CONNECT, ",".join(addresses))
typedb.common.exception.TypeDBClientException: Client Error: Unable to connect to TypeDB Cluster. Attempted connecting to the cluster members, but none are available: '127.0.0.1:1729'.

Additional information

izmalk avatar Mar 21 '23 18:03 izmalk

The very same error happens to be if we try to connect to a TypeDB server with a cluster_client method.

izmalk avatar Mar 22 '23 17:03 izmalk