cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting [08S01/500593] Can't connect to database - [Databricks][JDBCDriver](500593) Communication

Saubhik
New Contributor III

I am getting below error connecting a databricks instance using JDBC driver .

ERROR: [08S01/500593] Can't connect to database - [Databricks][JDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: HTTP Response code: 401, Error message: Invalid Authorization .

Is there anything setup/Network policy that we need to complete in Databricks to enable inbound requests?

We are able to connect databricks instance using DBeaver?

6 REPLIES 6

szymon_dybczak
Esteemed Contributor III

Hi @Saubhik ,

You're trying to connect DBeaver to Databricks? If so, yes it is possible. Here's a detailed guide how to do that.

DBeaver integration with Azure Databricks - Azure Databricks | Microsoft Learn

It doesn't look like a network issue. JDBC client is able to reach Databricks. At first glance it looks like authentication issue. What type of authentication do you use in configuration?

Dbeaver is fine..We are able to access..

But not able to connect Databricks instance from JDBC driver.

Getting below error while tesing the connection...

ERROR: [08S01/500593] Can't connect to database - [Databricks][JDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: HTTP Response code: 401, Error message: Invalid Authorization .

We are passing host, port, user ID(token), token pwd, transportMode=http;ssl=1;AuthMech=3;httpPath=/sql/1.0 as configuration option...

Is there anyting we are missing?

szymon_dybczak
Esteemed Contributor III

You need to provide us more details. The Databricks JDBC driver support following authentication types. Which one do you use?

szymon_dybczak_0-1754035092668.png

I think you have misconfigured something. For example, you're using AuthMech=3, but no authentication types from below documentation are using that type of AuthMech (they use AuthMech=11). 
Here's an example of jdbc url from documentation  for OAuth 2.0 authentication type:

jdbc:databricks://<server-hostname>:443;httpPath=<http-path>;AuthMech=11;Auth_Flow=0;Auth_AccessToken=<oauth-token>

Authentication settings for the Databricks JDBC Driver - Azure Databricks | Microsoft Learn

Saubhik
New Contributor III

sorry for responding back couple of months...tried all the options...both Authmech=11 and 3 ,ss1=1,transportMode=http and httpPath in the connection string...

Still getting ERROR: [08S01/500593] Can't connect to database - [Databricks][JDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: HTTP Response code: 401, Error message: Invalid Authorization

I am using User as Token and Password as tokenkey

While I am able to connect using Telnet...But getting the above-mentioned error connecting Databricks using JDBC driver.

any help would be appreciated.

Chiran-Gajula
New Contributor

Hi Saubhik,

  • Try copying the cacerts file to JDK (Eg: ~\OpenJDK<version>\lib\security) this will help ssl on connectivity which might related to 401 error.
  • Set PATH (Eg: PATH=~\OpenJDK<version>\bin;%PATH%)

  • Then try this jdbc format :
    - jdbc:databricks://<hostname>:443/default;transportMode=http;ssl=1;httpPath=<Full path for sql protocal>;AuthMech=3;UID=token;PWD=
  • Set correct Java home if you have multiple versions (Eg: set JAVA_HOME=~\OpenJDK<version>)

 

G.Chiranjeevi

Saubhik
New Contributor III

I am trying to connect Databricks from Mainframe z/OS using JDBC driver and using below IBM Java version 

java version "11.0.26" 2025-01-21
IBM Semeru Runtime Certified Edition for z/OS 11.0.26.0 (build 11.0.26+4)
IBM J9 VM 11.0.26.0 (build z/OS-Release-11.0.26.0-b01, JRE 11 z/OS s390x-64-Bit Compressed References 20250204_344 (JIT enabled, AOT enabled)
OpenJ9 - 91e0d2a511b
OMR - 004424d5d94
IBM - 4e0e2df
JCL - 1cfe84b6cc2 based on jdk-11.0.26+4)

tried Auth_mech=3; Auth_flow=0; UID=token and Token value in connection string..

getting below error while connecting:

WARN - connect: SQL State08S01, code 500593
ERROR: [08S01/500593] Can't connect to database - [Databricks][JDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: HTTP Response code: 401, Error message: Invalid Authorization.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now