ScyllaDB "NoHostAvailable" connecting to the service container in CI
ScyllaDB speaks the Cassandra CQL protocol, so the same driver raises NoHostAvailable when no node answers on 9042. Scylla images run an init sequence (developer mode, schema setup) before the CQL listener is ready, which is the usual CI race.
What this error means
The driver fails with "NoHostAvailable" or "Connection refused" to 9042 against a Scylla service container, clearing once the node finishes its startup.
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers',
{'127.0.0.1:9042': ConnectionRefusedError(111, 'Connection refused')})Common causes
Scylla is still initializing the node
The image runs setup before binding the CQL port; until it logs that it is serving CQL, connections are refused.
Developer mode startup adds delay
Without --developer-mode 1, Scylla performs extra checks at boot that lengthen the time before the port is ready on a CI container.
How to fix it
Wait for Scylla using cqlsh, then connect
- Poll with
cqlshuntil a query succeeds. - Enable developer mode to speed up CI boot.
- Start tests only after the probe passes.
until cqlsh -e "SELECT now() FROM system.local" 127.0.0.1 9042 >/dev/null 2>&1; do
echo "waiting for scylla"; sleep 5
doneRun Scylla in developer mode for CI
Developer mode reduces startup checks so the node is ready sooner.
services:
scylla:
image: scylladb/scylla:6.0
ports: ['9042:9042']
options: --health-cmd "cqlsh -e 'describe cluster'" --health-interval 10s --health-retries 12
# command override: --developer-mode 1How to prevent it
- Enable developer mode for faster CI startup.
- Gate on a real CQL probe before connecting.
- Allow ample first-boot time on cold runners.