使用mongo数据库触发用户订阅时报错
Putarku opened this issue · comments
使用sql数据库时,用户订阅不会推送,主动触发也只会显示已拉取
而使用mongo数据库时很少时候能正常发,但有时候会触发下面这种报错,包都已经更新到最新了。
nonebot-adapter-onebot 2.2.3
nonebot-plugin-access-control 0.4.1
nonebot-plugin-apscheduler 0.2.0
nonebot-plugin-datastore 0.6.3
nonebot-plugin-localstore 0.4.1
nonebot-plugin-pixivbot 1.8.4
nonebot-plugin-pixivbot-onebot-v11 1.5.1
nonebot-plugin-txt2img 0.3.1
nonebot2 2.0.0rc4
05-26 19:37:47 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.command.command) failed.
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 8, in <module>
sys.exit(run())
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 231, in run
super().run()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 202, in run
self.manage_workers()
File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 551, in manage_workers
self.spawn_workers()
File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 622, in spawn_workers
self.spawn_worker()
File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.9/site-packages/uvicorn/workers.py", line 66, in init_process
super(UvicornWorker, self).init_process()
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 142, in init_process
self.run()
File "/usr/local/lib/python3.9/site-packages/uvicorn/workers.py", line 98, in run
return asyncio.run(self._serve())
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.9/site-packages/nonebot/message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/usr/local/lib/python3.9/site-packages/nonebot/message.py", line 187, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.9/site-packages/nonebot/internal/matcher/matcher.py", line 728, in simple_run
await handler(
File "/usr/local/lib/python3.9/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/command/command.py", line 76, in _
await CommandHandler(post_dest).handle(*args)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 111, in handle
await self.interceptor.intercept(self, self._parse_args_and_actual_handle, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 39, in intercept
raise e # 重新抛出,让上层可以处理(如scheduler中需要处理Handler的异常)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/default_error_interceptor.py", line 21, in intercept
await wrapped_func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 127, in _parse_args_and_actual_handle
await self.actual_handle(**kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/command/command.py", line 48, in actual_handle
await handler.handle(*args[1:])
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/command/subcommand.py", line 29, in handle
await super().handle(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 111, in handle
await self.interceptor.intercept(self, self._parse_args_and_actual_handle, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/interceptor/service_interceptor.py", line 29, in intercept
await wrapped_func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/base.py", line 127, in _parse_args_and_actual_handle
await self.actual_handle(**kwargs)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/handler/command/watch.py", line 105, in actual_handle
ok = await watchman.fetch(kwargs['code'], self.post_dest)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/service/watchman.py", line 81, in fetch
await self._handle_trigger(task, post_dest, manually=True)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/service/watchman.py", line 50, in _handle_trigger
await self.repo.update(task)
File "/usr/local/lib/python3.9/site-packages/nonebot_plugin_pixivbot/data/watch_task/mongo.py", line 71, in update
await item.save()
File "/usr/local/lib/python3.9/site-packages/beanie/odm/actions.py", line 221, in wrapper
result = await f(self, *args, skip_actions=skip_actions, **kwargs)
File "/usr/local/lib/python3.9/site-packages/beanie/odm/utils/state.py", line 66, in wrapper
result = await f(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/beanie/odm/documents.py", line 478, in save
return await self.update(
File "/usr/local/lib/python3.9/site-packages/beanie/odm/actions.py", line 221, in wrapper
result = await f(self, *args, skip_actions=skip_actions, **kwargs)
File "/usr/local/lib/python3.9/site-packages/beanie/odm/utils/state.py", line 66, in wrapper
result = await f(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/beanie/odm/documents.py", line 607, in update
merge_models(self, result)
File "/usr/local/lib/python3.9/site-packages/beanie/odm/utils/parsing.py", line 24, in merge_models
merge_models(left_value, right_value)
File "/usr/local/lib/python3.9/site-packages/beanie/odm/utils/parsing.py", line 35, in merge_models
left.__setattr__(k, right_value)
File "pydantic/main.py", line 359, in pydantic.main.BaseModel.__setattr__
raise TypeError(f'"{self.__class__.__name__}" is immutable and does not support item assignment')
TypeError: "UserIdentifier[str]" is immutable and does not support item assignment```