SK-415 / HarukaBot

将 B 站的动态和直播信息推送至 QQ,基于 NoneBot2 开发
https://haruka-bot.sk415.icu
GNU Affero General Public License v3.0
831 stars 109 forks source link

【错误回报】haruka仅帮助功能可用,其他功能全部会报错 #345

Closed vesugier closed 1 year ago

vesugier commented 1 year ago

运行环境

ubuntu20.04

HarukaBot 版本

1.5.3post2

go-cqhttp 版本

云崽bot+py-plugin插件

错误描述

tortoise.exceptions.ConfigurationError: default_connection for the model <class 'haruka_bot.database.models.Group'> cannot be None

猜测是数据库问题,配置文件↓

HARUKA_DIR: "./data/haruka-bot/data"
Haruka_TO_ME: False
HARUKA_COMMAND_PREFIX: "hb"

完整问题: https://gitee.com/realhuhu/py-plugin/issues/I6QAC5

报错日志(如果有)

[PyBot][10:45:11.682][SUCCESS] [message]OneAdapter 3636692830 | [message.group.normal]: from 2128186241@[群:764120694] '#hb关注10352806'
[PyBot][10:45:11.692][INFO] [message] 触发 Matcher(type='message', module=haruka_bot.utils)
[PyBot][10:45:11.693][INFO] [internal.matcher.matcher]Matcher(type='message', module=haruka_bot.utils) running complete
[PyBot][10:45:11.693][ERROR] [message]Running Matcher(type='message', module=haruka_bot.utils) failed.
Traceback (most recent call last):
  File "/root/Yunzai-BotV3/plugins/py-plugin/main.py", line 17, in <module>
    yunzai_nonebot.run()
  File "/root/Yunzai-BotV3/plugins/py-plugin/yunzai_nonebot/__init__.py", line 31, in run
    nonebot.run(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/root/Yunzai-BotV3/plugins/py-plugin/yunzai_nonebot/hijack/driver.py", line 42, in run
    loop.run_until_complete(self.serve())
  File "/usr/local/python3/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "/usr/local/python3/lib/python3.9/asyncio/base_events.py", line 596, in run_forever
    self._run_once()
  File "/usr/local/python3/lib/python3.9/asyncio/base_events.py", line 1890, in _run_once
    handle._run()
  File "/usr/local/python3/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/root/Yunzai-BotV3/plugins/py-plugin/yunzai_nonebot/hijack/message.py", line 10, in wrapper
    return await func(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 141, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 187, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
    await handler(
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-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 "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/haruka_bot/utils/__init__.py", line 85, in permission_check
    if not await db.get_group_admin(event.group_id):
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/haruka_bot/database/db.py", line 90, in get_group_admin
    group = await cls.get_group(id=group_id)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/haruka_bot/database/db.py", line 85, in get_group
    return await Group.get(**kwargs).first()
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/haruka_bot/database/models.py", line 12, in get
    return cls.filter(**kwargs)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/tortoise/models.py", line 1255, in filter
    return cls._meta.manager.get_queryset().filter(*args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/tortoise/manager.py", line 15, in get_queryset
    return QuerySet(self._model)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/tortoise/queryset.py", line 299, in __init__
    super().__init__(model)
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/tortoise/queryset.py", line 96, in __init__
    self.capabilities: Capabilities = model._meta.db.capabilities
  File "/root/.cache/pypoetry/virtualenvs/py-plugin-TZJFJuxU-py3.9/lib/python3.9/site-packages/tortoise/models.py", line 285, in db
    raise ConfigurationError(
tortoise.exceptions.ConfigurationError: default_connection for the model <class 'haruka_bot.database.models.Group'> cannot be None
SK-415 commented 1 year ago

不对云崽提供技术支持,请按照文档部署。