-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
最近一直出现<NetWorkError message=HTTP request failed> #24
Comments
我无法复现此问题,請說明你的 Python 版本以及 httpx 的版本,如果可以的话把 python 环境的 lock 文件打包给我。 |
python==3.8.13 也有可能是我的小插件的问题?一旦它raise error,几分钟之内就开始弹networkerror
|
( 怪了,怎么感觉真是我的小插件引起的 但是一旦有报错,就会一直报错,按啥都取消不了,包括 刚刚的日志
|
你是否使用代理访问 Telegram?如果是你需要自行配置 |
应该不是代理的问题,机子在国外来着 感觉和我的小插件可能有点关系
然后再打开就会这样,变ssl的问题了?
然后每次打开都会报这个ssl的错,只有注释掉 不过有时候成功了也会崩掉
然后试了一下什么插件都不加载,放一会儿也会崩
可以看到三分钟就崩了 总结下来就是插件的fail会引发整个机器人的崩掉,但是就算不转插件过一会儿自己也有会崩? 所以我猜测主要的问题是,一个插件fail了之后,因为是串行处理的,所以就会一直卡在这里?重启之后也一样? (而且,在qq上使用的时候这个插件是没有问题的,而且就算是在telegram上有时候这个插件又是正常的,就很迷) 次要的问题是有些时候他自己会断开连接? 大佬您要整个项目的打包试试吗(虽然我插件就装了3个,一个示例reply,一个回复python版本和一个我的连接openai的小插件 |
八成是 openai 的问题,qq 不出错是因为 OneBot V11 走的 websocket 通信。 |
python 3.9.2有同样问题 也装了openai的插件。 Bot能正常使用,错误一般出现在交互结束后的一段时间内。怀疑和插件用法以及Telegram API会话超时有关。 |
Python 版本:3.11.3 在响应了一次命令后bot 立刻崩溃。附 原始项目文件。 点击查看 File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_transports\default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\connection_pool.py", line 262, in handle_async_request
raise exc
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\connection_pool.py", line 245, in handle_async_request
response = await connection.handle_async_request(request)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\http_proxy.py", line 326, in handle_async_request
return await self._connection.handle_async_request(request)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\http11.py", line 121, in handle_async_request
raise exc
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\http11.py", line 99, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\http11.py", line 164, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpcore\_async\http11.py", line 214, in _receive_event
raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\adapters\telegram\adapter.py", line 226, in _call_api
response = await self.request(request)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\internal\adapter\adapter.py", line 89, in request
return await self.driver.request(setup)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\drivers\httpx.py", line 56, in request
response = await client.request(
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_client.py", line 1530, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_client.py", line 1617, in send
response = await self._send_handling_auth(
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_client.py", line 1645, in _send_handling_auth
response = await self._send_handling_redirects(
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_client.py", line 1682, in _send_handling_redirects
response = await self._send_single_request(request)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_client.py", line 1719, in _send_single_request
response = await transport.handle_async_request(request)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_transports\default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\Arno\Documents\Game\bot.py", line 15, in <module>
nonebot.run(app="__mp_main__:app")
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\__init__.py", line 309, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "C:\Users\Arno\Documents\Game\Lib\site-packages\uvicorn\main.py", line 578, in run
server.run()
File "C:\Users\Arno\Documents\Game\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete
self.run_forever()
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever
self._run_once()
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_once
handle._run()
File "C:\Users\Arno\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
> File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\adapters\telegram\adapter.py", line 86, in poll
updates = await bot.get_updates(offset=update_offset, timeout=30)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\adapters\telegram\bot.py", line 103, in call_api
sign.return_annotation, await super().call_api(api, **kargs)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "C:\Users\Arno\Documents\Game\Lib\site-packages\nonebot\adapters\telegram\adapter.py", line 228, in _call_api
raise NetworkError("HTTP request failed") from e
nonebot.adapters.telegram.exception.NetworkError: <NetWorkError message=HTTP request failed> |
@NormanBB 你是代理的问题,与本 Issue 无关。 |
Traceback (most recent call last): 同样的问题 挂着没多久就突然报错 |
最近经常出现 networkerror
偶尔能收一会儿消息,但是都会在五分钟之内开始报错
新装了好几次,回退版本到 v0.1.0b8 还是有这个问题
感觉是处理上一个生命周期时碰到的问题解决不了?因为一旦报错,重启后也会一直报错。
但是我去bot.py 里注释掉
nonebot.load_plugins("plugins")
之后,重启一下,就不会有问题了配置文件:
.env.prod
bot.py
其中一次报错
The text was updated successfully, but these errors were encountered: