Skip to content

Cannot authenticate to basic cluster #765

@boonware

Description

@boonware

I have created a cluster using the following: ccm create --pwd-auth test --version 4.1.4 --nodes 1 --debug --start

When I try to connect in a Python integration test using the Cassandra default username and password (cassandra/cassandra), I receive the error:

cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1:9042': AuthenticationFailed('Failed to authenticate to 127.0.0.1:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})

My connection code is as follows:

from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
from cassandra.policies import DCAwareRoundRobinPolicy

config = {'cassandra': {'hosts': ['127.0.0.1'], 'username': 'cassandra', 'password': 'cassandra', 'keyspace': 'myKeyspace'}}
cluster = Cluster(hosts, auth_provider=PlainTextAuthProvider(username=config['username'], password=config['password']),
            load_balancing_policy=DCAwareRoundRobinPolicy())
session = cluster.connect(config['keyspace'])

What are the default credentials? How am I supposed to authenticate to the cluster?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions