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

WARN PuppetPuppeteer initWatchdogForPuppet() dog.on(reset) last food:inited, timeout:120000 #1439

Closed
xxxxlr opened this issue Jul 2, 2018 · 8 comments
Labels

Comments

@xxxxlr
Copy link

xxxxlr commented Jul 2, 2018

Provide Your Network Information

  1. Where is the location of your server? (i.e. City, or In/Out China)
    China
  2. Which cloud platform(AliYun/Qcloud/DigitalOcean/etc) are you using?
    Local

Run npm run doctor or wechaty run doctor(for docker user), paste output here

Wechaty Doctor

  1. Wechaty version: 0.16.5
  2. Linux x64 version 3.13.0-92-generic memory 1776/23800 MB
  3. Docker: false
  4. Node version: v8.11.3
  5. Tcp IPC TEST: PASS

Expected behavior

Should not see the following warning message all the time

'WARN PuppetPuppeteer initWatchdogForPuppet() dog.on(reset) last food:inited, timeout:120000' and the browser(set WECHATY_HEAD=true) should not restart with the reset

Actual behavior

After scaning qrcode to login, the terminal keeps saying 'WARN PuppetPuppeteer initWatchdogForPuppet() dog.on(reset) last food:inited, timeout:120000' and the browser keeps restarting. Although events like 'message' work fine.

Steps to reproduce the behavior (and fixes, if any)

  1. npm --registry https://registry.npm.taobao.org install wechaty

  2. node test.js

test.js file:

const { Wechaty } = require('wechaty') // import { Wechaty } from 'wechaty'

Wechaty.instance() // Global Instance
.on('scan', (qrcode, status) => console.log(`Scan QR Code to login: ${status}\n${qrcode}`))
.on('login',            user => console.log(`User ${user} logined`))
.on('message',       message => console.log(`Message: ${message}`))
.start()

Full Output Logs

$ WECHATY_LOG=silly WECHATY_HEAD=true node test.js

Paste the full output logs here with WECHATY_LOG=silly set

# PASTE FULL LOG OUTPUT AT HERE:
......
17:37:34 WARN PuppetPuppeteer initWatchdogForPuppet() dog.on(reset) last food:inited, timeout:120000
17:37:34 VERB PuppetPuppeteer quit()
17:37:34 SILL StateSwitch <PuppetPuppeteer> off() is false
17:37:34 SILL StateSwitch <PuppetPuppeteer> off() is false
17:37:34 VERB StateSwitch <PuppetPuppeteer> off(pending) <- (false)
17:37:34 VERB PuppetPuppeteer quit() make watchdog sleep before do quit
17:37:34 VERB PuppetPuppeteerBridge quit()
17:37:34 SILL StateSwitch <PuppetPuppeteerBridge> off() is false
17:37:34 VERB StateSwitch <PuppetPuppeteerBridge> off(pending) <- (false)
17:37:34 SILL PuppetPuppeteerBridge quit() page.close()-ed
17:37:34 SILL PuppetPuppeteerBridge quit() browser.close()-ed
17:37:34 SILL StateSwitch <PuppetPuppeteerBridge> off() is pending
17:37:34 VERB StateSwitch <PuppetPuppeteerBridge> off(true) <- (pending)
17:37:34 SILL StateSwitch <PuppetPuppeteer> off() is pending
17:37:34 VERB StateSwitch <PuppetPuppeteer> off(true) <- (pending)
17:37:34 VERB PuppetPuppeteer start() with default
17:37:34 SILL StateSwitch <PuppetPuppeteer> on() is false
17:37:34 VERB StateSwitch <PuppetPuppeteer> on(pending) <- (false)
17:37:34 VERB PuppetPuppeteer initWatchdogForPuppet()
17:37:34 VERB PuppetPuppeteer initWatchdogForScan()
17:37:34 VERB PuppetPuppeteer initBridge()
17:37:34 SILL StateSwitch <PuppetPuppeteer> off() is false
17:37:34 VERB PuppetPuppeteerBridge init()
17:37:34 SILL StateSwitch <PuppetPuppeteerBridge> on() is false
17:37:34 VERB StateSwitch <PuppetPuppeteerBridge> on(pending) <- (false)
17:37:34 VERB PuppetPuppeteerBridge initBrowser()
17:37:34 VERB PuppetPuppeteerBridge initBrowser() version: Chrome/69.0.3452.0
17:37:34 VERB PuppetPuppeteerBridge init() initBrowser() done
17:37:34 VERB PuppetPuppeteerBridge initPage()
17:37:34 VERB MemoryCard get(cookies)
17:37:34 VERB PuppetPuppeteerBridge cookieDomain([object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object])
17:37:34 SILL PuppetPuppeteerBridge cookieDomain() got https://web.wechat.com
17:37:34 VERB PuppetPuppeteerBridge initPage() before page.goto(url)
17:37:35 VERB PuppetPuppeteerBridge initPage() after page.goto(url)
17:37:35 SILL PuppetPuppeteerBridge initPage() page.setCookie() 9 cookies set back
17:37:35 VERB PuppetPuppeteerBridge initPage() on(load) https://web.wechat.com/
17:37:35 SILL StateSwitch <PuppetPuppeteerBridge> off() is false
17:37:35 VERB PuppetPuppeteerBridge readyAngular()
17:37:35 VERB PuppetPuppeteerBridge inject()
17:37:35 SILL PuppetPuppeteerBridge inject() eval(Wechaty) return code[200] message[WechatyBro Inject Done]
17:37:35 SILL PuppetPuppeteerBridge proxyWechaty(init)
17:37:35 SILL PuppetPuppeteerBridge inject() Wechaty.init() return code[200] message[WechatyBro Init Succ]
17:37:35 VERB PuppetPuppeteerBridge ding(ding() OK!)
17:37:35 SILL PuppetPuppeteerBridge proxyWechaty(ding, ding() OK!)
17:37:35 SILL PuppetPuppeteerBridge inject() ding success
17:37:35 VERB PuppetPuppeteerBridge clickSwitchAccount()
17:37:35 SILL PuppetPuppeteerBridge clickSwitchAccount() button not found
17:37:35 SILL StateSwitch <PuppetPuppeteerBridge> on() is pending
17:37:35 VERB StateSwitch <PuppetPuppeteerBridge> on(true) <- (pending)
17:37:35 VERB PuppetPuppeteerBridge init() initPage() done
17:37:35 VERB PuppetPuppeteer initBridge() done
17:37:35 SILL StateSwitch <PuppetPuppeteer> on() is pending
17:37:35 VERB StateSwitch <PuppetPuppeteer> on(true) <- (pending)
17:37:35 SILL PuppetPuppeteer initWatchdogForPuppet() dog.on(feed, food={type=undefined, data=inited})
17:37:35 VERB PuppetPuppeteer start() done
......
......
 WARN PuppetPuppeteer initWatchdogForPuppet() dog.on(reset) last food:inited, 
