cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: Databricks Apps timeout when connecting to SQL Warehouses, but same connection works locall

johnv
New Contributor II

Problem: Databricks Apps timeout when connecting to SQL Warehouses, but same connection works locally. First Databricks App I've attempted to create.  Symptoms:

  • Local Streamlit app works fine with Databricks SQL connector
  • Deployed Databricks App hangs while attempting connection to the data warehouse
  • Same server_hostnamehttp_path
  • App runs as service principal, local runs as user account

Technical Details:

  • Using databricks-sql-connector Python package
  • Unity Catalog (makena_dev.default)
  • Pro SQL Warehouse (not Serverless)
  • App has "Can Use" warehouse permissions, it also has access to the catalog, schema and specific table
  • Connection timeout after 30-90 seconds

One thing I noticed is if I log into the Databricks GUI, it says my catalog is "hive_metastore". I added some diags in the application and it also says "hive_metastore" is catalog when I run locally.
Feel free to ask additional questions!!!

2 REPLIES 2

jamesl
Databricks Employee
Databricks Employee

Hi @johnv

Do you have any error messages you can share, or is it a silent connection timeout? I assume you confirmed that the SQL Warehouse had started up? (they can take several minutes to start up sometimes)

If that's not the issue, you could also confirm that the SQL Warehouse is UC enabled. Or, the networking path between the App and the warehouse might be restricted somehow -- maybe try connecting to a Serverless SQL Warehouse as a test.

-James

johnv
New Contributor II

It is a silent timeout. No error messages. We have tried both regular ware houses and serverless. The App has access to both ware houses. The ware houses started up. 

"If that's not the issue, you could also confirm that the SQL Warehouse is UC enabled. Or, the networking path between the App and the warehouse might be restricted somehow -- maybe try connecting to a Serverless SQL Warehouse as a test."

This may be an issue. Let me look into it. 

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