deta-python icon indicating copy to clipboard operation
deta-python copied to clipboard

ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2426) when trying to upload file to Deta drive

Open deepaerial opened this issue 2 years ago • 3 comments

Machine: Docker container from image: python:3.10-bullseye

Deta lbrary version: 1.1.0

Description: Error bellows occurs when I'm trying to upload file to Deta drive:

EOF occurred in violation of protocol (_ssl.c:2426)
Traceback (most recent call last):
  File "/app/./ytdl_api/downloaders.py", line 180, in download
    asyncio.run(self.on_finish_callback(download, converted_file_path))
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/app/./ytdl_api/callbacks.py", line 99, in on_finish_callback
    in_storage_filename = storage.save_download_from_file(download, download_tmp_path)
  File "/app/./ytdl_api/storage.py", line 68, in save_download_from_file
    self.drive.put(download.storage_filename, path=path)
  File "/app/.venv/lib/python3.10/site-packages/deta/drive.py", line 195, in put
    raise e
  File "/app/.venv/lib/python3.10/site-packages/deta/drive.py", line 188, in put
    self._upload_part(name, chunk, upload_id, part, content_type)
  File "/app/.venv/lib/python3.10/site-packages/deta/drive.py", line 137, in _upload_part
    self._request(
  File "/app/.venv/lib/python3.10/site-packages/deta/service.py", line 74, in _request
    res = self._send_request_with_retry(method, url, headers, body)
  File "/app/.venv/lib/python3.10/site-packages/deta/service.py", line 114, in _send_request_with_retry
    self.client.request(
  File "/usr/local/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1077, in _send_output
    self.send(chunk)
  File "/usr/local/lib/python3.10/http/client.py", line 999, in send
    self.sock.sendall(data)
  File "/usr/local/lib/python3.10/ssl.py", line 1237, in sendall
    v = self.send(byte_view[count:])
  File "/usr/local/lib/python3.10/ssl.py", line 1206, in send
    return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2426)

deepaerial avatar Jul 15 '23 10:07 deepaerial

Hey @deepaerial Are you still experiencing this issue?

hozan23 avatar Sep 17 '23 18:09 hozan23

Hey @hozan23 just checked again my code on deta-python version 1.1.0 and I did not manage to reproduce error again.

deepaerial avatar Oct 08 '23 16:10 deepaerial