Connecting to Unix domain socket fails · Issue #278 · scylladb/python-driver · GitHub
Skip to content

Connecting to Unix domain socket fails #278

Description

@margdoc

When trying to connect to unix domain socket, python driver throws following error:

Traceback (most recent call last):
  File "/home/margdoc/Workspace/scylla/maintenance_mode_testing.py", line 5, in <module>
    s = c.connect()
        ^^^^^^^^^^^
  File "cassandra/cluster.py", line 1750, in cassandra.cluster.Cluster.connect
  File "cassandra/cluster.py", line 1776, in cassandra.cluster.Cluster.connect
  File "cassandra/cluster.py", line 1763, in cassandra.cluster.Cluster.connect
  File "cassandra/cluster.py", line 3581, in cassandra.cluster.ControlConnection.connect
  File "cassandra/cluster.py", line 3642, in cassandra.cluster.ControlConnection._reconnect_internal
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'test_socket': IndexError('string index out of range')})

In function:


Line:

log.debug('Connection %s %s:%s -> %s:%s', id(self), local_addr[0], local_addr[1], sockaddr[0], sockaddr[1])

Reproducer:

Socket created in a terminal:

nc -lkU test_socket 

Code that uses python driver:

from cassandra.cluster import Cluster
from cassandra.connection import UnixSocketEndPoint

c = Cluster([UnixSocketEndPoint("test_socket")])
s = c.connect()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions