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

Error: execute proxyWechaty(init) error: 503, init() without a ready angular env #758

Closed
zhhigh opened this issue Aug 24, 2017 · 9 comments

Comments

@zhhigh
Copy link

zhhigh commented Aug 24, 2017

Provide Your Network Information

  1. Where is the location of your server? (i.e. City, or In/Out China)
    the wechat account in china ,the vps in japan.
  2. Which cloud platform(AliYun/Qcloud/DigitalOcean/etc) are you using?
    the linode
    uname -a
    Linux li1677-131.members.linode.com 4.9.36-x86_64-linode85 selenium-webdriver & phantomjs-prebuilt not work together under win32 #1 SMP Thu Jul 6 15:31:23 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

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

[email protected] doctor /wechaty
npm run check-node-version && ts-node bin/doctor

[email protected] check-node-version /wechaty
check-node-version --node ">= 6.9"

node: 7.10.1
npm: 4.6.1
yarn: 0.28.4

Wechaty Doctor

  1. Wechaty version: 0.8.174
  2. Linux x64 version 4.9.36-x86_64-linode85 memory 11/989 MB
  3. Docker: false
  4. Node version: v7.10.1
  5. Tcp IPC TEST: PASS
  6. Chromedriver: ChromeDriver 2.25 (5a911c1ac99b36efadff2041357740080cc27220)

Expected behavior

Actual behavior

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

Full Output Logs

$ WECHATY_LOG=silly npm run ts-node mybot.ts

# or 