......

@huan
Copy link
Member

huan commented Jul 2, 2018

I just use https://github.com/lijiarui/wechaty-getting-started and the code can be ran without any problem:

$ pwd
/home/zixia/git/wechaty-getting-started

$ cat examples/six-lines-bot.js 
const { Wechaty } = require('wechaty') // import { Wechaty } from 'wechaty'
Wechaty.instance() // Global Instance
.on('scan', (qrcode, status) => console.log(`Scan QR Code to login: ${status}\n${qrcode}`))
.on('login',            user => console.log(`User ${user} logined`))
.on('message',       message => console.log(`Message: ${message}`))
.start()

$ node examples/six-lines-bot.js 
00:55:49 INFO Wechaty start() v0.17.71 is starting...
00:55:49 INFO Wechaty initPuppet() using puppet: puppeteer
Scan QR Code to login: 0
https://login.weixin.qq.com/l/wfFWHCi2TQ==

Can you try to use that repository and reproduce your error?

@xxxxlr
Copy link
Author

xxxxlr commented Jul 3, 2018

Unfortunately, I followed the wecahty-getting-started as you descriped from scratch, but still having the same 'reset' issue. However it seems that nobody else is having the same problem...So I will try to look for some env issue on my local machine.
But thanks for looking into it.

@xxxxlr xxxxlr closed this as completed Jul 3, 2018
@xxxxlr xxxxlr reopened this Jul 3, 2018
@xxxxlr
Copy link
Author

xxxxlr commented Jul 3, 2018

Reopen since I found another person having the same issue running the getting-started repo

reference https://github.com/lijiarui/wechaty-getting-started/issues/20

@huan
Copy link
Member

huan commented Jul 3, 2018

Okay, got it. Thanks for reporting and we will go to confirm it later.

@zarknight
Copy link

zarknight commented Jul 5, 2018

I got the same issue on my Macbook. Everything is OK after the bot being started, but after several minutes, the issue occurs.

@huan
Copy link
Member

huan commented Jul 5, 2018

It seems the Wechaty PuppetPuppeteer has this bug for Wechaty v0.15 v0.16 v0.17, and please know that those versions are all not STABLE(please see the release notes), because of v0.15 & v0.17 is the alpha version(see #905), v0.16 is a beta version for Wechaty PuppetPadchat. (see release notes for v0.16)

Workaround

Please install wechaty@0.14 if you want to use the Web API, it's the latest STABLE version.

Roadmap

We are planing to fix this issue not after Wechaty v0.20.

@linhaobin
Copy link

linhaobin commented Jul 6, 2018

temp

const wechaty = new Wechaty()
wechaty.on('login', () => {
  const watchdog = () => {
    wechaty.puppet.emit('watchdog', { data: 'any', timeout: 2 * 60 * 1000 })

    setTimeout(watchdog, 60 * 1000)
  }
  watchdog()
})

@huan
Copy link
Member

huan commented Jul 6, 2018

This issue should be fixed on Wechaty v0.17.116 or above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants