wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.62k stars 234 forks source link

🐛🐛 Bug Report: title-of-your-problem #321

Open xinxinyihao opened 2 years ago

xinxinyihao commented 2 years ago

requirements

Describe your problem

A clear and concise description of what the bug is.

2022-04-19 15:49:58,276 - PuppetService - INFO - receive error info <{'code': 36, 'msg': 'The text (【原神】的B站动态\n互动抽奖 #原神# #白鹭儃伫之思# \n\n《原神》EP - 白鹭儃伫之思 现已发布。\nhttps://www.bilibili.com/video/BV1nY4y1a76M \n\n春日的花瓣吹落堇庭,若翩翩冰姿。\n林森的溪鸣间杂鸟啼,掩幽幽静思。 \n\n关注@原神 并转发,我们将随机抽选10名旅行者赠送【神里绫华角色立牌】1份。) is banned'}>
2022-04-19 15:49:58,276 - WechatyPuppet.Schema.Base - WARNING - invalid fields: <['code', 'msg']> to initialize type<<class 'wechaty_puppet.schemas.event.EventErrorPayload'>> which are should not be here, we suggest that you should post an issue to python-wechaty to fix this issue 
you should give these infos: 
* the version of wechaty:                       0.8.37
* the version of wechaty_puppet:                0.4.5
* the version of wechaty_puppet_service:        0.8.8
* the token type: <unkonwn> token 

Job "BilibiliSubPlugin.rss_sub (trigger: interval[0:02:00], next run at: 2022-04-19 15:51:52 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/python3/lib/python3.9/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "/opt/wechatbot/xinxin_bot/plugin/bilibili/sub/__init__.py", line 92, in rss_sub
    await re_handle(uname, original_msg)
  File "/opt/wechatbot/xinxin_bot/plugin/bilibili/sub/__init__.py", line 41, in re_handle
    await room.say(f'【{uname}】的B站动态\n{new_rss_msg}')
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty/user/room.py", line 336, in say
    msg_id = await self.puppet.message_send_text(
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty_puppet_service/puppet.py", line 349, in message_send_text
    response = await self.puppet_stub.message_send_text(
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty_grpc/wechaty/__init__.py", line 437, in message_send_text
    return await self._unary_unary(
  File "/usr/local/python3/lib/python3.9/site-packages/betterproto/__init__.py", line 1124, in _unary_unary
    response = await stream.recv_message()
  File "/usr/local/python3/lib/python3.9/site-packages/grpclib/client.py", line 425, in recv_message
    await self.recv_initial_metadata()
  File "/usr/local/python3/lib/python3.9/site-packages/grpclib/client.py", line 393, in recv_initial_metadata
    self._raise_for_grpc_status(status, message, details)
  File "/usr/local/python3/lib/python3.9/site-packages/grpclib/client.py", line 345, in _raise_for_grpc_status
    raise GRPCError(status, message, details)
grpclib.exceptions.GRPCError: (<Status.ABORTED: 10>, '{"code":36,"msg":"The text (【原神】的B站动态\\n互动抽奖 #原神# #白鹭儃伫之思# \\n\\n《原神》EP - 白鹭儃伫之思 现已发布。\\nhttps://www.bilibili.com/video/BV1nY4y1a76M \\n\\n春日的花瓣吹落堇庭,若翩翩冰姿。\\n林森的溪鸣间杂鸟啼,掩幽幽静思。 \\n\\n关注@原神 并转发,我们将随机抽选10名旅行者赠送【神里绫华角色立牌】1份。) is banned"}', None)
ys
ys

Traceback (most recent call last):
  File "/opt/wechatbot/xinxin_bot/wechatbot.py", line 70, in <module>
    asyncio.run(main())
  File "/usr/local/python3/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/python3/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/opt/wechatbot/xinxin_bot/wechatbot.py", line 68, in main
    await bot.start()
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty/wechaty.py", line 395, in start
    await self.puppet.start()
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty_puppet_service/puppet.py", line 929, in start
    await self._listen_for_event()
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty_puppet_service/puppet.py", line 1029, in _listen_for_event
    payload = EventErrorPayload(**payload_data)
  File "/usr/local/python3/lib/python3.9/site-packages/wechaty_puppet/schemas/base.py", line 86, in __init__
    raise ValueError(
ValueError: the field<data> is required in dataclass<<class 'wechaty_puppet.schemas.event.EventErrorPayload'>>

这是咋回事哦

xinxinyihao commented 2 years ago

之前用的是padlocal,一切都好好的。今天换这个paimon,就一直报错

wj-Mcat commented 2 years ago

As the error log info shown, the field of data is lost in payload. This eror belong to the puppet protocol servicer. @zpaimon You can checkout this issue.