Originally from the User Slack
@Sven**:** Okay thank you Guy, so I ask here.
This is a potential regression, or maybe an intended new breaking behavior, that I found in the Python scylla-driver https://pypi.org/project/scylla-driver/ .
I have a local Docker network with a Scylla 5.4.9 Docker Container running with -developer-mode=1 --io-setup 0 --api-address 0.0.0.0. In the output of docker ps it appears with: 22/tcp, 7000-7001/tcp, 9160/tcp, 9180/tcp, 10000/tcp, 0.0.0.0:9042->9042/tcp, [::]:9042->9042/tcp .
I connect to it using the driver with hostname “localhost” and port 9042 from a pytest running on my local machine, i.e. the test program is running outside of the Docker network. With scylla-driver 3.29.7 it is working.
When I change the scylla-driver Version to 3.29.8 or 3.29.9 (no other changes) there is the following error, note that 127.18.0.3 is an IP address from inside of the Docker network:
scylla_session = scylla_cluster.connect(ks)
^^^^^^^^^^^^^^^^^^^^^^^^^^
cassandra/cluster.py:1735: in cassandra.cluster.Cluster.connect
???
cassandra/cluster.py:1810: in cassandra.cluster.Cluster._new_session
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E cassandra.cluster.NoHostAvailable: ("Unable to connect to any servers using keyspace 'my_keyspace'", ['172.18.0.3'])
cassandra/cluster.py:2595: NoHostAvailable
I have a suspicion that this error comes from changes in how Scylla hosts are resolved or remembered by the Python scylla-driver. I know from other systems (e.g. Kafka) that sometimes there is a notion of an “advertised host”, like, a (set of) hostname(s) or IP address(es) that clients should use to talk to a cluster, maybe Scylla supports something similar?
@Karol_Baryła: Drivers use system.peers and system.local tables to discover hosts to connect to. Make sure that rpc address is an ip that the driver can use to connect to given node.
For example, in our testing setup in Rust Driver, we pass --rpc-address flag to scylla with ip being the one that driver can connect to: https://github.com/scylladb/scylla-rust-driver/blob/main/test/cluster/docker-compose.yml
GitHub: scylla-rust-driver/test/cluster/docker-compose.yml at main · scylladb/scylla-rust-driver