Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot authenticate to basic cluster #765

Open
boonware opened this issue May 7, 2024 · 0 comments
Open

Cannot authenticate to basic cluster #765

boonware opened this issue May 7, 2024 · 0 comments

Comments

@boonware
Copy link

boonware commented May 7, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant