question

dirk.kolb_168857 avatar image
dirk.kolb_168857 asked Erick Ramirez edited

DriverTimeoutException after enabling Auth

Hey guys,

we enabled the authentication and receive now a lot of timeout exceptions:

[s102] Error connecting to /192.168.98.100:9042, trying next node (DriverTimeoutException: [s102|control|id: 0x020ffe2e, L:/192.168.98.1:64338 - R:/192.168.98.100:9042] init query AUTH_RESPONSE: timed out after 500 ms)

We deployed the DSE-Server Docker container within a VirtualMachine. Thus, the 500msec timeout seems to be very small. In the Log files from the Docker container I cannot see any ERROR. There is only a remark that we don't have encryption enabled.

Where are the 500msec defined?

Many thanks,

Dirk

authentication
10 |1000

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

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

@dirk.kolb_168857 the error you posted looks like it is an application error as opposed to an exception generated by the driver so it's hard to know what is going on. If you post the full error/exception from the driver including the stack trace, we'd be able to troubleshoot it better.

Given the DriverTimeoutException, it indicates that the timeout happened on the driver side so check how the driver is configured since it looks like it has a very low timeout value of 500ms. The driver-side timeout should always be set higher than the server-side timeout so the driver does not give up before the server has had a chance to respond. 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.

dirk.kolb_168857 avatar image dirk.kolb_168857 commented ·
com.datastax.oss.driver.api.core.AllNodesFailedException: Could not reach any contact point, make sure you've provided valid addresses (showing first 1, use getErrors() for more: /192.168.98.100:9042: com.datastax.oss.driver.api.core.DriverTimeoutException: [s118|control|id: 0xf3871c17, L:/192.168.98.1:52240 - R:/192.168.98.100:9042] init query AUTH_RESPONSE: timed out after 500 ms)

This is all I get from the DseSession. We are using the DSE Java Driver V.2.1.0. The error is really annoying.

0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ dirk.kolb_168857 commented ·

Sorry, I've only just managed to circle back to this. The 500ms timeout is partly a side-issue.

The real issue here is that the authentication times out after 500ms. My suspicion is that you auth is possibly not configured correctly. It should be quicker than 500ms for nodes to return "invalid user/password" or "not authorised" or whatever.

Is it possible that maybe replication for the system_auth keyspace isn't configured correctly? Cheers!

P.S. You may already know this but I'm noting it here FWIW -- using the default cassandra superuser is expensive since it authenticates with a CL of QUORUM. Use a normal account instead.

1 Like 1 ·
Ryan Quey avatar image
Ryan Quey answered

Regarding your question about where it is configured: It looks like the 500 ms is configured at `application.conf`, under the property `init-query-timeout` (see here for a reference template for this file).

init-query-timeout = 500 milliseconds

I found this configuration through this StackOverflow question in the 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.