Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

resolve123_170609 avatar image
resolve123_170609 asked Erick Ramirez commented

Node requires authentication (org.apache.cassandra.auth.PasswordAuthenticator), but no authenticator configured)

I upgraded my scala app to java driver 4.x. Application is working fine and i do not see any issue but in logs i am getting the warning as below

AuthenticationException: Authentication error on node /96.x.x.x:9042: Node /96.x.x.x:9042 requires authentication (org.apache.cassandra.auth.PasswordAuthenticator), but no authenticator configured)

java driver
1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

this error starts from

com.datastax.oss.driver.internal.core.control.ControlConnection - [s0] Authentication error (AuthenticationException:

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

The exception indicates that there is a mismatch between your application and the cluster configuration. The node is configured with authentication enabled but you haven't configured your app with the authentication details.

If the nodes have authentication enabled in cassandra.yaml:

authenticator: PasswordAuthenticator

then you need to configure the driver with an authentication provider. For example:

datastax-java-driver {
  advanced.auth-provider {
    class = PlainTextAuthProvider
    username = user
    password = pass
  }
}

or programatically:

AuthProvider authProvider = new ProgrammaticPlainTextAuthProvider("user", "pass");

CqlSession session =
    CqlSession.builder()
        .withAuthProvider(authProvider)
        .build();

For details, see Authentication with the Java driver. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks that resolve the issue. Just curious why connection was established. I just did not give class = PlainTextAuthProvider in config file. Connection was created i was able to fetch data only thing there were warnings.

0 Likes 0 ·

Do you have authentication enabled on all the nodes in the cluster?

0 Likes 0 ·