Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOF occured in violation of protocol -- From EC2 AWS #237

Closed
bertello72 opened this issue Jan 30, 2024 · 5 comments
Closed

EOF occured in violation of protocol -- From EC2 AWS #237

bertello72 opened this issue Jan 30, 2024 · 5 comments

Comments

@bertello72
Copy link

bertello72 commented Jan 30, 2024

I got this error message executing the code in Ec2 AWS Linux Ubuntu 22.04.2 (not locally): [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)

Replicate v. 0.23.1

Error log:

Traceback (most recent call last):
  File "/home/ubuntu/News/LLM_confronto.py", line 42, in generate_summary
    for event in replicate.stream(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/replicate/stream.py", line 200, in stream
    with client._client.stream("GET", url, headers=headers) as response:
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_client.py", line 871, in stream
    response = self.send(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_client.py", line 915, in send
    response = self._send_handling_auth(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_client.py", line 943, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_client.py", line 980, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_client.py", line 1016, in _send_single_request
    response = transport.handle_request(request)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/replicate/client.py", line 258, in handle_request
    response = self._wrapped_transport.handle_request(request)  # type: ignore
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 230, in handle_request
    with map_httpcore_exceptions():
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 84, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)
@mattt
Copy link
Contributor

mattt commented Jan 30, 2024

Hi, @bertello72. Is this happening every time? Intermittently? Just a one-off?

@bertello72
Copy link
Author

bertello72 commented Jan 30, 2024 via email

@mattt
Copy link
Contributor

mattt commented Jan 30, 2024

@bertello72 Thanks for clarifying. Searching around for that error message, it sounds like the problem can be resolved by upgrading your installation of OpenSSL or nginx (if you're using that). See this SO thread.

@bertello72
Copy link
Author

i haven't used nginx and I've checked OpenSSL; it's the latest available in AWS EC2 Amazon Linux.

AWS Service Support gave me this advice:

<<I did researched about the error "[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)" and found that it might be related to SSL/TLS mismtach between server and hosts. I have got information from below external source:
https://community.cisco.com/t5/radkit-discussions/getting-conda-error-encountered-an-ssl-error-most-likely-a/td-p/4873809>>

Does it rise in your mind some insights on how to fix the problem?

@mattt
Copy link
Contributor

mattt commented Jul 18, 2024

@bertello72 According to python/cpython#110467, this appears to be a problem with Python 3.10. I'd recommend upgrading to a newer version of Python.

Since this doesn't appear to be a problem with the Replicate client library itself, I'll go ahead and close this issue for now.

@mattt mattt closed this as completed Jul 18, 2024
@mattt mattt closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants