ehForwarderBot / efb-wechat-slave

A channel for EH Forwarder Bot.
GNU Affero General Public License v3.0
459 stars 62 forks source link

[BUG] KeyError: 'webwx_data_ticket' , wechat can't receive some messages #134

Closed FlechazoPh closed 1 year ago

FlechazoPh commented 2 years ago

Describe the bug
wechat logout and error log showed: image

To Reproduce
Error Logs:

 ret = func(*args, **kwargs)
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: File "/usr/local/lib/python3.6/site-packages/efb_wechat_slave/vendor/wxpy/api/chats/chat.py", line 52, in do_send
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: return itchat_partial_func(**itchat_call_or_ret)
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: File "/usr/local/lib/python3.6/site-packages/efb_wechat_slave/vendor/itchat/components/messages.py", line 441, in send_image
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: r = self.upload_file(fileDir, isPicture=not fileDir[-4:] == '.gif', file_=file_)
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: File "/usr/local/lib/python3.6/site-packages/efb_wechat_slave/vendor/itchat/components/messages.py", line 347, in upload_file
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: file_, chunk, chunks, uploadMediaRequest)
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: File "/usr/local/lib/python3.6/site-packages/efb_wechat_slave/vendor/itchat/components/messages.py", line 372, in upload_chunk_file
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: ('webwx_data_ticket', (None, cookiesList['webwx_data_ticket'])),
May 30 19:37:28 oracle-centos-2 ehforwarderbot[30474]: KeyError: 'webwx_data_ticket'

Screenshots
image Version information (please complete the following information):

EH Forwarder Bot Version: 2.1.1 Python version: 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] Running on profile "default".

Master channel: Telegram Master (blueset.telegram) 2.3.1 # Default instance

Slave channel: WeChat Slave (blueset.wechat) 2.0.7 # Default instance

Middlewares: MP InstantView Middleware (catbaron.mp_instantview) 0.3.2 # Default instance Patch Middleware (patch.PatchMiddleware) 2.0.23 # Default instance

blueset commented 2 years ago

Seems like a change from Web WC server. Can you confirm if you can access Web WC via a browser?

FlechazoPh commented 2 years ago

Yes, web wechat is ok, and It is normal to scan the code again to log in. Can any middleware cause this problem?

blueset commented 2 years ago

Patch Middleware might be relevant, as it directly modifies the code of EWS. Maybe try disable it temporarily to see if it helps?

FlechazoPh commented 2 years ago

I will try to disable it and see if it helps, (but the Patch Middleware is useful...)