chidiwilliams / buzz

Buzz transcribes and translates audio offline on your personal computer. Powered by OpenAI's Whisper.
https://chidiwilliams.github.io/buzz
MIT License
12.61k stars 948 forks source link

**Failed (connection error)** / openai.APIConnectionError: Connection error. #963

Closed intointo closed 2 weeks ago

intointo commented 3 weeks ago

I am using the latest version of Buzz (1.1.0) on Windows 10, with OpenAI API. I have been using it for a long time without issues.

In the GUI, I am getting the following error: Failed (connection error)

The detailed error log is as follows:

[2024-10-26 09:32:46,182] _base_client._request:947 DEBUG -> Encountered Exception Traceback (most recent call last): File "httpx_transports\default.py", line 69, in map_httpcore_exceptions File "httpx_transports\default.py", line 233, in handle_request File "httpcore_sync\connection_pool.py", line 216, in handle_request File "httpcore_sync\connection_pool.py", line 196, in handle_request File "httpcore_sync\connection.py", line 99, in handle_request File "httpcore_sync\connection.py", line 76, in handle_request File "httpcore_sync\connection.py", line 122, in _connect File "httpcore_backends\sync.py", line 205, in connect_tcp File "contextlib.py", line 158, in exit File "httpcore_exceptions.py", line 14, in map_exceptions httpcore.ConnectError: [Errno 11001] getaddrinfo failed

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

Traceback (most recent call last): File "openai_base_client.py", line 926, in _request File "httpx_client.py", line 914, in send File "httpx_client.py", line 942, in _send_handling_auth File "httpx_client.py", line 979, in _send_handling_redirects File "httpx_client.py", line 1015, in _send_single_request File "httpx_transports\default.py", line 232, in handle_request File "contextlib.py", line 158, in exit File "httpx_transports\default.py", line 86, in map_httpcore_exceptions httpx.ConnectError: [Errno 11001] getaddrinfo failed [2024-10-26 09:32:46,185] _base_client._retry_request:1012 DEBUG -> 0 retries left [2024-10-26 09:32:46,185] _base_client._retry_request:1015 INFO -> Retrying request to /audio/transcriptions in 1.522056 seconds [2024-10-26 09:32:47,708] _base_client._build_request:442 DEBUG -> Request options: {'method': 'post', 'url': '/audio/transcriptions', 'headers': {'Content-Type': 'multipart/form-data'}, 'files': [('file', SerializationIterator(index=0, iterator=<_io.BufferedReader name='C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\tmpxyri2qgu.mp3'>))], 'json_data': {'model': 'whisper-1', 'language': 'es', 'prompt': '', 'response_format': 'verbose_json'}} [2024-10-26 09:32:47,709] _trace.trace:45 DEBUG -> connect_tcp.started host='api.openai.com' port=443 local_address=None timeout=5.0 socket_options=None [2024-10-26 09:32:47,709] _trace.trace:45 DEBUG -> connect_tcp.failed exception=ConnectError(gaierror(11001, 'getaddrinfo failed')) [2024-10-26 09:32:47,709] _base_client._request:947 DEBUG -> Encountered Exception Traceback (most recent call last): File "httpx_transports\default.py", line 69, in map_httpcore_exceptions File "httpx_transports\default.py", line 233, in handle_request File "httpcore_sync\connection_pool.py", line 216, in handle_request File "httpcore_sync\connection_pool.py", line 196, in handle_request File "httpcore_sync\connection.py", line 99, in handle_request File "httpcore_sync\connection.py", line 76, in handle_request File "httpcore_sync\connection.py", line 122, in _connect File "httpcore_backends\sync.py", line 205, in connect_tcp File "contextlib.py", line 158, in exit File "httpcore_exceptions.py", line 14, in map_exceptions httpcore.ConnectError: [Errno 11001] getaddrinfo failed

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

Traceback (most recent call last): File "openai_base_client.py", line 926, in _request File "httpx_client.py", line 914, in send File "httpx_client.py", line 942, in _send_handling_auth File "httpx_client.py", line 979, in _send_handling_redirects File "httpx_client.py", line 1015, in _send_single_request File "httpx_transports\default.py", line 232, in handle_request File "contextlib.py", line 158, in exit File "httpx_transports\default.py", line 86, in map_httpcore_exceptions httpx.ConnectError: [Errno 11001] getaddrinfo failed [2024-10-26 09:32:47,712] _base_client._request:959 DEBUG -> Raising connection error [2024-10-26 09:32:47,712] file_transcriber.run:61 ERROR -> Traceback (most recent call last): File "httpx_transports\default.py", line 69, in map_httpcore_exceptions File "httpx_transports\default.py", line 233, in handle_request File "httpcore_sync\connection_pool.py", line 216, in handle_request File "httpcore_sync\connection_pool.py", line 196, in handle_request File "httpcore_sync\connection.py", line 99, in handle_request File "httpcore_sync\connection.py", line 76, in handle_request File "httpcore_sync\connection.py", line 122, in _connect File "httpcore_backends\sync.py", line 205, in connect_tcp File "contextlib.py", line 158, in exit File "httpcore_exceptions.py", line 14, in map_exceptions httpcore.ConnectError: [Errno 11001] getaddrinfo failed

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

Traceback (most recent call last): File "openai_base_client.py", line 926, in _request File "httpx_client.py", line 914, in send File "httpx_client.py", line 942, in _send_handling_auth File "httpx_client.py", line 979, in _send_handling_redirects File "httpx_client.py", line 1015, in _send_single_request File "httpx_transports\default.py", line 232, in handle_request File "contextlib.py", line 158, in exit File "httpx_transports\default.py", line 86, in map_httpcore_exceptions httpx.ConnectError: [Errno 11001] getaddrinfo failed

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

Traceback (most recent call last): File "buzz\transcriber\file_transcriber.py", line 59, in run File "buzz\transcriber\openai_whisper_api_file_transcriber.py", line 98, in transcribe File "buzz\transcriber\openai_whisper_api_file_transcriber.py", line 116, in get_segments_for_file File "openai\resources\audio\transcriptions.py", line 115, in create File "openai_base_client.py", line 1208, in post File "openai_base_client.py", line 897, in request File "openai_base_client.py", line 950, in _request File "openai_base_client.py", line 1021, in _retry_request File "openai_base_client.py", line 950, in _request File "openai_base_client.py", line 1021, in _retry_request File "openai_base_client.py", line 960, in _request openai.APIConnectionError: Connection error.

raivisdejus commented 3 weeks ago

@intointo Something is wrong with connecting to the Open AI API. A few things to check:

Not sure if there is much we will be able to do, but we can try to debug this.

intointo commented 2 weeks ago

Thank you for the reply. On the next day, I got a different OpenAI API error: "You exceeded your current quota (...)", I updated the quota and everything worked fine.