ehForwarderBot / efb-qq-slave

EFB QQ Slave, a channel for EH Forwarder Bot. EFB QQ从端
GNU General Public License v3.0
447 stars 48 forks source link

mirai客户端兼容模式,efb在初始化显示 Initializing master blueset.telegram 时卡住 #77

Open jzl2163 opened 3 years ago

jzl2163 commented 3 years ago

手动Ctrl+C后,弹出如下日志: --- Logging error --- Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/chat_object_cache.py", line 38, in init chats = module.get_chats() File "/usr/local/lib/python3.8/dist-packages/efb_qq_slave/init.py", line 89, in get_chats return self.QQClient.get_chats() File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 1009, in get_chats qq_chats = self.get_friends() File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 468, in get_friends efb_chat = self.chat_manager.build_efb_chat_as_private(context) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/ChatMgr.py", line 76, in build_efb_chat_as_private i: dict = self.channel.QQClient.get_stranger_info(uid) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 407, in get_stranger_info return get_stranger_info_via_qzone(user_id) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/Utils.py", line 816, in get_stranger_info_via_qzone resp = requests.get("https://users.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?uins={id}".format(id=uin)) File "/usr/local/lib/python3.8/dist-packages/requests/api.py", line 76, in get return request('get', url, params=params, kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 411, in connect self.sock = ssl_wrapsocket( File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl.py", line 428, in ssl_wrap_socket ssl_sock = _ssl_wrap_socketimpl( File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl.py", line 472, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() File "/usr/local/lib/python3.8/dist-packages/ehforwarderbot/main.py", line 106, in stop_gracefully coordinator.slaves[i].stop_polling() File "/usr/local/lib/python3.8/dist-packages/efb_qq_slave/init.py", line 95, in stop_polling self.QQClient.stop_polling() File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 1054, in stop_polling self.self_update_timer.cancel() AttributeError: 'CoolQ' object has no attribute 'self_update_timer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.8/logging/init.py", line 1081, in emit msg = self.format(record) File "/usr/lib/python3.8/logging/init.py", line 925, in format return fmt.format(record) File "/usr/lib/python3.8/logging/init.py", line 664, in format record.message = record.getMessage() File "/usr/lib/python3.8/logging/init.py", line 369, in getMessage msg = msg % self.args ValueError: unsupported format character ' ' (0x20) at index 42 Call stack: File "/usr/local/bin/ehforwarderbot", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/ehforwarderbot/main.py", line 339, in main init(conf) File "/usr/local/lib/python3.8/dist-packages/ehforwarderbot/main.py", line 147, in init coordinator.add_channel(module(instance_id=instance_id)) File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/init.py", line 125, in init self.chat_manager: ChatObjectCacheManager = ChatObjectCacheManager(self) File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/chat_object_cache.py", line 40, in init self.logger.exception("Error occurred while getting chats from %. " Message: 'Error occurred while getting chats from %. ETM will report no chat from this channel until further noticed.' Arguments: ('milkice.qq',)

之后的初始化过程一切正常,且个人与群组收到信息均正常转发: 2021-03-11 09:44:05,062 [Level 99]: ehforwarderbot.main (main.init; main.py:149) Master channel Telegram Master (blueset.telegram) # Default profile is initialized. 2021-03-11 09:44:05,062 [Level 99]: ehforwarderbot.main (main.init; main.py:155) All channels initialized. 2021-03-11 09:44:05,062 [Level 99]: ehforwarderbot.main (main.init; main.py:169) All middlewares are initialized. [11/Mar/2021:09:44:05] ENGINE Bus STARTING [11/Mar/2021:09:44:05] ENGINE Started monitor thread 'Autoreloader'. [11/Mar/2021:09:44:05] ENGINE Serving on http://127.0.0.1:8000 [11/Mar/2021:09:44:05] ENGINE Bus STARTED

并且从Telegram上发信息,群组的信息/图片可以正常发送,但个人信息无法发送,出现如下错误: 2021-03-11 09:51:46,116 [ERROR]: efb_telegram_master.master_message (master_message.process_telegram_message; master_message.py:408) Message is not sent. (update: (这部分涉及隐私已略去), exception: CoolQ HTTP API encountered an error! Status Code:200 Return Code:100) Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 696, in _coolq_api_wrapper res = func(**kwargs) File "/usr/local/lib/python3.8/dist-packages/cqhttp/init.py", line 25, in do_call raise Error(resp.status_code, data.get('retcode')) cqhttp.Error: (200, 100)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/master_message.py", line 391, in process_telegram_message slave_msg = coordinator.send_message(m) File "/usr/local/lib/python3.8/dist-packages/ehforwarderbot/coordinator.py", line 115, in send_message return slaves[msg.deliver_to.channel_id].send_message(msg) File "/usr/local/lib/python3.8/dist-packages/efb_qq_slave/init.py", line 80, in send_message return self.QQClient.send_message(msg) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 536, in send_message msg.uid = self.coolq_send_message(chat_type[0], chat_type[1], msg.text) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 689, in coolq_send_message res = self.coolq_api_query('send_msg', message_type=msg_type, {keyword + '_id': uid}, message=message) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 724, in coolq_api_query return self._coolq_api_wrapper(func_name, kwargs) File "/usr/local/lib/python3.8/dist-packages/efb_qq_plugin_coolq/CoolQ.py", line 707, in _coolq_api_wrapper raise api_ex efb_qq_plugin_coolq.Exceptions.CoolQAPIFailureException: CoolQ HTTP API encountered an error! Status Code:200 Return Code:100

milkice233 commented 3 years ago

兼容模式现在暂不支持(还在重构中),请先使用 mirai-api-http 模式