$ WECHATY_LOG=silly node dist/mybot.js
Show Logs ### Paste the full output logs here with `WECHATY_LOG=silly` set
# PASTE FULL LOG OUTPUT AT HERE:
06:12:50 SILL Brolog WECHATY_LOG set level to silly
06:12:50 INFO Config registering process.on("unhandledRejection") for development/debug
06:12:52 SILL StateSwitch constructor(Wechaty, standby)
06:12:52 VERB Wechaty contructor()
bound listener: scan
06:12:52 VERB Wechaty addListener(scan, function)
listener logout is not defined.
06:12:53 VERB Wechaty addListener(logout, function)
bound listener: login
06:12:54 VERB Wechaty addListener(login, function)
bound listener: friend
06:12:55 VERB Wechaty addListener(friend, function)
bound listener: room-join
06:12:55 VERB Wechaty addListener(room-join, function)
listener room-leave is not defined.
06:12:55 VERB Wechaty addListener(room-leave, function)
bound listener: room-topic
06:12:56 VERB Wechaty addListener(room-topic, function)
listener message is not defined.
06:12:56 VERB Wechaty addListener(message, function)
listener heartbeat is not defined.
06:12:56 VERB Wechaty addListener(heartbeat, function)
listener error is not defined.
06:12:57 VERB Wechaty addListener(error, function)
06:12:57 SILL Wechaty version() form development environment is not availble: ENOENT: no such file or directory, stat '/wechaty/dist/.git'
06:12:57 INFO Wechaty v0.8.174 initializing...
06:12:57 VERB Wechaty puppet: web
06:12:57 VERB Wechaty head: chrome
06:12:57 VERB Wechaty profile: null
06:12:57 VERB Wechaty uuid: 90c55b04-875e-4a21-a6b3-d97a8fb9bd21
06:12:57 SILL StateSwitch Wechaty:current() is standby
06:12:57 VERB StateSwitch Wechaty:target(ready) <- (standby)
06:12:57 VERB StateSwitch Wechaty:current(ready,false) <- (standby,true)
06:12:57 SILL StateSwitch constructor(Puppet, dead)
06:12:57 VERB Config puppetInstance(PuppetWeb)
06:12:57 VERB PuppetWeb init() with head:chrome, profile:null
06:12:57 VERB StateSwitch Puppet:target(live) <- (dead)
06:12:57 VERB StateSwitch Puppet:current(live,false) <- (dead,true)
06:12:57 SILL UtilLib getPort(18788)
06:12:57 SILL UtilLib getPort(18788) return: 18946
06:12:57 VERB PuppetWeb init() getPort 18946
06:12:57 VERB PuppetWeb initServer()
06:12:57 SILL StateSwitch Puppet:target() is live
06:12:57 VERB PuppetWebServer init() on port 18946
06:12:57 VERB PuppetWebServer createHttpsServer() listen on port 18946
06:12:57 VERB PuppetWeb initServer() done
06:12:57 VERB PuppetWeb initBrowser()
06:12:57 SILL StateSwitch constructor(Browser, close)
06:12:57 VERB PuppetWebBrowser constructor() with head(chrome) sessionFile(null)
06:12:57 VERB PuppetWebBrowserDriver constructor(chrome)
06:12:57 VERB PuppetWebBrowserCookie constructor(BrowserDriver, )
06:12:57 SILL StateSwitch Puppet:target() is live
06:12:57 VERB PuppetWebBrowser init()
06:12:57 SILL StateSwitch Browser:current() is close
06:12:57 VERB StateSwitch Browser:target(open) <- (close)
06:12:57 VERB StateSwitch Browser:current(open,false) <- (close,true)
06:12:57 VERB PuppetWebBrowserCookie hostname()
06:12:57 VERB PuppetWebBrowserCookie getCookiesFromFile() from "undefined"
06:12:57 SILL PuppetWebBrowserCookie getCookiesFromFile() no cookies: no store file
06:12:57 SILL PuppetWebBrowserCookie hostname() no cookie, return default hostname
06:12:57 VERB PuppetWebBrowserDriver init() for head: chrome
06:12:57 VERB PuppetWebBrowserDriver getChromeDriver()
06:12:57 ERR PuppetWebBrowser init() exception: Cannot find module 'chromedriver'
06:12:57 VERB PuppetWebBrowser quit()
06:12:57 SILL StateSwitch Browser:current() is open
06:12:57 VERB StateSwitch Browser:target(close) <- (open)
06:12:57 VERB StateSwitch Browser:current(close,false) <- (open,false)
06:12:57 WARN PuppetWebBrowser quit() exception: Cannot read property 'close' of undefined
06:12:57 WARN PuppetWebBrowser driver.quit() exception: Cannot read property 'close' of undefined
06:12:57 VERB StateSwitch Browser:current(close,true) <- (close,false)
06:12:57 ERR PuppetWeb initBrowser() exception: Cannot find module 'chromedriver'
06:12:57 ERR PuppetWeb init() exception: Error: Cannot find module 'chromedriver'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at BrowserDriver.<anonymous> (/wechaty/src/puppet-web/browser-driver.ts:145:7)
    at Generator.next (<anonymous>)
    at /wechaty/dist/src/puppet-web/browser-driver.js:7:71
    at __awaiter (/wechaty/dist/src/puppet-web/browser-driver.js:3:12)
    at BrowserDriver.getChromeDriver (/wechaty/dist/src/puppet-web/browser-driver.js:83:16)
    at BrowserDriver.<anonymous> (/wechaty/src/puppet-web/browser-driver.ts:78:34)
    at Generator.next (<anonymous>)
    at /wechaty/dist/src/puppet-web/browser-driver.js:7:71
    at __awaiter (/wechaty/dist/src/puppet-web/browser-driver.js:3:12)
    at BrowserDriver.init (/wechaty/dist/src/puppet-web/browser-driver.js:52:16)
    at Browser.<anonymous> (/wechaty/src/puppet-web/browser.ts:94:25)
    at Generator.next (<anonymous>)
    at /wechaty/dist/src/puppet-web/browser.js:7:71
    at __awaiter (/wechaty/dist/src/puppet-web/browser.js:3:12)
    at Browser.init (/wechaty/dist/src/puppet-web/browser.js:51:16)
    at PuppetWeb.<anonymous> (/wechaty/src/puppet-web/puppet-web.ts:233:26)
    at Generator.next (<anonymous>)
    at /wechaty/dist/src/puppet-web/puppet-web.js:7:71
    at __awaiter (/wechaty/dist/src/puppet-web/puppet-web.js:3:12)
    at PuppetWeb.initBrowser (/wechaty/dist/src/puppet-web/puppet-web.js:159:16)
    at PuppetWeb.<anonymous> (/wechaty/src/puppet-web/puppet-web.ts:104:18)
    at Generator.next (<anonymous>)
    at fulfilled (/wechaty/dist/src/puppet-web/puppet-web.js:4:58)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)
    at Function.Module.runMain (module.js:607:11)
    at Object.<anonymous> (/wechaty/node_modules/ts-node/src/_bin.ts:182:12)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3
