-
Notifications
You must be signed in to change notification settings - Fork 25
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
Can't connect to Astra with "Connection was established but closed as invalid" #67
Comments
Hello @tjlee, Could you try with this connection string: It's a little bit confusing to have a successful connection test and a info-level message saying "Connection is invalid"... If there is an error, it seems this one is swallowed here by DataGrip and not displayed neither in the logs, nor in the interface. Maybe, it's possible to set a lower log level to have more details. |
I've tried with the suggested JDBC URL with an extending loggin (by the way, I've got NPE:
|
Hello @tjlee, |
Hello @tjlee, Applying the changes included in this commit, I was able to successfully connect to an AstraDB instance using the following simple code snippet with the different connection strings mentioned hereinafter: public class Application {
public static void main(String[] args) throws Exception {
CassandraConnection conn = getAstraConnection();
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery("SELECT release_version FROM system.local");
System.out.println("VERSION: " + rs.getString(1));
rs.close();
statement.close();
conn.close();
System.exit(0);
}
public static CassandraConnection getAstraConnection() throws Exception {
Class.forName("com.ing.data.cassandra.jdbc.CassandraDriver");
String urlAstra = "jdbc:cassandra://dbaas/kscloud_test?user=token&password=AstraCS:$$TOKEN$$&secureconnectbundle=/tmp/secure-connect-kscloud-test.zip";
return (CassandraConnection) DriverManager.getConnection(urlAstra);
}
} The tested JDBC URLs:
The result of the executed code, in both cases, was:
Let me know if the fix helps in your case. |
@maximevw , thank you for your investigation. Firstly I thought I messed up JDBC URL but with your code snippet I could connect to both instances. Secondly, I can confirm, that Test Connection works for But, no more. I've got the same error The new log:
|
Hello @tjlee, Thank you for providing these new logs, I see an interesting error inside them: I got this issue once during my tests. By default, the request timeout is 2 seconds, but sometimes AstraDB takes more than 2 seconds to respond. So, you can try to add the following parameter to your JDBC URL: You can also specify a |
Thank you for your help. I've tried with suggested parameters. Still can't execute any query. Got the following in the log:
|
@tjlee Hmmm... we're back to the start. I'll be happy to fix the root cause of the error if it's due to a bug in this JDBC driver, but unfortunately, I have no clue on it for the moment. Maybe @kornilova203 could help to understand what is happening here. |
Yes, it could be an error in DataGrip itself. Let's wait for an answer from @kornilova203 |
Hi,
I'm using the latest JDBC driver and trying to connect to Astra. I was trying to connect to Vector and general ones.
URL:
jdbc:cassandra://dbaas/another_datagrip?user=token&password=AstraCS:$$TOKEN$$&secureconnectbundle=/Users/vasilii.chernov/Projects/secure-connect-another-datagrip.zip
Test Connection

Log chunk
Is there any way to get more details to identify the root cause?
The text was updated successfully, but these errors were encountered: