binary-husky / binary-husky/gpt_academic

[Bug]: 好像是代理方面,之前安装过其他版本的中科院ChatGPT,先装配置Anaconda,再装VSCODE,所以直接更新了academic Chatgpt

Open
#2,046 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
71.3k
Forks
8.3k
PR merge metrics
No merged PRs in 30d

Description

### Installation Method | 安装方法与平台

Others (Please Describe)

### Version | 版本

Latest | 最新版

### OS | 操作系统

Windows

### Describe the bug | 简述

Traceback (most recent call last):
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\urllib3\connectionpool.py", line 775, in urlopen
self._prepare_proxy(conn)
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\urllib3\connectionpool.py", line 1044, in _prepare_proxy
conn.connect()
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\urllib3\connection.py", line 710, in connect
self._tunnel()
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\http\client.py", line 943, in _tunnel
raise OSError(f"Tunnel connection failed: {code} {message.strip()}")
OSError: Tunnel connection failed: 400 Bad Request

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

urllib3.exceptions.ProxyError: ('Unable to connect to proxy', OSError('Tunnel connection failed: 400 Bad Request'))

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

Traceback (most recent call last):
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\urllib3\util\retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='cloud-1.agent-matrix.com', port=443): Max retries exceeded with url: /?q=%E5%A6%82%E4%BD%95%E4%BF%AE%E6%94%B9%E5%B7%B2%E7%94%9F%E6%88%90%E7%9A%84%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE%E5%88%97%E8%A1%A8%E6%A0%BC%E5%BC%8F&format=json&language=zh&engines=google (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 400 Bad Request')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File ".\toolbox.py", line 224, in decorated
yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs)
File ".\crazy_functions\Internet_GPT.py", line 211, in 连接网络回答问题
urls = searxng_request(txt, proxies, categories, searxng_url, engines=engines)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".\crazy_functions\Internet_GPT.py", line 149, in searxng_request
response = requests.post(url, params=params, headers=headers, proxies=proxies, timeout=30)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\QMDownload\Anaconda\envs\gptac_venv\Lib\site-packages\requests\adapters.py", line 694, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='cloud-1.agent-matrix.com', port=443): Max retries exceeded with url: /?q=%E5%A6%82%E4%BD%95%E4%BF%AE%E6%94%B9%E5%B7%B2%E7%94%9F%E6%88%90%E7%9A%84%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE%E5%88%97%E8%A1%A8%E6%A0%BC%E5%BC%8F&format=json&language=zh&engines=google (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 400 Bad Request')))

### Screen Shot | 有帮助的截图

![image](https://github.com/user-attachments/assets/96d354fe-eb07-44cc-ba46-f074dfaa5b5d)

### Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with .\crazy_functions\Internet_GPT.py, especially searxng_request and its requests.post call, then inspect how proxies and searxng_url are supplied. Reproduce the Windows Anaconda environment and compare the configured proxy with the reported 400 tunnel failure; done means the Internet GPT request no longer raises this ProxyError or the issue has a documented configuration diagnosis.

Written by the indexing model from the issue text.

Assessment

Tech stack
anaconda, python
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.