06:12:57 SILL StateSwitch Puppet:target() is live
06:12:57 SILL StateSwitch Puppet:current() is live
06:12:57 SILL StateSwitch Puppet:stable() is false
06:12:57 VERB PuppetWeb quit() state target(live) current(live) stable(false)
06:12:57 SILL StateSwitch Puppet:current() is live
06:12:57 VERB PuppetWeb quit() kill watchdog before do quit
06:12:57 SILL PuppetWebWatchdog onFeed: 60000, POISON[PuppetWeb.quit()]
06:12:57 VERB PuppetWebWatchdog onFeed(type=POSISON) WANG! I dead!
06:12:57 VERB PuppetWebWatchdog clearWatchDogTimer() nothing to clear
06:12:57 VERB StateSwitch Puppet:target(dead) <- (live)
06:12:57 VERB StateSwitch Puppet:current(dead,false) <- (live,false)
06:12:57 ERR Config ###########################
06:12:57 ERR Config unhandledRejection: TypeError: Cannot read property 'quit' of undefined [object Promise]
06:12:57 ERR Config ###########################
06:12:57 ERR Config unhandledRejection::catch(Cannot read property 'quit' of undefined)
Config TypeError: Cannot read property 'quit' of undefined
    at PuppetWeb.<anonymous> (/wechaty/src/puppet-web/puppet-web.ts:176:26)
    at Generator.next (<anonymous>)
    at /wechaty/dist/src/puppet-web/puppet-web.js:7:71
    at __awaiter (/wechaty/dist/src/puppet-web/puppet-web.js:3:12)
    at Promise (/wechaty/src/puppet-web/puppet-web.ts:169:47)
    at PuppetWeb.<anonymous> (/wechaty/src/puppet-web/puppet-web.ts:169:13)
    at Generator.next (<anonymous>)
    at /wechaty/dist/src/puppet-web/puppet-web.js:7:71
    at __awaiter (/wechaty/dist/src/puppet-web/puppet-web.js:3:12)
    at PuppetWeb.quit (/wechaty/dist/src/puppet-web/puppet-web.js:92:16)
    at PuppetWeb.<anonymous> (/wechaty/src/puppet-web/puppet-web.ts:128:18)
    at Generator.throw (<anonymous>)
    at rejected (/wechaty/dist/src/puppet-web/puppet-web.js:5:65)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)
    at Function.Module.runMain (module.js:607:11)
    at Object.<anonymous> (/wechaty/node_modules/ts-node/src/_bin.ts:182:12)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3
(node:2178) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 4)
06:14:57 WARN PuppetWeb quit() Promise() timeout
06:14:57 ERR PuppetWeb quit() exception: quit() Promise() timeout
06:14:57 VERB StateSwitch Puppet:current(dead,true) <- (dead,false)
06:14:57 ERR Wechaty init() exception: quit() Promise() timeout
06:14:57 ERR Config ###########################
06:14:57 ERR Config unhandledRejection: Error: quit() Promise() timeout [object Promise]
06:14:57 ERR Config ###########################
06:14:57 ERR Config unhandledRejection::catch(quit() Promise() timeout)
Config Error: quit() Promise() timeout
    at Timeout.setTimeout (/wechaty/src/puppet-web/puppet-web.ts:171:21)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
(node:2178) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 5)

@huan
Copy link
Member

huan commented Aug 24, 2017

06:12:57 ERR PuppetWebBrowser init() exception: Cannot find module 'chromedriver'

According to your log, you did not install the chromedriver right.

Try to run

rm -fr node_modules
npm install

And I suggest you switch to Docker if you could.

