MountainDash/nonebot-bison

b站订阅失效

Closed this issue · 9 comments

环境

  • nonebot-bison 版本:0.9.1
  • nonebot 版本:2.2.1
  • 安装方式:1(以下方式的一种或者其他方式)
    1. 通过 nb-cli 安装
    2. 使用 poetry/pdm 等现代包管理器安装
    3. 通过 pip install 安装
    4. 克隆或下载项目直接使用
  • 操作系统:windows server 2016

问题

从25号下午6点开始所有bilibili的推送都没有了(?

日志

03-26 18:28:32 [WARNING] nonebot_bison | API request record: https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=3126498&offset=0&need_top=0 Headers({'host': 'api.vc.bilibili.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate', 'connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36', 'cookie': 'LIVE_BUVID=AUTO9217114473363169; b_nut=1711447336; buvid3=A193E58D-202E-F747-C462-8A5C4865683436068infoc'}) | [200] Headers({'date': 'Tue, 26 Mar 2024 10:28:32 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '83', 'connection': 'keep-alive', 'bili-status-code': '0', 'bili-trace-id': '2d0d629ceb6602a3', 'cpu_usage': '466', 'x-bili-trace-id': '03df2e28aecdcee52d0d629ceb6602a3', 'x-ticket-status': '1', 'expires': 'Tue, 26 Mar 2024 10:28:31 GMT', 'cache-control': 'no-cache', 'x-cache-webcdn': 'BYPASS from blzone05'}) {"code":0,"message":"0","ttl":1,"data":{"has_more":0,"cards":null,"next_offset":0}}
03-26 18:28:32 [ERROR] apscheduler | Job "Scheduler.exec_fetch (trigger: interval[0:00:10], next run at: 2024-03-26 18:28:42 CST)" raised an exception
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Python310\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_plugin_reboot\reloader.py", line 27, in _run
    _nb_run(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot\__init__.py", line 334, in run
    get_driver().run(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 186, in run
    uvicorn.run(
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\uvicorn\main.py", line 568, in run
    server.run()
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\uvicorn\server.py", line 59, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "C:\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Python310\lib\asyncio\base_events.py", line 603, in run_forever
    self._run_once()
  File "C:\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
    handle._run()
  File "C:\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
> File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\apscheduler\executors\base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\scheduler\scheduler.py", line 107, in exec_fetch
    to_send = await platform_obj.do_fetch_new_post(SubUnit(schedulable.target, send_userinfo_list))
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 109, in do_fetch_new_post
    return await catch_network_error(self.fetch_new_post, sub_unit) or []
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 53, in catch_network_error
    return await func(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 341, in fetch_new_post
    return await self._handle_new_post(post_list, sub_unit)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 323, in _handle_new_post
    new_posts = await self.filter_common_with_diff(sub_unit.sub_target, post_list)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 298, in filter_common_with_diff
    filtered_post = await self.filter_common(raw_post_list)
  File "C:\Users\Administrator\Desktop\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 262, in filter_common
    for raw_post in raw_post_list:
TypeError: ("'NoneType' object is not iterable", ['https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=3126498&offset=0&need_top=0 Headers({\'host\': \'api.vc.bilibili.com\', \'accept\': \'*/*\', \'accept-encoding\': \'gzip, deflate\', \'connection\': \'keep-alive\', \'user-agent\': \'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\', \'cookie\': \'LIVE_BUVID=AUTO9217114473363169; b_nut=1711447336; buvid3=A193E58D-202E-F747-C462-8A5C4865683436068infoc\'}) | [200] Headers({\'date\': \'Tue, 26 Mar 2024 10:28:32 GMT\', \'content-type\': \'application/json; charset=utf-8\', \'content-length\': \'83\', \'connection\': \'keep-alive\', \'bili-status-code\': \'0\', \'bili-trace-id\': \'2d0d629ceb6602a3\', \'cpu_usage\': \'466\', \'x-bili-trace-id\': \'03df2e28aecdcee52d0d629ceb6602a3\', \'x-ticket-status\': \'1\', \'expires\': \'Tue, 26 Mar 2024 10:28:31 GMT\', \'cache-control\': \'no-cache\', \'x-cache-webcdn\': \'BYPASS from blzone05\'}) {"code":0,"message":"0","ttl":1,"data":{"has_more":0,"cards":null,"next_offset":0}}'])
  • [ √] 我搜索过了 issue,但是并没有发现过与我类似的问题
  • [ √] 我确认在日志中去掉了敏感信息

#507

感谢回复
不过试了下bilibili-none分支,还是会报错(?

03-26 19:06:40 [WARNING] nonebot_bison | API request record: https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=4293019&offset=0&need_top=0 Headers({'host': 'api.vc.bilibili.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate', 'connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36', 'cookie': 'LIVE_BUVID=AUTO3417114511844226; b_nut=1711451184; buvid3=BE54E7E3-62B8-D407-4E85-D2FA4BBB787A84330infoc'}) | [200] Headers({'date': 'Tue, 26 Mar 2024 11:06:40 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '83', 'connection': 'keep-alive', 'bili-status-code': '0', 'bili-trace-id': '194219a0706602ac', 'cpu_usage': '500', 'x-bili-trace-id': '01c420583a763998194219a0706602ac', 'x-ticket-status': '1', 'expires': 'Tue, 26 Mar 2024 11:06:39 GMT', 'cache-control': 'no-cache', 'x-cache-webcdn': 'BYPASS from blzone05'}) {"code":0,"message":"0","ttl":1,"data":{"has_more":0,"cards":null,"next_offset":0}}
03-26 19:06:40 [ERROR] apscheduler | Job "Scheduler.exec_fetch (trigger: interval[0:00:10], next run at: 2024-03-26 19:06:49 CST)" raised an exception
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Python310\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot_plugin_reboot\reloader.py", line 27, in _run
    _nb_run(*args, **kwargs)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot\__init__.py", line 334, in run
    get_driver().run(*args, **kwargs)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 186, in run
    uvicorn.run(
  File "F:\ResonaBot\.venv\lib\site-packages\uvicorn\main.py", line 568, in run
    server.run()
  File "F:\ResonaBot\.venv\lib\site-packages\uvicorn\server.py", line 59, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "C:\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Python310\lib\asyncio\base_events.py", line 603, in run_forever
    self._run_once()
  File "C:\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
    handle._run()
  File "C:\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
> File "F:\ResonaBot\.venv\lib\site-packages\apscheduler\executors\base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot_bison\scheduler\scheduler.py", line 107, in exec_fetch
    to_send = await platform_obj.do_fetch_new_post(SubUnit(schedulable.target, send_userinfo_list))
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 109, in do_fetch_new_post
    return await catch_network_error(self.fetch_new_post, sub_unit) or []
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 53, in catch_network_error
    return await func(*args, **kwargs)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 340, in fetch_new_post
    post_list = await self.get_sub_list(sub_unit.sub_target)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot_bison\platform\bilibili.py", line 186, in get_sub_list
    res_obj = type_validate_json(PostAPI, res.content)
  File "F:\ResonaBot\.venv\lib\site-packages\nonebot\compat.py", line 379, in type_validate_json
    return parse_raw_as(type_, data)
  File "pydantic\tools.py", line 82, in pydantic.tools.parse_raw_as
  File "pydantic\tools.py", line 38, in pydantic.tools.parse_obj_as
  File "pydantic\main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic\main.py", line 1076, in pydantic.main.validate_model
  File "pydantic\fields.py", line 884, in pydantic.fields.ModelField.validate
  File "pydantic\fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton
  File "pydantic\fields.py", line 1157, in pydantic.fields.ModelField._apply_validators
  File "pydantic\class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13
  File "pydantic\main.py", line 711, in pydantic.main.BaseModel.validate
  File "pydantic\main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic\main.py", line 1076, in pydantic.main.validate_model
  File "pydantic\fields.py", line 884, in pydantic.fields.ModelField.validate
  File "pydantic\fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton
  File "pydantic\fields.py", line 1157, in pydantic.fields.ModelField._apply_validators
  File "pydantic\class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13
  File "pydantic\main.py", line 711, in pydantic.main.BaseModel.validate
  File "pydantic\main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic\main.py", line 1076, in pydantic.main.validate_model
  File "pydantic\fields.py", line 860, in pydantic.fields.ModelField.validate
pydantic.errors.ConfigError: ('field "cards" not yet prepared so type is still a ForwardRef, you might need to call Data.update_forward_refs().', ['https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=4293019&offset=0&need_top=0 Headers({\'host\': \'api.vc.bilibili.com\', \'accept\': \'*/*\', \'accept-encoding\': \'gzip, deflate\', \'connection\': \'keep-alive\', \'user-agent\': \'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\', \'cookie\': \'LIVE_BUVID=AUTO3417114511844226; b_nut=1711451184; buvid3=BE54E7E3-62B8-D407-4E85-D2FA4BBB787A84330infoc\'}) | [200] Headers({\'date\': \'Tue, 26 Mar 2024 11:06:40 GMT\', \'content-type\': \'application/json; charset=utf-8\', \'content-length\': \'83\', \'connection\': \'keep-alive\', \'bili-status-code\': \'0\', \'bili-trace-id\': \'194219a0706602ac\', \'cpu_usage\': \'500\', \'x-bili-trace-id\': \'01c420583a763998194219a0706602ac\', \'x-ticket-status\': \'1\', \'expires\': \'Tue, 26 Mar 2024 11:06:39 GMT\', \'cache-control\': \'no-cache\', \'x-cache-webcdn\': \'BYPASS from blzone05\'}) {"code":0,"message":"0","ttl":1,"data":{"has_more":0,"cards":null,"next_offset":0}}'])

唔 非常好报错(bushi
实际上PostAPI这个model是rebuild了的感觉不应该有这个问题

目前确定是 pyd1 的 model rebuild 与 pyd2 不同,不会自己递归 rebuild 自己内部使用到的 model,导致了这个问题

不仅如此,接口的检查变的严格了,暂时难以修复(

不仅如此,接口的检查变的严格了,暂时难以修复(

大悲,看来只能先用别的插件顶会了😭

看看别的插件?万一能抄呢(

看看别的插件?万一能抄呢(

https://github.com/Well2333/nonebot-plugin-bilichat
你康康(?

v0.9.3 已经处理了该问题