iterative / PyDrive2

Google Drive API Python wrapper library. Maintained fork of PyDrive.
https://docs.iterative.ai/PyDrive2
Other
565 stars 70 forks source link

ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2427) #320

Closed pgtruong closed 7 months ago

pgtruong commented 8 months ago

Trying to upload a large file to a shared google drive (about 4.5 gb). This used to be intermittent before but is now consistently occurring. I am running on a docker image (python:3.11) and am unsure why this is occurring. I've tried retrying the calls and made sure the packages were all up-to-date. Currently using ServiceAuth as well. This has been working for awhile but has just now been erroring out.

  file.Upload(param={"supportsAllDrives": True})
File "/usr/local/lib/python3.11/site-packages/pydrive2/files.py", line 516, in Upload
  self._FilesInsert(param=param)
File "/usr/local/lib/python3.11/site-packages/pydrive2/auth.py", line 84, in _decorated
  return decoratee(self, *args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pydrive2/files.py", line 713, in _FilesInsert
  .execute(http=self.http)
   ^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
  return wrapped(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/googleapiclient/http.py", line 902, in execute
  _, body = self.next_chunk(http=http, num_retries=num_retries)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
  return wrapped(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/googleapiclient/http.py", line 1084, in next_chunk
  resp, content = http.request(
                  ^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/oauth2client/transport.py", line 173, in new_request
  resp, content = request(orig_request_method, uri, method, body,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/oauth2client/transport.py", line 280, in request
  return http_callable(uri, method=method, body=body, headers=headers,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httplib2/__init__.py", line 1724, in request
  (response, content) = self._request(
                        ^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httplib2/__init__.py", line 1444, in _request
  (response, content) = self._conn_request(conn, request_uri, method, body, headers)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httplib2/__init__.py", line 1367, in _conn_request
  conn.request(method, request_uri, body, headers)
File "/usr/local/lib/python3.11/http/client.py", line 1294, in request
  self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1340, in _send_request
  self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1289, in endheaders
  self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1087, in _send_output
  self.send(chunk)
File "/usr/local/lib/python3.11/http/client.py", line 1009, in send
  self.sock.sendall(data)
File "/usr/local/lib/python3.11/ssl.py", line 1274, in sendall
  v = self.send(byte_view[count:])
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/ssl.py", line 1243, in send
  return self._sslobj.write(data)
         ^^^^^^^^^^^^^^^^^^^^^^^^
15:34:53  ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2427)
shcheklein commented 8 months ago

Tbh, can be a lot of reasons, most likely not related to PyDrive itself, but rather some specific misconfiguration / incompatibility in SSL stack (which is pain).

I've tried to reproduce on my end:

Screenshot 2023-12-15 at 6 38 39 PM

DVC is using PyDrive internally.

Screenshot 2023-12-15 at 6 39 01 PM

What else am I missing here?

shcheklein commented 7 months ago

Closing for now.