# Python ScyllaDB Driver, getting an error, NoHostAvailable error, unable to connect, how can I solve this?

**URL:** <https://forum.scylladb.com/t/python-scylladb-driver-getting-an-error-nohostavailable-error-unable-to-connect-how-can-i-solve-this/5349>\
**Category:** ScyllaDB\
**Tags:** drivers, troubleshooting, python\
**Created:** [April 19, 2026, 11:23am UTC](https://forum.scylladb.com/t/python-scylladb-driver-getting-an-error-nohostavailable-error-unable-to-connect-how-can-i-solve-this/5349 "2026-04-19T11:23:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/guy/32/9_2.png) [@Guy](https://forum.scylladb.com/u/Guy)\
**Post date:** [April 19, 2026, 11:23am UTC](https://forum.scylladb.com/t/python-scylladb-driver-getting-an-error-nohostavailable-error-unable-to-connect-how-can-i-solve-this/5349/1 "2026-04-19T11:23:38Z")

</div>

> [@](#):
>
> **[Originally from the User Slack](https://scylladb-users.slack.com/)**
> 
> ![Sven](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/c/c6d734a754ef247591c89cd8852d54acb7e0805c.png) @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/](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:
> 
> ```auto
> 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](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/e/e7789cf73c0ba650b837e4edcae775341e31755c.png) **@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](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
