โ02-14-2025 09:56 AM
Hi, i am building an application in Databricks apps, Sometimes when i try to fetch data using Databricks SQL connector in an API, it takes time to hit the SQL warehouse and if the time exceeds more than 60 seconds it gives upstream timeout error. I have monitored the queries once they reach the warehouse it gets executed in milliseconds. The time being taken is to send the query to warehouse for execution and to send back the data to the server. how can this be handled? also this happens only some times.
โ02-16-2025 01:47 PM
Hi @yathish,
When you submit the query to the warehouse, is the warehouse up and running already? and are you using classic, pro or serverless warehouse?
โ02-17-2025 10:49 AM
Hi @Alberto_Umana, yes the server is up and running. I am using serverless warehouse. Thank you!
โ02-17-2025 10:53 AM
def credential_provider():
config = Config(
host=os.getenv('DATABRICKS_HOST'),
client_id=os.getenv("DATABRICKS_CLIENT_ID"),
client_secret=os.getenv("DATABRICKS_CLIENT_SECRET"))
return oauth_service_principal(config)
def db_connector():
connection = sql.connect(
server_hostname=os.getenv('DATABRICKS_HOST'),
http_path=os.getenv('WAREHOUSE_HTTP_PATH'),
credentials_provider=credential_provider)
return connection
and in the api i am using it as
with db_connector() as connection:
with connection.cursor() as cursor:
results = cursor.execute(query).fetchall()
โ02-20-2025 04:22 AM - edited โ02-20-2025 04:39 AM
It is happening to us too! We have a model that call the sql connection and we are getting a lot of this error in the serving endpoint. We also use serveless.
โ02-20-2025 10:33 AM
@Alberto_Umana Can you please let us know if there are any updates on this?
โ06-10-2025 12:44 AM - edited โ06-10-2025 12:57 AM
@Alberto_Umana Any news on this? I am having similar issues and am also using a (running) serverless SQL warehouse.
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!
Sign Up Now