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

[ci] execute proxyWechaty(init) error: 503, init() without a ready angular env #329

Closed
huan opened this issue Mar 15, 2017 · 16 comments
Closed

Comments

@huan
Copy link
Member

huan commented Mar 15, 2017

test › puppet-web › bridge › WechatyBro.ding() exception: execute proxyWechaty(init) error: 503, init() without a ready angular env
  1. https://travis-ci.org/Chatie/wechaty/jobs/211306521#L811
  2. https://travis-ci.org/Chatie/wechaty/jobs/211306523#L811
  3. https://travis-ci.org/Chatie/wechaty/jobs/211306375#L808
  4. https://travis-ci.org/Chatie/wechaty/jobs/211252499#L811
  5. https://travis-ci.org/Chatie/wechaty/jobs/212333837#L845

Potential Possible Solutions:

  1. use initAsync to replace init in WechatyBro, and retry 3 times, wait 300ms each time.
@huan huan added the bug label Mar 15, 2017
@huan huan changed the title [ci log] WechatyBro.ding() exception: execute proxyWechaty(init) error: 503, init() without a ready angular env [ci log] execute proxyWechaty(init) error: 503, init() without a ready angular env Mar 15, 2017
@JasLin
Copy link
Contributor

JasLin commented Mar 28, 2017

@zixia bro , i had exprience this problem too , it seems docker's network is unstable.
after this error raise , i login to container docker exec -it robot_test bash

ping wx.qq.com , it's ok

bash-4.3# ping wx.qq.com
PING wx.qq.com (101.227.160.102): 56 data bytes
64 bytes from 101.227.160.102: seq=0 ttl=37 time=0.342 ms
64 bytes from 101.227.160.102: seq=1 ttl=37 time=0.386 ms
64 bytes from 101.227.160.102: seq=2 ttl=37 time=0.370 ms
64 bytes from 101.227.160.102: seq=3 ttl=37 time=0.292 ms

ping qq.com , it's bad address

bash-4.3# ping qq.com
ping: bad address 'qq.com'

ping baidu.com , it's bad address also.

then, i cat /etc/resolv.conf

bash-4.3# cat /etc/resolv.conf
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
nameserver 192.168.65.1
# /etc/resolv.conf.tail can replace this line
nameserver 114.114.114.114
nameserver 114.114.115.115

even more, i sepecify dns on docker run container with --dns=114.114.114.114 , and cat the resolv.conf

bash-4.3# cat /etc/resolv.conf
nameserver 114.114.114.114
nameserver 114.114.114.114
nameserver 114.114.115.115

the problem still the same as above.(qq.com and baidu.com is bad address)
even the wx.qq.com is bad too

@JasLin
Copy link
Contributor

JasLin commented Mar 28, 2017

route table

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.17.0.1      0.0.0.0         UG    0      0        0 eth0
172.17.0.0      *               255.255.0.0     U     0      0        0 eth0

can ping telcom dns

bash-4.3# ping 114.114.114.114
PING 114.114.114.114 (114.114.114.114): 56 data bytes
64 bytes from 114.114.114.114: seq=0 ttl=37 time=0.313 ms
64 bytes from 114.114.114.114: seq=1 ttl=37 time=0.431 ms
64 bytes from 114.114.114.114: seq=2 ttl=37 time=0.477 ms

lookup wx.qq.com at telcom dns

bash-4.3# nslookup wx.qq.com 114.114.114.114
Server:    114.114.114.114
Address 1: 114.114.114.114

nslookup: can't resolve 'wx.qq.com': Try again
bash-4.3# telnet 114.114.114.114 53

53 port is blocked from docker. but it can reach the port 53 at docker host (a mac os)

so i guess container's port 53 is block sometimes. 

and then i restart docker , everything it ok now.

@huan
Copy link
Member Author

huan commented Mar 28, 2017

Thanks bro, that's very useful information about this problem.

It looks like the bug is related with docker? Travis CI almost never pass now, but circle CI works without any problem with the same code base.

@JasLin
Copy link
Contributor

JasLin commented Mar 28, 2017 via email

@huan huan changed the title [ci log] execute proxyWechaty(init) error: 503, init() without a ready angular env [test] execute proxyWechaty(init) error: 503, init() without a ready angular env May 6, 2017
@huan huan changed the title [test] execute proxyWechaty(init) error: 503, init() without a ready angular env [ci] execute proxyWechaty(init) error: 503, init() without a ready angular env May 12, 2017
@xinbenlv
Copy link
Contributor

xinbenlv commented Jun 1, 2017

Getting same issue on local bot. Restarting docker or computer doesn't help

@huan
Copy link
Member Author

huan commented Jun 1, 2017

@xinbenlv When this issue happens, it means that the Angular.js is not ready inside the Browser.

Wechaty will open a browser when it starts, then inject a JavaScript Closure into the Browser, and the Closure is in charge of doing the Hook Jobs.

After the injection, the Closure will check for the Angular.js environment. If it does not exist, then this Error will be thrown.

@xinbenlv
Copy link
Contributor

xinbenlv commented Jun 2, 2017 via email

@huan
Copy link
Member Author

huan commented Jun 2, 2017

To fix it, we must make sure the Angular.js is loaded as expected.

e.g. this issue will happen when:

  1. DNS could not resolve(as @JasLin replied before)
  2. Network not reachable
  3. Timeout(?)

If the error is permanent, then the problem must be solved before fix this issue.
If the error is temporary, then a REFRESH action on the browser might help.

@d2cs
Copy link

d2cs commented Jun 8, 2017

once i had this problem it fixed itself after wechaty updated
was using npm wechaty tho not docker, so may not be related to docker but the whole thing

@xinbenlv
Copy link
Contributor

Without changing anything, the error no longer exist

@xinbenlv
Copy link
Contributor

feel free to close this issue

@huan
Copy link
Member Author

huan commented Jun 13, 2017

@xinbenlv Glad to hear that.

This issue will continue monitoring the problem because it can not reproduce but always appear here or there.

@romejiang
Copy link

I should be observed and linux operating system or kernel version. I can run the ubuntu system, but can not run under centos7.2.

ubuntu

root@gitlab:~/nodejs/wechaty/example# npm run doctor

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


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

node: 7.10.0
npm: 4.2.0
yarn: 0.24.5

  #### Wechaty Doctor

  1. Wechaty version: #git[c92f1b8]
  2. Linux x64 version 4.4.0-79-generic memory 200/7983 MB
  3. Docker: false
  4. Node version: v7.10.0
  5. Tcp IPC TEST: PASS
  6. Chromedriver: ChromeDriver 2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5)

root@gitlab:~/nodejs/wechaty/example# cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

centos

[root@server1 wechaty]# npm run doctor

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


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

node: 7.10.0
npm: 4.2.0
yarn: 0.24.5

  #### Wechaty Doctor

  1. Wechaty version: #git[c92f1b8]
  2. Linux x64 version 3.10.0-514.16.1.el7.x86_64 memory 1999/7772 MB
  3. Docker: false
  4. Node version: v7.10.0
  5. Tcp IPC TEST: PASS
  6. Chromedriver: ChromeDriver 2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5)


[root@server1 wechaty]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@server1 wechaty]#

@xinbenlv
Copy link
Contributor

I end up creating a new account to be used as bot, but I presume after waiting for a few days this problem should resolve itself for the old blocked account

huan added a commit that referenced this issue Oct 8, 2017
@huan
Copy link
Member Author

huan commented Oct 8, 2017

This issue should be fixed at v0.10 or above.

@huan huan closed this as completed Oct 8, 2017
@Raciel-c
Copy link

Raciel-c commented Apr 5, 2023

不行啊,docker运行还是会报这个错

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

6 participants