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

Uncaught AttributeError in sendchat.py line 30 #1642

Closed
dyrhus opened this issue Sep 22, 2024 · 1 comment
Closed

Uncaught AttributeError in sendchat.py line 30 #1642

dyrhus opened this issue Sep 22, 2024 · 1 comment

Comments

@dyrhus
Copy link

dyrhus commented Sep 22, 2024

Aider version: 0.56.1
Python version: 3.12.1
Platform: Linux-6.5.0-1025-azure-x86_64-with-glibc2.31
Python implementation: CPython
Virtual environment: No
OS: Linux 6.5.0-1025-azure (64bit)
Git version: git version 2.46.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "default.py", line 72, in map_httpcore_exceptions
    yield
  File "default.py", line 236, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "connection_pool.py", line 216, in handle_request
    raise exc from None
  File "connection_pool.py", line 196, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "connection.py", line 99, in handle_request
    raise exc
  File "connection.py", line 76, in handle_request
    stream = self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "connection.py", line 154, in _connect
    stream = stream.start_tls(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sync.py", line 152, in start_tls
    with map_exceptions(exc_map):
  File "contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "chat.py", line 725, in make_sync_call
    response = client.post(
               ^^^^^^^^^^^^
  File "http_handler.py", line 373, in post
    raise e
  File "http_handler.py", line 356, in post
    response = self.client.send(req, stream=stream)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_client.py", line 926, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_client.py", line 954, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_client.py", line 991, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_client.py", line 1027, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "default.py", line 235, in handle_request
    with map_httpcore_exceptions():
  File "contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "default.py", line 89, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 1586, in completion
    response = anthropic_chat_completions.completion(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "chat.py", line 1117, in completion
    completion_stream = make_sync_call(
                        ^^^^^^^^^^^^^^^
  File "chat.py", line 736, in make_sync_call
    raise AnthropicError(status_code=500, message=str(e))
litellm.llms.anthropic.chat.AnthropicError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 1124, in send_message
    continue
  File "base_coder.py", line 1396, in send
    self.stream,
                 
  File "sendchat.py", line 86, in send_completion
  File "utils.py", line 1086, in wrapper
    raise e
  File "utils.py", line 974, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "main.py", line 2847, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "utils.py", line 8194, in exception_type
    raise e
  File "utils.py", line 6680, in exception_type
    raise litellm.InternalServerError(
litellm.exceptions.InternalServerError: litellm.InternalServerError: AnthropicException - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000). Handle with `litellm.InternalServerError`.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 698, in main
    return 1
  File "base_coder.py", line 735, in run
    return self.io.get_input(
                ^^^^^^^^^^^^^^
  File "base_coder.py", line 778, in run_one
    def check_for_urls(self, inp):
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1126, in send_message
    interrupted = True
       ^^^^^^^^^^^^^^^^
  File "sendchat.py", line 30, in retry_exceptions
    litellm.llms.anthropic.chat.AnthropicError,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'litellm.llms.anthropic' has no attribute 'AnthropicError'

@paul-gauthier
Copy link
Owner

Thanks for trying aider and filing this issue.

This looks like a duplicate of #1278. Please see the comments there for more information, and feel free to continue the discussion within that issue.

I'm going to close this issue for now. But please let me know if you think this is actually a distinct issue and I will reopen this issue.

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