snowflake-connector-python
snowflake-connector-python copied to clipboard
SNOW-141075: Query request issue : ('Connection aborted.', OSError("(32, 'EPIPE')"))
- What version of Python are you using (
python --version
)?
python3.7
- What operating system and processor architecture are you using (
python -c 'import platform; print(platform.platform())'
)?
Darwin-18.7.0-x86_64-i386-64bit
- What are the component versions in the environment (
pip list
)?
boto3==1.11.17
botocore==1.14.17
pandas==1.0.1
requests=2.22.0
snowflake-connector-python==2.2.1
snowflake-sqlachemy==1.2.1
- What did you do?
df.to_sql( name=table_name, con=connection, if_exists="append", index=False, dtype=col_special_type, chunksize=1000 )
- What did you expect to see?
Data insertion into Snowflake table. The insertion works when the chunksize is set to 1 (the inserted data per chunk is then 8.7 Megabytes).
- What did you see instead?
Broken Pipe issue with an infinite retry connection loop (RetryRequest Exception catched in network.py - line 655 - in snowflake connector package). The size of my dataframe is 47 Megabytes.
Warehouse config: size: Medium clusters: min: 1, max: 4 scaling Policy: Standard auto Suspend: 30 minutes auto Resume: Yes
- Can you set logging to DEBUG and collect the logs?
2020-02-25 10:49:49,495 - MainThread ocsp_snowflake.py:587 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'Arizona'), ('locality_name', 'Scottsdale'), ('organization_name', 'Starfield Technologies, Inc.'), ('common_name', 'Starfield Services Root Certificate Authority - G2')])
2020-02-25 10:49:49,496 - MainThread ocsp_snowflake.py:1123 - validate_by_direct_connection() - DEBUG - using OCSP response cache
2020-02-25 10:49:49,498 - MainThread ocsp_asn1crypto.py:248 - process_ocsp_response() - DEBUG - Certificate is attached in Basic OCSP Response
2020-02-25 10:49:49,498 - MainThread ocsp_asn1crypto.py:250 - process_ocsp_response() - DEBUG - Verifying the attached certificate is signed by the issuer
2020-02-25 10:49:49,498 - MainThread ocsp_asn1crypto.py:254 - process_ocsp_response() - DEBUG - Valid Not After: 2021-12-14 07:00:00+00:00
2020-02-25 10:49:49,500 - MainThread ocsp_asn1crypto.py:282 - process_ocsp_response() - DEBUG - Verifying the OCSP response is signed by the issuer.
2020-02-25 10:49:49,502 - MainThread ocsp_snowflake.py:521 - write_ocsp_response_cache_file() - DEBUG - writing OCSP response cache file
2020-02-25 10:49:49,502 - MainThread ocsp_snowflake.py:1516 - encode_ocsp_response_cache() - DEBUG - encoding OCSP response cache to JSON
2020-02-25 10:49:49,513 - MainThread ocsp_snowflake.py:1014 - _validate() - DEBUG - ok
2020-02-25 10:49:49,581 - MainThread network.py:891 - _request_exec() - DEBUG - Hit retryable client error. Retrying... Ignore the following error stack: ('Connection aborted.', OSError("(32, 'EPIPE')"))
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 320, in _send_until_done
return self.connection.send(data)
File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1737, in send
self._raise_ssl_error(self._ssl, result)
File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1639, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (32, 'EPIPE')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1244, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1290, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1239, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1065, in _send_output
self.send(chunk)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 987, in send
self.sock.sendall(data)
File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 331, in sendall
sent = self._send_until_done(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE])
File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 326, in _send_until_done
raise SocketError(str(e))
OSError: (32, 'EPIPE')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 368, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1244, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1290, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1239, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1065, in _send_output
self.send(chunk)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 987, in send
self.sock.sendall(data)
File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 331, in sendall
sent = self._send_until_done(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE])
File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 326, in _send_until_done
raise SocketError(str(e))
urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError("(32, 'EPIPE')"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/snowflake/connector/network.py", line 799, in _request_exec
auth=SnowflakeAuth(token),
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', OSError("(32, 'EPIPE')"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/snowflake/connector/network.py", line 649, in _request_exec_wrapper
**kwargs)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/snowflake/connector/network.py", line 892, in _request_exec
raise RetryRequest(err)
snowflake.connector.network.RetryRequest: ('Connection aborted.', OSError("(32, 'EPIPE')"))
```
Any word on this issue? I am seeing the same issue for longer jobs - shorter jobs run fine so it's not consistently happening.
To clean up and re-prioritize bugs and feature requests we are closing all issues older than 6 months as of March 1, 2023. If there are any issues or feature requests that you would like us to address, please re-create them. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response