I'm trying to connect cassandraDB using python. I have used authentication as PlainTextAuthProvider. This is my code snippet.

auth_provider = PlainTextAuthProvider(username="foo", password="bar")
cluster = Cluster([1.1.1.1], protocol_version=2, auth_provider=auth_provider)
session = cluster.connect()
session.set_keyspace('keyspace')
cluster.connect()

It's throwing following error:

An authentication challenge was not sent, this is suspicious because the driver expects authentication (configured authenticator = PlainTextAuthenticator)

1

There are 1 best solutions below

0
On

That's PYTHON-940, added in version 3.14.0 of the driver. It should not be throwing the error, but warning if the connection occurs without auth. The intent is to flag when a client configures, and expects to be using auth, but the server is not. Verify auth settings in cassandra.yaml, and check that it's mentioned in system.log at startup.