juzibot / donut-tester

40 stars 4 forks source link

Cannot login again after automatically logged out #87

Open suntong opened 3 years ago

suntong commented 3 years ago

Important:Please file the issue follow the template, or we won't help you to solve the problem.

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:
    rm -rf package-lock.json
    rm -rf node_modules
    npm install

No,

  1. Please search in FAQ List first, and make sure your problem has not been solved before.

No,

  1. Please search in the issue first, and make sure your problem had not been reported before

No,

1. Versions

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

2. Describe the bug

3. To Reproduce

Steps to reproduce the behavior:

  1. update everything
  2. run node examples/ding-dong-bot.js from the official wechaty-getting-started

4. Expected behavior

Login will stay.

5. Actual behavior

automatically logged out 15~20 seconds after successful normal login

6. Full Output Logs

Set env WECHATY_LOG=silly in order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)

We need full log instead of log screenshot or log fragments!

Show Logs ```shell $ WECHATY_LOG=silly node examples/ding-dong-bot.js 00:02:52 SILL Puppet Config: WECHATY_LOG set level to silly 00:02:52 VERB Wechaty (ding-dong-bot) start() v0.59.8 is starting... 00:02:52 SILL StateSwitch on() is false 00:02:52 SILL StateSwitch off() is true 00:02:52 VERB StateSwitch off(true) <- (true) 00:02:52 SILL StateSwitch on() is false 00:02:52 VERB StateSwitch on(pending) <- (false) 00:02:52 VERB MemoryCard constructor("ding-dong-bot") 00:02:52 VERB MemoryCard getStorage() for storage type: N/A 00:02:52 VERB getStorage name: ding-dong-bot, options: {"type":"file"} 00:02:52 VERB StorageFile constructor(ding-dong-bot, ...) 00:02:52 VERB StorageBackend constructor(ding-dong-bot, { type: file }) . . . 00:02:52 VERB PuppetService start() 00:02:52 SILL StateSwitch on() is false 00:02:52 SILL StateSwitch on() is false 00:02:52 VERB StateSwitch on(pending) <- (false) 00:02:52 VERB PuppetService startGrpcClient() 00:02:52 VERB PuppetService discoverServiceIp(puppet_donut_37...6d) 00:02:53 VERB PuppetService startGrpcStream() 00:02:54 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_SCAN(22), payload:"{"qrcode":"http://weixin.qq.com/x/YpaNw6cc5qZm_aWghWxs","status":2}"}) . . . qrcode . . . 00:02:54 INFO StarterBot onScan: Waiting(2) - https://wechaty.js.org/qrcode/http%3A%2F%2Fweixin.qq.com%2Fx%2FYpaNw6cc5qZm_aWghWxs 00:02:54 SILL StateSwitch on() is pending 00:02:54 VERB StateSwitch on(true) <- (pending) 00:02:54 VERB Wechaty on(heartbeat, listener) registering... listenerCount: 0 00:02:54 SILL StateSwitch on() is pending 00:02:54 VERB StateSwitch on(true) <- (pending) 00:02:54 INFO StarterBot Starter Bot Started. 00:03:02 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload:"{"data":"debounce before login","timeout":240000}"}) 00:03:02 SILL Wechaty memoryCheck() free: 1053 MB, require: 4 MB 00:03:17 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_LOGIN(25), payload:"{"contactId":"wxid_dt09...v22"}"}) 00:03:17 SILL Wechaty memoryCheck() free: 1052 MB, require: 4 MB 00:03:17 VERB Contact load(wxid_dt09...v22) init pool 00:03:17 SILL Contact constructor(wxid_dt09...v22) 00:03:17 SILL Contact ready() @ Puppet#0(ding-dong-bot) with id="wxid_dt09...v22" 00:03:17 SILL Puppet contactPayload(wxid_dt09...v22) cache MISS 00:03:17 VERB PuppetService contactRawPayload(wxid_dt09...v22) 00:03:17 SILL Puppet contactPayload(wxid_dt09...v22) cache SET 00:03:17 INFO StarterBot Contact login 00:03:30 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_READY(23), payload:"{"data":"ready"}"}) 00:03:30 SILL Wechaty memoryCheck() free: 1052 MB, require: 4 MB 00:03:30 SILL Wechaty initPuppetEventBridge() puppet.on(ready) 00:03:30 SILL StateSwitch on() is false 00:03:30 VERB StateSwitch on(true) <- (false) 00:03:37 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload:"{"data":"[object Object]","timeout":240000}"}) 00:03:37 SILL Wechaty memoryCheck() free: 1052 MB, require: 4 MB 00:03:38 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_LOGOUT(26), payload:"{"contactId":"wxid_dt09...v22","data":"微信已退出登录"}"}) 00:03:38 SILL Wechaty memoryCheck() free: 1052 MB, require: 4 MB 00:03:38 SILL Contact ready() @ Puppet#0(ding-dong-bot) with id="wxid_dt09...v22" 00:03:38 SILL Contact ready() isReady() true 00:03:38 INFO StarterBot Contact logout 00:04:08 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload:"{"data":"debounce before login","timeout":240000}"}) 00:04:08 SILL Wechaty memoryCheck() free: 1053 MB, require: 4 MB ^C # when trying again, will get . . . 00:18:47 VERB PuppetService startGrpcStream() 00:18:47 SILL StateSwitch on() is pending 00:18:47 VERB StateSwitch on(true) <- (pending) 00:18:47 VERB Wechaty on(heartbeat, listener) registering... listenerCount: 0 00:18:47 SILL StateSwitch on() is pending 00:18:47 VERB StateSwitch on(true) <- (pending) 00:18:47 INFO StarterBot Starter Bot Started. 00:19:08 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload:"{"data":"debounce before login","timeout":240000}"}) 00:19:08 SILL Wechaty memoryCheck() free: 1051 MB, require: 4 MB 00:19:38 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload:"{"data":"debounce before login","timeout":240000}"}) 00:19:38 SILL Wechaty memoryCheck() free: 1050 MB, require: 4 MB ``` then never able to login successfully any more

7. Additional context

Two cases logged above

My preliminary guessing is that after WX see that the onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1) heartbeat got a timeout, it logs user out from server side.

[bug]

suntong commented 3 years ago

I understand that the problem might not be fixable in a short while, but please try to

so that we don't need to bother already-busy human beings to disconnected.

Thanks

suntong commented 3 years ago

I cannot do anything to reset it myself, I even tried 网页微信, but got this instead:

image

suntong commented 3 years ago

So I think this is more a logic loophole on the donut side, which somehow locked me in, as otherwise 网页微信 would work.