Arrovil
Arrovil

Reputation: 945

Connecting from DBeaver using Astra JDBC driver returns "Invalid Credentials"

I need to connect to Astra using DBeaver. I'm following guide https://awesome-astra.github.io/docs/pages/data/explore/dbeaver/#astra-community-jdbc-drivers (exactly "Astra Community JDBC Drivers" section as Simba driver does not support some cqlsh features like describe tables and display some specific tables incorrectly).

I have astra bundle (zip file) and clientId, secret and token

The problem is that I cannot connect any way:

Connection URL is like this:

jdbc:astra://some-long-aws-url.com:29080/my_keyspace;AuthMech=2;TunableConsistency=6;SecureConnectionBundlePath=/Users/user/astra/astra-bundle.zip

Also I've tried to use AuthMech as 1 / 2 / 3, do not set URL(as it exists in bundle) like jdbc:astra://;AuthMech=... but nothing helps.

It's not network issue as I can connect using commandline cqlsh-astra package as well as using Simba drivers.

Upvotes: 0

Views: 305

Answers (1)

Erick Ramirez
Erick Ramirez

Reputation: 16293

It looks like you have configured the wrong JDBC URL, probably because you tried using the Astra JDBC driver and run into issues then you tried using the Simba driver which uses a completely different JDBC URL.

I managed to connect to my Astra DB instance using the Astra JDBC driver by following the instructions on the Awesome Astra document you linked in your post.

Please try to configure a new DB connection but this time using the JDBC URL with the form:

jdbc:astra://db_name/keyspace_name

To use mine as an example, my database is named community and I have a keyspace named stackoverflow so my JDBC URL is:

jdbc:astra://community/stackoverflow

enter image description here

As a side note, I was able to replicate the issue you had by deleting the first character in my token to get the errors:

Unexpected driver error occurred while connecting to the database
  Error in HTTP Request: Error Code=401, (HTTP_UNAUTHORIZED) Invalid Credentials Check your token: {"errors":[{"ID":340002,"message":"no bearer token in request"}]}
  Error in HTTP Request: Error Code=401, (HTTP_UNAUTHORIZED) Invalid Credentials Check your token: {"errors":[{"ID":340002,"message":"no bearer token in request"}]}
    Error Code=401, (HTTP_UNAUTHORIZED) Invalid Credentials Check your token: {"errors":[{"ID":340002,"message":"no bearer token in request"}]}

Verify that you have entered your token correctly. It should be the of the form AstraCS:AbC...XYz:123...edf0. Cheers!

Upvotes: 0

Related Questions