NapNeko / NapCatQQ

现代化的基于 NTQQ 的 Bot 协议端实现
https://napneko.github.io
Other
2.29k stars 160 forks source link

[BUG] #90

Closed YueLinXieK closed 3 months ago

YueLinXieK commented 3 months ago

系统版本

Centos8.5

QQNT 版本

linuxqq_3.2.9-24815_x86_64.rpm

NapCat 版本

1.6.1

OneBot 客户端

不会查这个,抱歉,只知道这个的版本nonebot2==2.0.1,机器人端为真寻1.6.7

发生了什么?

图片发送报错

如何复现

只要触发发送图片的动作即会报错

期望的结果?

正常发送图片

NapCat 运行日志

2024-06-27 10:56:35 [INFO] [此处为QQ信息,涉及隐私]: 你是谁 
2024-06-27 10:56:36 [ERROR] [此处为QQ信息,涉及隐私]| 发生错误 {"errno":-13,"code":"EACCES","syscall":"open","path":"/home/nb-cli/zhenxun_bot-main/resources/image/zhenxun.jpg"}

OneBot 客户端运行日志

06-27 10:56:36 [ERROR] nonebot | Running Matcher(type='message', module=plugins.aconfig) failed.
Traceback (most recent call last):
  File "/home/nb-cli/zhenxun_bot-main/bot.py", line 21, in <module>
    nonebot.run()
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/__init__.py", line 333, in run
    get_driver().run(*args, **kwargs)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 199, in run
    uvicorn.run(
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 587, in run
    server.run()
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 61, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/local/python3.11/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 467, in check_and_run_matcher
    await _run_matcher(
> File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 419, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 759, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 734, in simple_run
    await handler(
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/home/nb-cli/zhenxun_bot-main/plugins/aconfig/__init__.py", line 52, in _
    await self_introduction.finish(result)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 483, in finish
    await cls.send(message, **kwargs)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 467, in send
    return await bot.send(event=event, message=_message, **kwargs)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 221, in send
    return await self.__class__.send_handler(self, event, message, **kwargs)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 174, in send
    return await bot.send_msg(**params)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 120, in call_api
    raise exception
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 98, in call_api
    result = await self.adapter._call_api(self, api, **data)
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 143, in _call_api
    return handle_api_result(await self._result_store.fetch(seq, timeout))
  File "/home/nb-cli/.cache/pypoetry/virtualenvs/zhenxun-bot-2pY3yEmg-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/utils.py", line 58, in handle_api_result
    raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(status='failed', retcode=1200, data=None, message="Error: EACCES: permission denied, open '/home/nb-cli/zhenxun_bot-main/resources/image/zhenxun.jpg'", wording="Error: EACCES: permission denied, open '/home/nb-cli/zhenxun_bot-main/resources/image/zhenxun.jpg'", echo='22')
MliKiowa commented 3 months ago

目录权限不足 nc无法读取 检查目录是否可读 或 存在

YueLinXieK commented 3 months ago

明白了,我napcat和机器人分属两个用户,存在权限问题,感谢解答