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

又一个获取运行状态图片失败的新错误 #50

Open
Kaguya233qwq opened this issue Oct 21, 2024 · 9 comments
Open

又一个获取运行状态图片失败的新错误 #50

Kaguya233qwq opened this issue Oct 21, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@Kaguya233qwq
Copy link

Kaguya233qwq commented Oct 21, 2024

10-21 18:20:46 [ERROR] nonebot_plugin_picstatus | Error when getting background, fallback to local
Traceback (most recent call last):
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions
    yield
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_transports/default.py", line 377, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
    raise exc from None
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
    response = await connection.handle_async_request(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
    raise exc
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
    stream = await self._connect(request)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_async/connection.py", line 122, in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp
    return await self._backend.connect_tcp(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 114, in connect_tcp
    with map_exceptions(exc_map):
  File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [Errno -2] Name or service not known

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

Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot_plugin_picstatus/bg_provider.py", line 157, in task_func
    bg = await fetch_bg()
> File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot_plugin_picstatus/bg_provider.py", line 121, in fetch_bg
    return await registered_bg_providers[config.ps_bg_provider]()
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot_plugin_picstatus/bg_provider.py", line 68, in loli
    (await cli.get("https://www.loliapi.com/acg/pe/")).raise_for_status(),
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_client.py", line 1814, in get
    return await self.request(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_client.py", line 1585, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_client.py", line 1674, in send
    response = await self._send_handling_auth(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_client.py", line 1702, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_client.py", line 1739, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_client.py", line 1776, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_transports/default.py", line 376, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno -2] Name or service not known
10-21 18:20:51 [ERROR] nonebot_plugin_picstatus | 获取运行状态图失败
Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
    uvicorn.run(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run
    server.run()
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
    await _run_matcher(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/message.py", line 428, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/internal/matcher/matcher.py", line 850, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/internal/matcher/matcher.py", line 825, in simple_run
    await handler(
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot/dependencies/__init__.py", line 94, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
> File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot_plugin_picstatus/__main__.py", line 78, in _
    ret = await render_current_template(collected=collected, bg=bg)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot_plugin_picstatus/templates/__init__.py", line 62, in render_current_template
    return await loaded_templates[config.ps_template].renderer(**kwargs)
  File "/home/ubuntu/Envs/nb/lib/python3.12/site-packages/nonebot_plugin_picstatus/templates/default/__init__.py", line 98, in default
    k: v[0] if isinstance(v, deque) else v for k, v in collected.items()
IndexError: deque index out of range
10-21 18:20:51 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_picstatus.__main__, lineno=32) running complete

bot部署在腾讯云ubuntu服务器
以上是完整的报错日志。请饼干佬帮忙定位一下是什么问题,我不知道是不是我服务器问题

@lgc2333 lgc2333 added the bug Something isn't working label Oct 21, 2024
@lgc2333
Copy link
Member

lgc2333 commented Oct 21, 2024

请问nb是刚运行吗,运行几秒后是否正常?

@Kaguya233qwq
Copy link
Author

Kaguya233qwq commented Oct 21, 2024 via email

@lgc2333
Copy link
Member

lgc2333 commented Oct 21, 2024

运行几秒后是否正常?

@6DDUU6
Copy link

6DDUU6 commented Nov 8, 2024

刚刚遇到...然后发现我是图片路径写错了

@lgc2333
Copy link
Member

lgc2333 commented Nov 8, 2024

图片路径应该不会导致deque为空,检查一下你的报错和这个是不是真的一样

@6DDUU6
Copy link

6DDUU6 commented Nov 9, 2024

图片路径应该不会导致deque为空,检查一下你的报错和这个是不是真的一样

是一样的。好像是我把PS_COLLECT_INTERVAL填高了,2分钟以后就可以了

@lgc2333
Copy link
Member

lgc2333 commented Nov 9, 2024

这个interval不推荐填太高

@6DDUU6
Copy link

6DDUU6 commented Nov 9, 2024

这个interval不推荐填太高

但是填2太低的话,会占服务器cpu,python会占15%

@lgc2333
Copy link
Member

lgc2333 commented Nov 9, 2024

这是插件收集数据的间隔,太高会影响数据准确性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants