Ailitonia / omega-miya

基于 nonebot2 的多平台机器人
MIT License
272 stars 50 forks source link

启动报错pydantic_core._pydantic_core.ValidationError: 1 validation error for GuildServiceProfile #160

Closed czl531 closed 1 month ago

czl531 commented 1 month ago

`10-10 14:43:06 [ERROR] nonebot | Error when running EventPreProcessors. Event ignored! Traceback (most recent call last): File "/usr/local/src/omega-miya/bot.py", line 76, in nonebot.run() File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/init.py", line 335, in run get_driver().run(*args, kwargs) File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run uvicorn.run( File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/uvicorn/main.py", line 577, in run server.run() File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) File "/root/.pyenv/versions/3.12.7/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) File "/root/.pyenv/versions/3.12.7/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/utils.py", line 236, in run_coro_with_catch return await coro File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/dependencies/init.py", line 94, in call return await cast(Callable[..., Awaitable[R]], self.call)(values) File "/usr/local/src/omega-miya/src/service/omega_multibot_support/universal.py", line 87, in __init_bot_connect await handle_event(bot=bot, event=BotConnectEvent(bot_id=bot.self_id, bot_type=bot.type)) File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/message.py", line 513, in handle_event if not await _apply_event_preprocessors(

File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/message.py", line 154, in _apply_event_preprocessors await asyncio.gather( File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/utils.py", line 236, in run_coro_with_catch return await coro File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/nonebot/dependencies/init.py", line 94, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "/usr/local/src/omega-miya/src/service/omega_multibot_support/onebot_v11.py", line 252, in obv11_bot_connect guild_profile = GuildServiceProfile.model_validate(await bot.get_guild_service_profile()) File "/root/.pyenv/versions/myenv/lib/python3.12/site-packages/pydantic/main.py", line 568, in model_validate return cls.pydantic_validator__.validate_python( pydantic_core._pydantic_core.ValidationError: 1 validation error for GuildServiceProfile Input should be a valid dictionary or instance of GuildServiceProfile [type=model_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.8/v/model_type ` image 启动报错

czl531 commented 1 month ago

发现无视不影响使用,只是每次启动都会报错。无所谓了,能用就行

Ailitonia commented 1 month ago

这个我记得好像是协议端调用原来 gocq 的频道 API 时即使没实现也是返回 None 而不是 AdapterException 确实不影响使用,在 dev 分支 ed8301b239b619ae27ecae32105d92a7e9990abc 13340e51a4772e28d830229f7ba067c5d242142a 这两个commit 里面优化了