Skip to content
Latchkey

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.

python
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

  1. Poll with cqlsh until a query succeeds.
  2. Enable developer mode to speed up CI boot.
  3. Start tests only after the probe passes.
Terminal
until cqlsh -e "SELECT now() FROM system.local" 127.0.0.1 9042 >/dev/null 2>&1; do
  echo "waiting for scylla"; sleep 5
done

Run Scylla in developer mode for CI

Developer mode reduces startup checks so the node is ready sooner.

.github/workflows/ci.yml
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 1

How 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.

Frequently asked questions

What causes "ScyllaDB "NoHostAvailable""?
The image runs setup before binding the CQL port; until it logs that it is serving CQL, connections are refused.
How do I fix ScyllaDB "NoHostAvailable"?
Wait for Scylla using cqlsh, then connect

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card