ehForwarderBot / efb-wechat-slave

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

同时登入多个微信只有一个登录了 #46

Closed kettly1260 closed 5 years ago

kettly1260 commented 5 years ago

版本信息

2.0.0b20 ### 问题描述 设置ID想登录多个微信,但第二个从端扫描二维码确认登录之后并没有登录成功 ### 重现步骤

设置: master_channel: blueset.telegram slave_channels:

请在这里贴出您的 Verbose 日志。如果您对隐私有所顾虑,您可以自行 隐去隐私信息、或 GPG 加密至 BD6B65EC00638DC9083781D5D4B65BB1A106200A。



<ehforwarderbot.__main__ (__main__.init; __main__.py:96)

Slave channel WeChat Slave (blueset.wechat) # xigua is initialized.
2019-04-22 17:13:59,325 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:99)

Initializing master blueset.telegram...
2019-04-22 17:13:59,871 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:109)

Master channel Telegram Master (blueset.telegram) # Default profile is initialized.
2019-04-22 17:13:59,872 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:111)

All channels initialized.
2019-04-22 17:13:59,872 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:125)

All middlewares are initialized.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/itchat/components/login.py", line 281, in maintain_loop
    exitCallback()
  File "/usr/local/lib/python3.6/dist-packages/efb_wechat_slave/__init__.py", line 264, in exit_callback
    if not getattr(coordinator, 'master', default=None):
TypeError: getattr() takes no keyword arguments

2019-04-22 17:14:23,301 [ERROR]: telegram.ext.dispatcher (dispatcher.process_update; dispatcher.py:301)
    An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/telegram/ext/dispatcher.py", line 279, in process_update
    handler.handle_update(update, self)
  File "/usr/local/lib/python3.6/dist-packages/telegram/ext/commandhandler.py", line 173, in handle_update
    return self.callback(dispatcher.bot, update, **optional_args)
  File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/commands.py", line 132, in extra_listing
    msg += "\n\n<b>%s %s (%s)</b>" % (i.channel_emoji, i.module_name, i.module_id)
AttributeError: 'WeChatChannel' object has no attribute 'module_name'
^CException ignored in: <module 'threading' from '/usr/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 1294, in _shutdown
    t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
>
kettly1260 commented 5 years ago

补充错误

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/itchat/components/login.py", line 281, in maintain_loop
    exitCallback()
  File "/usr/local/lib/python3.6/dist-packages/efb_wechat_slave/__init__.py", line 264, in exit_callback
    if not getattr(coordinator, 'master', default=None):
TypeError: getattr() takes no keyword arguments
blueset commented 5 years ago

已修复。

kettly1260 commented 5 years ago

@blueset

已修复。

今天尝试两个从端登录,登录的时候依旧报错。该提示还会显示在TG回话中,从新扫描二维码也没用

2019-06-02 14:14:59,119 [ERROR]: efb_telegram_master.slave_message (slave_message.send_message; slave_message.py:214)
    [None] Error occurred while processing message from slave channel.
Message: <EFBMsg, <EFBChat: EWS User Auth (__system__) @ WeChat Slave>@<EFBChat: EWS User Auth (__system__) @ WeChat Slave> [Image]: QR code expired, please scan the new one.; Attributes: None; Delivering to: <efb_telegram_master.TelegramChannel object at 0x7f341bff4198>; Edited: False; System message: False; Substitutions: None; Target messages: None; UID: None; Reactions: {}; File: <tempfile._TemporaryFileWrapper object at 0x7f341aeee048> (None @ /tmp/tmp9t9sm5eo.png), image/png; Vendor: {}>
IntegrityError('NOT NULL constraint failed: msglog.slave_message_id',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2936, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.IntegrityError: NOT NULL constraint failed: msglog.slave_message_id

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/slave_message.py", line 210, in send_message
    self.db.add_msg_log(**msg_log)
  File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/db.py", line 254, in add_msg_log
    mime=mime
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 5926, in create
    inst.save(force_insert=True)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 6107, in save
    self.insert(**field_dict).execute()
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 1778, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 1849, in execute
    return self._execute(database)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2567, in _execute
    return super(Insert, self)._execute(database)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2316, in _execute
    cursor = database.execute(self)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2949, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2943, in execute_sql
    self.commit()
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2725, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2936, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: msglog.slave_message_id

2019-06-02 14:15:06,469 [ERROR]: efb_telegram_master.slave_message (slave_message.send_message; slave_message.py:214)
    [None] Error occurred while processing message from slave channel.
Message: <EFBMsg, <EFBChat: EWS User Auth (__system__) @ WeChat Slave>@<EFBChat: EWS User Auth (__system__) @ WeChat Slave> [Text]: Confirm on your phone.; Attributes: None; Delivering to: <efb_telegram_master.TelegramChannel object at 0x7f341bff4198>; Edited: False; System message: False; Substitutions: None; Target messages: None; UID: None; Reactions: {}; File: None (None @ None), None; Vendor: {}>
IntegrityError('NOT NULL constraint failed: msglog.slave_message_id',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2936, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.IntegrityError: NOT NULL constraint failed: msglog.slave_message_id

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/slave_message.py", line 210, in send_message
    self.db.add_msg_log(**msg_log)
  File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/db.py", line 254, in add_msg_log
    mime=mime
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 5926, in create
    inst.save(force_insert=True)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 6107, in save
    self.insert(**field_dict).execute()
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 1778, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 1849, in execute
    return self._execute(database)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2567, in _execute
    return super(Insert, self)._execute(database)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2316, in _execute
    cursor = database.execute(self)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2949, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2943, in execute_sql
    self.commit()
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2725, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/dist-packages/peewee.py", line 2936, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: msglog.slave_message_id

2019-06-02 14:15:08,516 [ERROR]: efb_telegram_master.slave_message (slave_message.send_message; slave_message.py:214)
blueset commented 5 years ago

抱歉,目前我这边的资源并没有办法测试两个微信同时登录(因为没有两个老微信测试号)。

根据上面的日志,我在 638489c (alpha 22) 里面尝试着修复了这一问题。

如果 alpha 22 版本解决了这一问题,请关闭此 issue。谢谢。

kettly1260 commented 5 years ago

抱歉,目前我这边的资源并没有办法测试两个微信同时登录(因为没有两个老微信测试号)。

根据上面的日志,我在 638489c (alpha 22) 里面尝试着修复了这一问题。

如果 alpha 22 版本解决了这一问题,请关闭此 issue。谢谢。

问题已解决。谢谢大佬