Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room.findAll() get error when rooms more than 400 #1112

Closed
lijiarui opened this issue Feb 28, 2018 · 2 comments
Closed

Room.findAll() get error when rooms more than 400 #1112

lijiarui opened this issue Feb 28, 2018 · 2 comments

Comments

@lijiarui
Copy link
Member

lijiarui commented Feb 28, 2018

Enviroment

Starting Wechaty v0.13.72 with Node.js v9.6.1 ...

wechaty@0.13.72 doctor /wechaty
npm run check-node-version && ts-node bin/doctor

wechaty@0.13.72 check-node-version /wechaty
check-node-version --node ">= 8.5"

Wechaty Doctor

  1. Wechaty version: #git[b5c0c14]
  2. Linux x64 version 3.16.0-4-amd64 memory 353/998 MB
  3. Docker: true
  4. Node version: v9.6.1
  5. Tcp IPC TEST: PASS

PROBLEM

When the bot has too many rooms(400-500), when I try Room.findAll() will get the following error. While if the room is under 200, all works well.

17:52:35 WARN Room parse() on a empty rawObj?
17:52:35 ERR Room contactGetter(@@c5529e069a00362de84bcd47411e5937b42aa5cced47485f6dd88e4a86fc3aec) exception: no this.obj set after contactGetter
17:52:35 WARN Room parse() on a empty rawObj?
17:52:35 ERR Room contactGetter(@@f06db6946a1b6700c3ce5fc316236bcffc07e8085d2c30b8eef0130b246656e3) exception: no this.obj set after contactGetter
^C17:52:36 WARN PuppetWebBridge proxyWechaty() exception: Protocol error (Runtime.evaluate): Target closed.
17:52:36 WARN PuppetWebBridge proxyWechaty() exception: Protocol error (Runtime.evaluate): Target closed.
17:52:36 WARN PuppetWebBridge proxyWechaty() exception: Protocol error (Runtime.evaluate): Target closed.
17:52:36 WARN PuppetWebBridge proxyWechaty() noWechaty exception: Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
17:52:36 WARN PuppetWebBridge proxyWechaty() noWechaty exception: Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
17:52:36 WARN PuppetWebBridge proxyWechaty() noWechaty exception: Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
17:52:36 WARN PuppetWebBridge proxyWechaty() noWechaty exception: Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.

REPRODUCE

snip code as follows

import { Wechaty, Room } from 'wechaty'
const bot = Wechaty.instance({ profile: 'sara' })

bot
.on('scan', (url, code) => {
  if (!/201|200/.test(String(code))) {
    let loginUrl = url.replace(/\/qrcode\//, '/l/')
    console.log(`${url} \n ${code}`)
  }
})
.on('login', async function (user) {
   console.log(`${user}login`)

  setTimeout(async function() {
    console.log('加载群组信息如下')
    const list = await Room.findAll()
    console.log(list)
  }, 10 * 1000)
})
.on('logout', function (user) {
   console.log(`${user.name()} logout`)
})
.on('error', err => {
   console.error(`@@@@@@@@@@@@ exit for ${JSON.stringify(err)} @@@@@@@@@@@@`)
})
.init()
.catch(e => {
  console.error('Bot', 'init() fail: %s', e)
})
@lijiarui
Copy link
Member Author

lijiarui commented Feb 28, 2018

This docker version (zixia/wechaty@sha256:4406ddb154bb1b90329ba6a94abe812ce8e3f5a0c983f7ed2985b03304517642) cannot works well too, but, it gets the following error instead of log in the issue above

10:24:46 ERR Room contactGetter(@@1283a71094d95bec4c60b1bf90bf5b1f51faf06ce3e63c7ffa48386c0d9376c1) exception: Cannot read property 'MemberList' of undefined
(node:30) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'MemberList' of undefined
(node:30) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
10:24:46 ERR Room contactGetter(@@2fe0de9c03bcd452bc3056b60592e01f4da0d8e69928da7b9b4f0b4519546b4b) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@ffec3fd4adb5d33645f50d7a7c79ae2743f5f1383faea2066cd0344b51aef26a) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@f497847dcc58aadfec0039d7dee64b9da02d6b0fed4f0b6c3ae4f52da5d1ebd2) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@ae344cb8e2fc03e10c977dec118acd53e9778bae7cd35396a88dc000ec2ad55e) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@98f34f2b8a5c0128bcf782be072b528a1aa3e941b266f133911440a38baa6d4a) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@2b42b3dd9373ce75c5a7639eeaa69098435258a1516b70568531d37581f7607d) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@0945bede8127d4d9f6ef46c90012bfe1fd7a3225bacbc65597334ec4d5a3f1e3) exception: Cannot read property 'MemberList' of undefined
10:24:46 ERR Room contactGetter(@@83cd85219777074caa4635d81c99b120baec0fbb3584906361ce3bc6280bedd6) exception: Cannot read property 'MemberList' of undefined

docker version as follows

Starting Wechaty v0.13.32 with Node.js v8.9.1 ...

wechaty@0.13.32 doctor /wechaty
npm run check-node-version && ts-node bin/doctor

wechaty@0.13.32 check-node-version /wechaty
check-node-version --node ">= 7"

node: 8.9.1

Wechaty Doctor

  1. Wechaty version: #git[9047ce9]
  2. Linux x64 version 3.16.0-4-amd64 memory 71/998 MB
  3. Docker: true
  4. Node version: v8.9.1
  5. Tcp IPC TEST: PASS

@huan
Copy link
Member

huan commented Jul 15, 2018

After v0.16, the puppet-puppeteer had been rewriten.

So I'll close issue, and please file a new issue at wechaty-puppet-puppeteer if you stil have this problem, thank you very much.

@huan huan closed this as completed Jul 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants