cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption.

Kazer
New Contributor III

Hi. I am trying to read from our Microsoft SQL Server from Azure Databricks via spark.read.jdbc() as described here: Query databases using JDBC - Azure Databricks | Microsoft Learn. The SQL Server is on an Azure VM in a virtual network peered with the virtual network of the azure databricks workspace.

The reading/writing used to work without problems. Last week, I started to get the error message when manually triggering the function in a notebook:

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target".

The weird thing is: In my automated databricks workflow I also use read/write operations. The first read and write operation work as usual, but the second read operation is stuck without throwing an error. If I don't manually cancel the run, the function will just be stuck for hours.

Would be glad if sombody could give me a hint at what the problem could be?

1 ACCEPTED SOLUTION

Accepted Solutions

Kazer
New Contributor III

Solved. The problem was that some of the tables I tried to access were blocked by a transaction in a stuck stored procedure. So this was an SQL Server side problem specific for the tables I tried to access and had nothing to do with Azure/Databricks.

View solution in original post

2 REPLIES 2

Kazer
New Contributor III

Solved. The problem was that some of the tables I tried to access were blocked by a transaction in a stuck stored procedure. So this was an SQL Server side problem specific for the tables I tried to access and had nothing to do with Azure/Databricks.

databricks26
New Contributor II

Hi @Kazer ,
Even if I use a new table name, I get the same error. Do you have any suggestions?

Thanks,

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group