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

wechaty mybot.js start error #126

Closed
z8313568 opened this issue Dec 9, 2016 · 2 comments
Closed

wechaty mybot.js start error #126

z8313568 opened this issue Dec 9, 2016 · 2 comments

Comments

@z8313568
Copy link

z8313568 commented Dec 9, 2016

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

wechaty run doctor

ubuntu@VM-20-53-ubuntu:~$ wechaty run doctor

Starting Wechaty ... v0.6.46

wechaty@0.6.46 doctor /wechaty
ts-node bin/doctor

SILL Brolog WECHATY_LOG set level to silly
SILL StateMonitor constructor(Wechaty, standby)
VERB Wechaty contructor()
SILL Wechaty version() form development environment is not availble: Error: spawnSync git ENOENT

Wechaty Doctor

  1. Wechaty version: 0.6.46
  2. Linux x64 version 3.13.0-105-generic memory 67/993 MB
  3. Docker: true
  4. Node version: v7.2.1

Expected behavior

Actual behavior

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

Paste the full output logs here with WECHATY_LOG=silly set

Starting Wechaty ... v0.6.46

Working directory: /bot
Executing node mybot.js
SILL Brolog WECHATY_LOG set level to silly
SILL StateMonitor constructor(Wechaty, standby)
VERB Wechaty contructor()
VERB Wechaty addListener(scan, function)
VERB Wechaty addListener(login, function)
VERB Wechaty addListener(message, function)
SILL Wechaty version() test ENOENT: no such file or directory, stat '/bot/node_modules/wechaty/dist/.git'
INFO Wechaty v0.6.20 initializing...
VERB Wechaty puppet: web
VERB Wechaty head: chrome
VERB Wechaty profile: null
VERB Wechaty uuid: 849988b7-6a2a-4566-bc0c-1c81814ab894
SILL StateMonitor Wechaty:current() standby
VERB StateMonitor Wechaty:target(ready) <- (standby)
VERB StateMonitor Wechaty:current(ready,false) <- (standby,true)
SILL StateMonitor constructor(Puppet, dead)
VERB Config puppetInstance(PuppetWeb)
VERB PuppetWeb init() with head:chrome, profile:null
VERB StateMonitor Puppet:target(live) <- (dead)
VERB StateMonitor Puppet:current(live,false) <- (dead,true)
SILL UtilLib getPort(18788)
SILL UtilLib getPort(18788) return: 19583
VERB PuppetWeb init() getPort 19583
VERB PuppetWeb initServer()
SILL StateMonitor Puppet:target() live
VERB PuppetWebServer init() on port 19583
VERB PuppetWebServer createHttpsServer() listen on port 19583
VERB PuppetWeb initServer() done
VERB PuppetWeb initBrowser()
SILL StateMonitor constructor(Browser, close)
VERB PuppetWebBrowser constructor() with head(chrome) sessionFile(null)
VERB PuppetWebBrowserDriver constructor(chrome)
VERB PuppetWebBrowserCookie constructor(BrowserDriver, )
SILL StateMonitor Puppet:target() live
VERB PuppetWebBrowser init()
SILL StateMonitor Browser:current() close
VERB StateMonitor Browser:target(open) <- (close)
VERB StateMonitor Browser:current(open,false) <- (close,true)
VERB PuppetWebBrowserDriver init() for head: chrome
VERB PuppetWebBrowserDriver initChromeDriver()
VERB PuppetWebBrowserDriver initChromeDriver() wechaty in docker confirmed(should not show this in CI)
VERB PuppetWebBrowserDriver initChromeDriver() new Builder()
VERB PuppetWebBrowserDriver initChromeDriver() new Builder() done
VERB PuppetWebBrowserDriver valid()
VERB PuppetWebBrowserDriver valid() getSession()
VERB PuppetWebBrowserDriver valid() getSession() done
VERB PuppetWebBrowserDriver valid() driver.getSession() done(out)
VERB PuppetWebBrowserDriver valid() driver.executeScript() done
SILL PuppetWebBrowserDriver valid() driver ok
VERB PuppetWebBrowserDriver initChromeDriver() valid() done: true
SILL PuppetWebBrowserDriver initChromeDriver() success
VERB PuppetWebBrowser init() driver.init() done
VERB PuppetWebBrowser open(https://wx.qq.com/zh_CN/htmledition/v2/images/webwxgeticon.jpg)
SILL PuppetWebBrowserCookie load() skipped: no session store file
VERB PuppetWebBrowser open(https://wx.qq.com)
SILL StateMonitor Browser:target() open
VERB StateMonitor Browser:current(open,true) <- (open,false)
VERB PuppetWeb initBrowser() done
VERB PuppetWeb initBridge()
VERB PuppetWebBridge new Bridge({puppet: PuppetWeb, port: 19583})
SILL StateMonitor Puppet:target() live
VERB PuppetWebBridge init()
VERB PuppetWebBridge inject()
VERB PuppetWebBridge getInjectio()
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute("injectioReturnValue = /** * * Wechaty - Wechat for Bot, and human who talk to ... ")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge inject() eval(Wechaty) return code[200] message[WechatyBro Inject Done] port[19583]
VERB PuppetWebBridge proxyWechaty(init, )
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute("return typeof WechatyBro === "undefined"")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute(" const callback = arguments[arguments.length - 1] const isAsync = (typeof ... ")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge inject() Wechaty.init() return code[200] message[WechatyBro Init Succ on port: 19583] port[19583]
VERB PuppetWebBridge ding(inject())
VERB PuppetWebBridge proxyWechaty(ding, inject())
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute("return typeof WechatyBro === "undefined"")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute(" const callback = arguments[arguments.length - 1] const isAsync = (typeof ... ")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge inject() ding success
VERB PuppetWeb initBridge() done
VERB StateMonitor Puppet:current(live,true) <- (live,false)
SILL PuppetWebWatchdog onFeed: 120000, HEARTBEAT[inited]
SILL StateMonitor Puppet:target() live
SILL StateMonitor Puppet:inprocess() false
VERB PuppetWebWatchdog clearWatchDogTimer() nothing to clear
SILL PuppetWebWatchdog clearWatchDogTimer() [NaN] seconds left
SILL PuppetWebWatchdog setWatchDogTimer(120000, HEARTBEAT:[inited])
SILL PuppetWebWatchdog monitorScan(HEARTBEAT)
SILL PuppetWebWatchdog autoSaveSession()
VERB PuppetWebWatchdog autoSaveSession() skiped as no this.userId
SILL PuppetWebWatchdog memoryCheck() free: 135 MB, require: 4 MB
VERB PuppetWeb init() done
VERB StateMonitor Wechaty:current(ready,true) <- (ready,false)
VERB PuppetWebWatchdog watchDogReset(120000, HEARTBEAT:[inited])
VERB PuppetWebWatchdog watchDogReset() watchdog reset after 120 seconds, last feed:[HEARTBEAT:[inited]]
events.js:160
throw er; // Unhandled 'error' event
^

Error: watchDogReset() watchdog reset after 120 seconds, last feed:[HEARTBEAT:[inited]]
at PuppetWeb.watchDogReset (/bot/node_modules/wechaty/dist/src/puppet-web/watchdog.js:92:15)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)


| __ )| | | |/ | | _ | | _ \ / _ | _ _ |
| _ | | | | | _ | |
) | | | |) | | | | |
) || |
| |
) | |
| | |
| | | _ <| |
| /| || | _ < | |
|
___/ _
/ _| || __|| ___/|| _|_|

