Open suntong opened 3 years ago
A tip: The Wechaty has already depemdencied the wechaty-puppet and wechaty-puppet-hostie internally so they can be safely removed from your package.json.
Good to know. thx.
I tried again today, from scratch and got the exact same error as above:
rm -rf node_modules/
npm install wechaty@next
$ npm ls | grep -E 'wechaty|file-box'
wechaty-getting-started@0.1.20 /sysvol/gt/nodejs/step1/wechaty-examples
+-- file-box@0.14.3
+-- wechaty@0.51.5
| +-- wechaty-puppet@0.33.6
| | +-- file-box@0.16.4
| +-- wechaty-puppet-hostie@0.11.10
+-- UNMET PEER DEPENDENCY wechaty-puppet@0.32.3
| +-- file-box@0.13.5
+-- wechaty-puppet-hostie@0.10.8
+-- wechaty-puppet-mock@0.28.1
`-- wechaty-puppet-puppeteer@0.22.1
node ding-dong-bot.js
19:42:49 INFO Wechaty <wechaty-puppet-hostie>(ding-dong-bot) start() v0.38.4 is starting...
19:42:49 ERR PuppetHostie start() rejection: 14 UNAVAILABLE: failed to connect to all addresses
{ Error: 14 UNAVAILABLE: failed to connect to all addresses
. . .
checked with my own machine and just realized that they are the same version. So looking closely at the log again,
23:31:53 VERB PuppetHostie startGrpcClient()
23:31:53 VERB PuppetHostie discoverHostieIp(puppet_donut_37...6d)
23:31:53 VERB PuppetHostie discoverHostieIp() 161.189.225.62
23:31:53 VERB PuppetHostie startGrpcStream()
23:31:53 ERR PuppetHostie start() rejection: 14 UNAVAILABLE: failed to connect to all addresses
It fails right after trying to make Grpc Stream connection to HostieIp 161.189.225.62. What kind of connection is that? -- The only difference between my machine and my server is that my Azure server might be blocking some ports by default. So,
Is there any ports that I need to open before using wechaty-puppet-hostie?
rm -rf node_modules/
This is not enough. You need to remove the dependencies from your package.json.
What kind of connection is that?
As you said, that's a gRPC connection
Is there any ports that I need to open before using wechaty-puppet-hostie?
Of course! I'd like to suggest that you open all ports to have a test. If it works after open all ports (disable the network firewall), then means they are related.
The Azure server's port need to be opened one by one, one port per command.
The Azure server's port need to be opened one by one, one port per command.
No, it is not port's problem -- Found it is port# 14363 that 161.189.225.62 is using from my own machine. and connecting to it is not blocked on my server.
from my own machine
$ netstat -natup | grep 161.189.225.62
tcp 0 0 192.168.0.101:47728 161.189.225.62:14363 ESTABLISHED 3879501/node
on my server
$ telnet -4 161.189.225.62 14363
Trying 161.189.225.62...
Connected to 161.189.225.62.
Escape character is '^]'.
@@ ?
$ nc -w3 -4 -v 161.189.225.62 14363
Connection to 161.189.225.62 14363 port [tcp/*] succeeded!
@@ ?
Yes, if you only need an outgoing connection, the firewall will permit.
BTW: you can use the Azure web portal to open all the ports by one rule, as the following screenshot demonstrated: set the port to Any
you can use the Azure web portal to open all the ports by one rule
Oh, thx, will try...
This is not enough. You need to remove the dependencies from your package.json.
Oh, then seems that https://github.com/wechaty/wechaty-getting-started/blob/master/package.json is outdated as well. Can you change to what should be look like so that we can follow suite please?
I always get
ERR PuppetHostie start() rejection: 14 UNAVAILABLE: failed to connect to all addresses
on my server, yet on my own machine, same-everything works just fine.More Info/Details
``` $ WECHATY_LOG=silly node ding-dong-bot.js 23:31:52 SILL Config WECHATY_LOG set level to silly 23:31:52 INFO Config registering process.on("unhandledRejection") for development/debug 23:31:52 VERB Config constructor() 23:31:53 VERB Wechaty contructor() 23:31:53 VERB StateSwitch constructor(Wechaty, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}") 23:31:53 VERB StateSwitch constructor(WechatyReady, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}") 23:31:53 VERB Wechaty on(scan, function) registered 23:31:53 VERB Wechaty addListenerFunction(scan) 23:31:53 VERB Wechaty on(login, function) registered 23:31:53 VERB Wechaty addListenerFunction(login) 23:31:53 VERB Wechaty on(logout, function) registered 23:31:53 VERB Wechaty addListenerFunction(logout) 23:31:53 VERB Wechaty on(message, function) registered 23:31:53 VERB Wechaty addListenerFunction(message) 23:31:53 INFO Wechatyding-dong-bot.js
is just the standard example from wechaty-getting-started.Please double-check. Thanks.
Oh, not same everything. I did installation/upgrade later on my server than on my own machine, but within two days. why the versions are so different:
on my server: