cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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,

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.