You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The errors occur in random models, different every run.
Downgrading to 2.5.2 resolves this issue.
Logs aren't very clear: Databricks adapter: <class 'databricks.sql.exc.RequestError'>: Error during request to server: Remote end closed connection without response
Please talk to Databricks support so that we can investigate this non-publicly. I'll update this issue with relevant info once we chase down the root cause.
Version 2.6 of the connector uses urllib3 to and connection pools / http 1.1 which is a pretty big change under the hood. It's not clear yet what causes the exception you found. So we need more information about your environment to debug this properly.
I've chased this down. It's hard to do with dbt directly because right now the error messages from databricks-sql-connector are not piped to stdout by dbt (we are going to open a PR against dbt-databricks to fix that -- it's a pesky issue that has blocked several debugging attempts for customers).
The actual error that caused dbt to fall over was:
After some research, I found that the BadStatusLine error is raised by Python's http.client if it reads an unexpected status code from an HTTP response. The specific bytes it found 0\r\n are the trailing bytes of a response sent with transfer-encoding: chunked. The 0\r\n trailing bytes are meant to indicate to the client that "this is the last chunk". It seems that in some cases these trailing bytes are not consumed by thrift in pysql. And since we release our HTTP connection back to the connection pool after each thrift RPC, it could happen that the next RPC would actually read-in the trailing bytes of the previous RPC while expecting to read the status code and headers of the current RPC. This raised an error.
The solution is to specifically drain the connection buffer before releasing the connection back to the pool. I've opened #141 to fix this. We will release an update to dbt-databricks that pins this version.
Activity
susodapop commentedon Jun 8, 2023
Thanks for the report. Do you connect to Databricks through a proxy?
Frunkh commentedon Jun 8, 2023
We do not, just a regular connection to databricks (Azure)
susodapop commentedon Jun 8, 2023
Please talk to Databricks support so that we can investigate this non-publicly. I'll update this issue with relevant info once we chase down the root cause.
Version 2.6 of the connector uses
urllib3to and connection pools / http 1.1 which is a pretty big change under the hood. It's not clear yet what causes the exception you found. So we need more information about your environment to debug this properly.susodapop commentedon Jun 8, 2023
I've chased this down. It's hard to do with dbt directly because right now the error messages from
databricks-sql-connectorare not piped to stdout by dbt (we are going to open a PR against dbt-databricks to fix that -- it's a pesky issue that has blocked several debugging attempts for customers).The actual error that caused dbt to fall over was:
After some research, I found that the
BadStatusLineerror is raised by Python'shttp.clientif it reads an unexpected status code from an HTTP response. The specific bytes it found0\r\nare the trailing bytes of a response sent withtransfer-encoding: chunked. The0\r\ntrailing bytes are meant to indicate to the client that "this is the last chunk". It seems that in some cases these trailing bytes are not consumed bythriftin pysql. And since we release our HTTP connection back to the connection pool after each thrift RPC, it could happen that the next RPC would actually read-in the trailing bytes of the previous RPC while expecting to read the status code and headers of the current RPC. This raised an error.The solution is to specifically drain the connection buffer before releasing the connection back to the pool. I've opened #141 to fix this. We will release an update to dbt-databricks that pins this version.
susodapop commentedon Jun 9, 2023
@Frunkh you can upgrade to
dbt-databricks==1.5.4to capture this update to thedatabricks-sql-connector.