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
0.8.0 introduced a buffer for HTTP streaming/chunked queries. This feature breaks integration with some types of ClickHouse proxies. For example a popular chproxy is affected.
The reason is simple. chproxy returns non-chunked response with a valid content-length and no transfer-encoding header.
urllib3.exceptions.ResponseNotChunked: Response is not chunked. Header 'transfer-encoding: chunked' is missing.
There's no way to walk around this buffer.
I understand that this lib is for ClickHouse and chproxy might be out of scope, but there's some hope :)
../../clickhouse_connect/driver/client.py:218: in query
return self._query_with_context(query_context)
../../clickhouse_connect/driver/httpclient.py:237: in _query_with_context
query_result = self._transform.parse_response(byte_source, context)
../../clickhouse_connect/driver/transform.py:68: in parse_response
first_block = get_block()
../../clickhouse_connect/driver/transform.py:33: in get_block
num_cols = source.read_leb128()
../../clickhouse_connect/driver/buffer.py:65: in read_leb128
b = self.read_byte()
../../clickhouse_connect/driver/buffer.py:51: in read_byte
chunk = next(self.gen, None)
../../clickhouse_connect/driver/httputil.py:232: in buffered
chunk = next(read_gen, None) # Always try to read at least one chunk if there are any left
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib3.response.HTTPResponse object at 0x12840c970>, amt = 1048576
decode_content = False
def read_chunked(
self, amt: int | None = None, decode_content: bool | None = None
) -> typing.Generator[bytes, None, None]:
self._init_decoder()
# FIXME: Rewrite this method and make it a class with a better structured logic.
if not self.chunked:
> raise ResponseNotChunked(
"Response is not chunked. "
"Header 'transfer-encoding: chunked' is missing."
)
E urllib3.exceptions.ResponseNotChunked: Response is not chunked. Header 'transfer-encoding: chunked' is missing.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed report. I suspect that chproxy "unchunks" the responses as part of its caching approach and the library should definitely support that. My apologies for missing that use case. We should have a fix in the next day or two.
0.8.0 introduced a buffer for HTTP streaming/chunked queries. This feature breaks integration with some types of ClickHouse proxies. For example a popular chproxy is affected.
The reason is simple. chproxy returns non-chunked response with a valid
content-length
and notransfer-encoding
header.There's no way to walk around this buffer.
I understand that this lib is for ClickHouse and chproxy might be out of scope, but there's some hope :)
Steps to reproduce
Expected behaviour
Code example
clickhouse-connect logs
The text was updated successfully, but these errors were encountered: