Open suntong opened 3 years ago
Took a look at the grpc/src/client_interceptors.js
around onReceiveStatus
's callback:
InterceptingListener.prototype.onReceiveStatus = function(status) {
this._callNext('onReceiveStatus', [status]);
};
. . .
response.metadata =
Metadata._fromCoreRepresentation(response.metadata);
first_listener.onReceiveMetadata(response.metadata);
first_listener.onReceiveMessage(deserialized);
first_listener.onReceiveStatus(status);
and have no idea where the problem is.
More details, I've been using
export WECHATY_PUPPET_HOSTIE_ENDPOINT=114.215.83.32:7777
as instructed, but am getting:
{ Error: 16 UNAUTHENTICATED: {code:8,message:"A token(114.215.83.32:7777) must be prefixed with a 'puppet_rock_' "}
So I changed it to
export WECHATY_PUPPET_HOSTIE_ENDPOINT=puppet_rock_114.215.83.32:7777
I.e., I'm suspecting that the DNS resolution failed
might have something to do with HOSTIE_ENDPOINT=puppet_rock_114.215.83.32:7777
The latest version doesn't need WECHATY_PUPPET_HOSTIE_ENDPOINT variable.
which version it is? Mine is wechaty-puppet-hostie@0.11.10
and npm outdated
is not listing wechaty-puppet-hostie, yet, this is what I'm getting if not setting WECHATY_PUPPET_HOSTIE_ENDPOINT variable:
$ node ding-dong-bot.js
14:03:27 ERR PuppetHostie start() rejection: no endpoint
Error: no endpoint
at PuppetHostie.<anonymous> (/.../node_modules/wechaty-puppet-hostie/dist/src/client/puppet-hostie.js:69:31)
OK. I redid the installation from scratch.
rm -rf package*.json node_modules/
npm init -y
npm install wechaty@next
and now I have a super clean package.json
file:
$ jq .dependencies package.json
{
"wechaty": "^0.51.8"
}
and concise installed packages:
└─┬ wechaty@0.51.8
├─┬ wechaty-puppet@0.33.6
│ ├─┬ file-box@0.16.4
├─┬ wechaty-puppet-hostie@0.11.10
Indeed WECHATY_PUPPET_HOSTIE_ENDPOINT
is no longer necessary, but I'm still getting the above reported error:
unset WECHATY_PUPPET_HOSTIE_ENDPOINT
$ node ding-dong-bot.js
23:24:46 ERR PuppetHostie start() rejection: 16 UNAUTHENTICATED: {code:8,message:"A token(114.215.83.32:7777) must be prefixed with a 'puppet_rock_' "}
{ Error: 16 UNAUTHENTICATED: {code:8,message:"A token(114.215.83.32:7777) must be prefixed with a 'puppet_rock_' "}
at Object.exports.createStatusError (/.../node_modules/grpc/src/common.js:91:15)
. . .
{ Error: 16 UNAUTHENTICATED: {code:8,message:"A token(114.215.83.32:7777) must be prefixed with a 'puppetrock' "}
The above log message is telling you that your token format is not right.
You need to add the prefix puppet_rock_
to your token and try again.
The above log message is telling you that your token format is not right.
Note that it complains about the token 114.215.83.32:7777
, which is the IP of the WECHATY_PUPPET_HOSTIE_ENDPOINT
, which is I don't need to set any more.
You need to add the prefix
puppet_rock_
to your token and try again.
I've tried both, with and without prefix puppet_rock_
to my token, and the result is exactly the same, which makes me believe that it is the WECHATY_PUPPET_HOSTIE_ENDPOINT
's internal problem.
@huan / @jcai, if it is working in your environment, please at least let me know what versions of your packages, and what exactly environment variables you have set to make it working. Thx.
@suntong can you get the IP and port information from the https://api.chatie.io/v0/hosties/YOUR_TOKEN ?
And I agree that the below error message is confusing:
A token(114.215.83.32:7777) must be prefixed with a 'puppetrock'
Ip should not be prefixed, I guess it should be the token that user provided? @jcai
请问这个问题解决了吗?怎么解决的?
If I've solved it, I'd have closed it.
Please report what you're experiencing @King-Red, things might be quite different two years later.
Question
How to properly run
wechaty-puppet-rock
?0. Report Issue Guide
Please run the following command and check whether the problem has been fixed:
Done.
Please search in FAQ List first, and make sure your problem has not been solved before.
Done.
Please search in the issue first, and make sure your problem had not been reported before
Done.
1. Versions
What is your wechaty version? What is your wechaty-puppet-hostie version?
To be specifically,
What is your node version? (run
node --version
) Answer:v10.21.0
What os are you using
2. Describe the bug
3. To Reproduce
Steps to reproduce the behavior:
4. Expected behavior
It works.
6. Full Output Logs
Set env
WECHATY_LOG=silly
in order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)We need full log instead of log screenshot or log fragments!
Show full Logs
```shell $ WECHATY_LOG=silly node ding-dong-bot.js 12:15:53 SILL Puppet Config: WECHATY_LOG set level to silly 12:15:53 INFO Config registering process.on("unhandledRejection") for development/debug 12:15:53 VERB Config constructor() 12:15:53 VERB Wechaty constructor() 12:15:53 VERB StateSwitch constructor(Wechaty, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}") 12:15:53 VERB StateSwitch constructor(WechatyReady, "{"log":{"enableTimestamp":true,"logLevel":5,"prefixFilter":{}}}") 12:15:53 VERB Wechaty on(scan, listener) registered 12:15:53 VERB Wechaty on(login, listener) registered 12:15:53 VERB Wechaty on(logout, listener) registered 12:15:53 VERB Wechaty on(message, listener) registered 12:15:53 VERB Wechaty7. Additional context
No any other context about the problem here.
[bug]