Nothing Special   »   [go: up one dir, main page]

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

更新脚本文件后,SSLError #49

Closed
lijoe123 opened this issue Mar 7, 2023 · 24 comments
Closed

更新脚本文件后,SSLError #49

lijoe123 opened this issue Mar 7, 2023 · 24 comments

Comments

@lijoe123
Copy link
lijoe123 commented Mar 7, 2023

下面是报错内容,麻烦up主了,谢谢您

chat_counter - 0
payload is - {'model': 'gpt-3.5-turbo', 'messages': [{'role': 'system', 'content': 'You are a helpful assistant.'}, {'role': 'user', 'content': '你好'}], 'temperature': 1, 'top_p': 1, 'n': 1, 'stream': True, 'presence_penalty': 0, 'frequency_penalty': 0}
Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "C:\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "C:\Miniconda3\lib\site-packages\urllib3\connection.py", line 364, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "C:\Miniconda3\lib\site-packages\urllib3\connection.py", line 501, in _connect_tls_proxy
    socket = ssl_wrap_socket(
  File "C:\Miniconda3\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "C:\Miniconda3\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\Miniconda3\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Miniconda3\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Miniconda3\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\requests\adapters.py", line 440, in send
    resp = conn.urlopen(
  File "C:\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "C:\Miniconda3\lib\site-packages\urllib3\util\retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\gradio\routes.py", line 384, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Miniconda3\lib\site-packages\gradio\blocks.py", line 1032, in process_api
    result = await self.call_function(
  File "C:\Miniconda3\lib\site-packages\gradio\blocks.py", line 858, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Miniconda3\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Miniconda3\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Miniconda3\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Miniconda3\lib\site-packages\gradio\utils.py", line 448, in async_iteration
    return next(iterator)
  File "D:\Desktop\ChuanhuChatGPT-main\ChuanhuChatbot.py", line 99, in predict
    response = requests.post(API_URL, headers=headers,
  File "C:\Miniconda3\lib\site-packages\requests\api.py", line 117, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
@GaiZhenbiao
Copy link
Owner

这就是openai.com没有被代理成功。但是,注意不要代理127.0.0.1,否则会导致出错。

@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

@GaiZhenbiao 那请问up主我该修改哪里呢?谢谢

@GaiZhenbiao
Copy link
Owner
GaiZhenbiao commented Mar 7, 2023

请将openai.com加入你使用的代理App的代理规则。注意不要将127.0.0.1加入代理,否则也会出错。例如,在Clash配置文件中,加入:

rules:
- DOMAIN-SUFFIX,openai.com,你的代理规则
- DOMAIN,127.0.0.1,DIRECT

Surge:

[Rule]
DOMAIN,127.0.0.1,DIRECT
DOMAIN-SUFFIX,openai.com,你的代理规则

@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

哭了,我赶紧去B站给您投个币

@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

请问在这里加入 openai.com 就行了吗
image

@GaiZhenbiao
Copy link
Owner

还有127.0.0.1

@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

好像不行耶
image
image

@GaiZhenbiao
Copy link
Owner

开启TUN模式。

@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

一样的报错

D:\Desktop\ChuanhuChatGPT-main>python ChuanhuChatbot.py
川虎的温馨提示:访问 http://localhost:7860 查看界面
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
chat_counter - 0
payload is - {'model': 'gpt-3.5-turbo', 'messages': [{'role': 'system', 'content': 'You are a helpful assistant.'}, {'role': 'user', 'content': '你好'}], 'temperature': 1, 'top_p': 1, 'n': 1, 'stream': True, 'presence_penalty': 0, 'frequency_penalty': 0}
Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "C:\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "C:\Miniconda3\lib\site-packages\urllib3\connection.py", line 364, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "C:\Miniconda3\lib\site-packages\urllib3\connection.py", line 501, in _connect_tls_proxy
    socket = ssl_wrap_socket(
  File "C:\Miniconda3\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "C:\Miniconda3\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\Miniconda3\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Miniconda3\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Miniconda3\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\requests\adapters.py", line 440, in send
    resp = conn.urlopen(
  File "C:\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "C:\Miniconda3\lib\site-packages\urllib3\util\retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Miniconda3\lib\site-packages\gradio\routes.py", line 384, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Miniconda3\lib\site-packages\gradio\blocks.py", line 1032, in process_api
    result = await self.call_function(
  File "C:\Miniconda3\lib\site-packages\gradio\blocks.py", line 858, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Miniconda3\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Miniconda3\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Miniconda3\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Miniconda3\lib\site-packages\gradio\utils.py", line 448, in async_iteration
    return next(iterator)
  File "D:\Desktop\ChuanhuChatGPT-main\ChuanhuChatbot.py", line 99, in predict
    response = requests.post(API_URL, headers=headers,
  File "C:\Miniconda3\lib\site-packages\requests\api.py", line 117, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "C:\Miniconda3\lib\site-packages\requests\adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))

@GaiZhenbiao
Copy link
Owner
  1. 确认代理可用吗?
  2. 重装urllib3试试

@GaiZhenbiao GaiZhenbiao reopened this Mar 7, 2023
@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

代理可用
image

@lijoe123
Copy link
Author
lijoe123 commented Mar 7, 2023

重装urllib3,成功,感谢up主,今年多涨粉,多赚钱

@lijoe123
Copy link
Author

请问在这里加入 openai.com 就行了吗 image

请问您这个代理是哪里来的呢。可以分享一下嘛

https://liangyuandian.club/#/dashboard

@asdasdasaasa
Copy link

请问在这里加入 openai.com 就行了吗 image

请问您这个代理是哪里来的呢。可以分享一下嘛

https://liangyuandian.club/#/dashboard

非常感谢。我已经配置好了代理。但是遇到一个问题,就是无法加入openai和127.0.0.1的配置。请问这是如何做到的呢。

@lijoe123
Copy link
Author

那不清楚你为啥不能了,我就是按照他的方法,你重开一个问题问问吧

@asdasdasaasa

This comment was marked as abuse.

@maxiaovivi
Copy link

请问在这里加入 openai.com 就行了吗 image

请问您这个代理是哪里来的呢。可以分享一下嘛

https://liangyuandian.club/#/dashboard

非常感谢。我已经配置好了代理。但是遇到一个问题,就是无法加入openai和127.0.0.1的配置。请问这是如何做到的呢。

yaml文件里边,搜索rule。下边添加就行

@GaiZhenbiao GaiZhenbiao unpinned this issue Mar 22, 2023
@tianzhenbanxie
Copy link

屏幕截图 2023-03-22 000418
配置好了代理,重装了urllib3,开启了TUN,也重装过了还是Something went wrong

@Miyang5760
Copy link

mac用户要怎么添加呢?

@Ydm-666
Copy link
Ydm-666 commented Mar 27, 2023

屏幕截图 2023-03-22 000418 配置好了代理,重装了urllib3,开启了TUN,也重装过了还是Something went wrong

我也是出现这个问题,很难受

@0xkl
Copy link
0xkl commented Mar 28, 2023

问题已经解决:
按照上面的方式如果还是没有成功的话可以试试下面这个方法:
clash窗口页面-->常规-->服务模式(把旁边的小地球点亮在试试。)
开启TUN模式,重启clash。

在这里要感谢UP的耐心解答,祝你今年赚大钱,涨大粉。

@zp52
Copy link
zp52 commented Mar 28, 2023

image
我配置了,好像没用哇,可以帮我看下吗

@zp52
Copy link
zp52 commented Mar 28, 2023

image

@Qwerty4401
Copy link
  1. 确认代理可用吗?
  2. 重装urllib3试试

大佬,用docker部署的怎么重装urllib3啊,我代理是没问题的,但是偶尔还是会报这个异常。

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

10 participants