@huan huan changed the title ERR PuppetWebEvent onServerDisconnect() setTimeout() bridge.init() exception: [Error: execute proxyWechaty(init) error: 503, init() without a ready angular env Cannot find module 'chromedriver' Aug 24, 2017
@zhhigh
Copy link
Author

zhhigh commented Aug 25, 2017

1、my env is docker and the images version is the lastest
2、above log get from the docker
3、my step:
docker exec -it test bash(my docker --name is test)
npm run doctor
WECHATY_LOG=silly npm run ts-node/bot/main.ts
then ,this shell occoured errors :Error: watch ./src/listener ENOENT
i change the PATH and NODE_PATH
run WECHATY_LOG=silly npm run ts-node/bot/main.ts once more
then,output :ERR PuppetWeb init() exception: Error: Cannot find module 'chromedriver'
4、may be some env had problem , i try to analyze it again

@huan
Copy link
Member

huan commented Aug 25, 2017

If you want to run Wechaty by docker, you should NOT do this:

docker exec -it test bash

What you should do is to follow the Wiki: https://github.com/Chatie/wechaty/wiki/Docker

And here's a good get started tutorial: https://github.com/Chatie/wechaty/wiki/GettingStarted

@zhhigh
Copy link
Author

zhhigh commented Aug 25, 2017

uname -a
Linux VM_75_219_centos 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

execute shell,the console output,no such session , error: 503  

[root@VM_75_219_centos aiv4]#docker run -t -i -e WECHATY_LOG="$WECHATY_LOG" --rm --volume="$(pwd)":/bot --name test zixia/wechaty:latest main.ts
 __        __        _           _          
 \ \      / /__  ___| |__   __ _| |_ _   _  
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | 
   \ V  V /  __/ (__| | | | (_| | |_| |_| | 
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | 
                                     |___/  
____________________________________________________
            https://www.chatie.io
  ____                            _   _             
 / ___|___  _ __  _ __   ___  ___| |_(_)_ __   __ _ 
| |   / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | |  __/ (__| |_| | | | | (_| |
 \____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
                                              |___/ 
  ____ _           _   ____        _       
 / ___| |__   __ _| |_| __ )  ___ | |_ ___ 
| |   | '_ \ / _` | __|  _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
 \____|_| |_|\__,_|\__|____/ \___/ \__|___/
                                           
Starting Wechaty v0.8.174 with Node.js v7.10.1 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended by your bot script.
Executing ts-node main.ts
bound listener: scan
listener logout is not defined.
bound listener: login
bound listener: friend
bound listener: room-join
listener room-leave is not defined.
bound listener: room-topic
listener message is not defined.
listener heartbeat is not defined.
listener error is not defined.
07:40:34 INFO Wechaty v0.8.174 initializing...
07:40:42 WARN PuppetWebBrowserDriver validDriverSession() driver.getSession() timeout(halt?)
07:40:42 WARN PuppetWebBrowserDriver validDriverSession() driver.getSession() exception: validDriverSession() driver.getSession() timeout(halt?)
07:40:42 WARN PuppetWebBrowserDriver getChromeDriver() got invalid driver at ttl 2
07:40:49 WARN PuppetWebBrowserDriver validDriverSession() driver.getSession() timeout(halt?)
07:40:49 WARN PuppetWebBrowserDriver validDriverSession() driver.getSession() exception: validDriverSession() driver.getSession() timeout(halt?)
07:40:49 WARN PuppetWebBrowserDriver getChromeDriver() got invalid driver at ttl 1
07:40:51 WARN PuppetWebBrowserDriver getChromeDriver() driver.{close,quit}() exception: no such session
  (Driver info: chromedriver=2.25 (5a911c1ac99b36efadff2041357740080cc27220),platform=Linux 3.10.0-327.36.3.el7.x86_64 x86_64)
07:40:58 WARN PuppetWebWatchdog onFeed(type=SCAN, data=[object Object], timeout=60000) is disabled because state target:`live` inprocess:`true`
https://login.weixin.qq.com/qrcode/wZUtDsw2gA==
07:40:58 WARN PuppetWebWatchdog onFeed(type=HEARTBEAT, data=heartbeat@browser, timeout=60000) is disabled because state target:`live` inprocess:`true`
https://login.weixin.qq.com/qrcode/wZUtDsw2gA==
 
https://login.weixin.qq.com/qrcode/wZUtDsw2gA==
07:41:32 ERR PuppetWebEvent onServerDisconnect() setTimeout() bridge.init() exception: [Error: execute proxyWechaty(init) error: 503, init() without a ready angular env]

@huan
Copy link
Member

huan commented Aug 25, 2017

Thanks for providing the details log output.

Could you also provide the following information? Because it will help me to reproduce & diagnose the issue:

  1. run WECHATY_LOG=silly docker run -t -i -e WECHATY_LOG="$WECHATY_LOG" --rm --volume="$(pwd)":/bot --name test zixia/wechaty:latest main.ts for output all the logs in silly mode.
  2. could you provide the minimum main.ts source code for me, which could reproduce your problem?

@zhhigh
Copy link
Author

zhhigh commented Aug 25, 2017

1、this code clone from haoshiyoubot,the link is : https://github.com/zhhigh/wechaty-test.git
2、after scan qrcode,output :error:503
3、is my accout disabled by tencent?

[root@VM_75_219_centos aiv4]# WECHATY_LOG=silly docker run -t -i -e WECHATY_LOG="$WECHATY_LOG" --rm --volume="$(pwd)":/bot --name test zixia/wechaty:latest main.ts

 __        __        _           _          
 \ \      / /__  ___| |__   __ _| |_ _   _  
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | 
   \ V  V /  __/ (__| | | | (_| | |_| |_| | 
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | 
                                     |___/  
____________________________________________________
            https://www.chatie.io
  ____                            _   _             
 / ___|___  _ __  _ __   ___  ___| |_(_)_ __   __ _ 
| |   / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | |  __/ (__| |_| | | | | (_| |
 \____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
                                              |___/ 
  ____ _           _   ____        _       
 / ___| |__   __ _| |_| __ )  ___ | |_ ___ 
| |   | '_ \ / _` | __|  _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
 \____|_| |_|\__,_|\__|____/ \___/ \__|___/
                                           

Starting Wechaty v0.8.174 with Node.js v7.10.1 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended by your bot script.
Executing ts-node main.ts
bound listener: scan
listener logout is not defined.
bound listener: login
bound listener: friend
bound listener: room-join
listener room-leave is not defined.
bound listener: room-topic
listener message is not defined.
listener heartbeat is not defined.
listener error is not defined.
10:59:36 INFO Wechaty v0.8.174 initializing...
10:59:43 WARN PuppetWebBrowserDriver validDriverSession() driver.getSession() timeout(halt?)
10:59:43 WARN PuppetWebBrowserDriver validDriverSession() driver.getSession() exception: validDriverSession() driver.getSession() timeout(halt?)
10:59:43 WARN PuppetWebBrowserDriver getChromeDriver() got invalid driver at ttl 2
10:59:49 WARN BrowserDriver validDriverExecute() fail: no such session
  (Driver info: chromedriver=2.25 (5a911c1ac99b36efadff2041357740080cc27220),platform=Linux 3.10.0-327.36.3.el7.x86_64 x86_64)
10:59:49 WARN PuppetWebBrowserDriver getChromeDriver() got invalid driver at ttl 1
10:59:49 WARN PuppetWebBrowserDriver getChromeDriver() driver.{close,quit}() exception: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
  https://login.weixin.qq.com/qrcode/wYABDBqsGQ==
11:00:26 ERR PuppetWebEvent onServerDisconnect() setTimeout() bridge.init() exception: [Error: execute proxyWechaty(init) error: 503, init() without a ready angular env]

@huan huan changed the title Cannot find module 'chromedriver' Error: execute proxyWechaty(init) error: 503, init() without a ready angular env Aug 25, 2017
@huan
Copy link
Member

huan commented Aug 25, 2017

I believe it's duplicated with #603 because I just tested docker image v0.8.174 without any problem:

https://login.weixin.qq.com/qrcode/4bJq2OxaOw==
[408] Scan QR Code in above url to login: 
https://login.weixin.qq.com/qrcode/4bJq2OxaOw==
[201] Scan QR Code in above url to login: 
https://login.weixin.qq.com/qrcode/4bJq2OxaOw==
[200] Scan QR Code in above url to login: 
14:59:07 INFO Bot 李卓桓 logined
<李卓桓>:{TEXT}Wechaty login
^CWechaty exit 130 because of SIGINT 
 Script terminated by Control-C 

Please open a web browser and try to login wechat to see if you are blocked by Tencent.

@huan huan added the duplicate label Aug 25, 2017
@zhhigh
Copy link
Author

zhhigh commented Aug 25, 2017

thanks,please close the issue!

@huan
Copy link
Member

huan commented Aug 25, 2017

you are welcome!

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

No branches or pull requests

2 participants