Press ENTER to continue ...

1. source code of mybot.js

const { Wechaty } = require('wechaty')

Wechaty.instance() // Singleton
.on('scan', (url, code) => console.log(Scan QR Code to login: ${code}\n${url}))
.on('login', user => console.log(User ${user} logined))
.on('message', message => console.log(Message: ${message}))
.init()

2. directory structor of /bot

total 944
-rw-rw-r-- 1 500 500 70 Nov 20 02:35 1.js
-rw-r--r-- 1 root root 2437 Dec 7 05:06 friend-bot.ts
-rw-rw-r-- 1 500 500 289 Nov 20 01:40 mybot.js
drwxrwxr-x 226 500 500 12288 Nov 20 02:35 node_modules
-rw-rw-r-- 1 500 500 920585 Dec 5 13:35 npm-debug.log
drwxrwxr-x 2 500 500 4096 Nov 20 01:29 soft
drwxrwxr-x 9 500 500 4096 Nov 23 12:24 tmp
drwxrwxr-x 8 500 500 4096 Nov 20 01:32 wechat4u
drwxrwxr-x 8 500 500 4096 Nov 20 02:49 wechatBot

3. package.json

cat: /bot/package.json: No such file or directory
No package.json

4. directory structor inside /bot/node_modules

abbrev follow-redirects parseurl
accepts forever-agent path-is-absolute
adm-zip form-data path-to-regexp
after forwarded pause-stream
ansi-regex fresh pend
ansi-styles from phantomjs-prebuilt
array-flatten fs-extra pinkie
arraybuffer.slice fs.realpath pinkie-promise
arrify generate-function process-nextick-args
asn1 generate-object-property progress
assert getpass proto-list
assert-plus glob proxy-addr
async graceful-fs ps-tree
aws-sign2 graceful-readlink punycode
aws4 har-validator qs
axios has-ansi range-parser
babel-runtime has-binary raw-body
backo2 has-cors readable-stream
balanced-match hasha regenerator-runtime
base64-arraybuffer hawk request
base64id hoek request-progress
bcrypt-pbkdf http-errors retry-promise
benchmark http-signature rimraf
better-assert iconv-lite sax
bl indexof selenium-webdriver
blob inflight semver
body-parser inherits send
boom ini serve-static
brace-expansion ipaddr.js setprototypeof
brolog is-ci simple-cookie
bytes is-docker sntp
callsite is-my-json-valid socket.io
caseless is-property socket.io-adapter
chalk is-stream socket.io-client
chromedriver is-typedarray socket.io-parser
ci-info isarray split
combined-stream isexe sshpk
commander isstream statuses
component-bind jodid25519 stream-combiner
component-emitter jsbn stream-consume
component-inherit json-schema string_decoder
concat-map json-stringify-safe stringstream
concat-stream json3 strip-ansi
config-chain jsonfile supports-color
content-disposition jsonpointer throttleit
content-type jsprim through
cookie kew tmp
cookie-manager klaw to-array
cookie-signature lodash tough-cookie
core-js map-stream tunnel-agent
core-util-is media-typer tweetnacl
cryptiles merge-descriptors type-is
dashdash methods typedarray
debug mime uid-number
delayed-stream mime-db ultron
depd mime-types unpipe
destroy minimatch util
duplexer minimist util-deprecate
ecc-jsbn mkdirp utils-merge
ee-first ms vary
encodeurl negotiator verror
engine.io node-uuid wechat4u
engine.io-client nopt wechaty
engine.io-parser npmconf which
es6-promise oauth-sign wrappy
escape-html object-component ws
escape-string-regexp on-finished wtf-8
etag once xml2js
event-stream options xmlbuilder
express os-homedir xmlhttprequest-ssl
extend os-tmpdir xtend
extract-zip osenv yauzl
extsprintf parsejson yeast
fd-slicer parseqs
finalhandler parseuri

5. wechaty doctor

SILL Brolog WECHATY_LOG set level to silly
SILL StateMonitor constructor(Wechaty, standby)
VERB Wechaty contructor()
SILL Wechaty version() form development environment is not availble: ENOENT: no such file or directory, stat '/wechaty/dist/.git'

Wechaty Doctor

  1. Wechaty version: 0.6.46
  2. Linux x64 version 3.13.0-105-generic memory 127/993 MB
  3. Docker: true
  4. Node version: v7.2.1
@huan
Copy link
Member

huan commented Dec 9, 2016

Hi @z8313568 ,

Did you try the second time to run this? I run the program without any problem.

I guess if you do it again, it will work as you expected?

@huan
Copy link
Member

huan commented Dec 11, 2016

Please submit a new issue if it still not works for you.

@huan huan closed this as completed Dec 11, 2016
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