Closed yswtrue closed 3 years ago
matrix-appservice-wechaty | 19:29:12 ERR PuppetService start() rejection: 16 UNAUTHENTICATED: {code:8,message:"A token(puppet34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet' "}
The above error message looks wired.
Cloud you please tell me that where did you get this token puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f
?
I followed this one. https://github.com/wechaty/wechaty/discussions/1986
It seems you should not get this error message. I'll try this tomorrow.
Could you please try your token with a Wechaty bot to see if it can work without the matrix?
Same error when use get started example.
I ran the below commands.
export WECHATY_PUPPET_SERVICE_TOKEN=puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f
export WECHATY_PUPPET=wechaty-puppet-service
export WECHATY_PUPPET_SERVICE_ENDPOINT=114.215.83.32:7777
export WECHATY_PUPPET=wechaty-puppet-service
./bin/docker-run-javascript-es6.sh
and get these outputs.
+ set -e
+ BOT=src/javascript-es6.js
++ dirname bin/docker-run.sh
+ source bin/docker-config.sh
++ WECHATY_IMAGE=wechaty/wechaty
+++ env
+++ grep WECHATY_
++ docker::env WECHATY_PUPPET_SERVICE_ENDPOINT=114.215.83.32:7777 WECHATY_PUPPET=wechaty-puppet-service WECHATY_PUPPET_SERVICE_TOKEN=puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f
++ for var in '"$@"'
++ echo -n ' -e WECHATY_PUPPET_SERVICE_ENDPOINT=114.215.83.32:7777'
++ for var in '"$@"'
++ echo -n ' -e WECHATY_PUPPET=wechaty-puppet-service'
++ for var in '"$@"'
++ echo -n ' -e WECHATY_PUPPET_SERVICE_TOKEN=puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f'
+ DOCKER_ENV=' -e WECHATY_PUPPET_SERVICE_ENDPOINT=114.215.83.32:7777 -e WECHATY_PUPPET=wechaty-puppet-service -e WECHATY_PUPPET_SERVICE_TOKEN=puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f'
+ '[' -z '' ']'
+ docker pull wechaty/wechaty
Using default tag: latest
latest: Pulling from wechaty/wechaty
Digest: sha256:b56d3dc531b4ba95bcb46f2f721347007b5c67fd6f6778fbdf7af242e2c2d189
Status: Image is up to date for wechaty/wechaty:latest
docker.io/wechaty/wechaty:latest
++ pwd
+ docker run -t -i --rm --name wechaty --mount type=bind,source=/root/docker-wechaty-getting-started,target=/bot -e WECHATY_PUPPET_SERVICE_ENDPOINT=114.215.83.32:7777 -e WECHATY_PUPPET=wechaty-puppet-service -e WECHATY_PUPPET_SERVICE_TOKEN=puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f wechaty/wechaty src/javascript-es6.js
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
WECHATY Environment Variables: 4
WECHATY_PUPPET_SERVICE_TOKEN=puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f
WECHATY_DOCKER=1
WECHATY_PUPPET_SERVICE_ENDPOINT=114.215.83.32:7777
WECHATY_PUPPET=wechaty-puppet-service
Starting Docker Container for Wechaty v0.56.3 with Node.js v12.20.1 ...
Working directory: /bot
Executing babel-node --presets @babel/env src/javascript-es6.js
03:17:51 ERR PuppetService start() rejection: 16 UNAUTHENTICATED: {code:8,message:"A token(puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet_' "}
Error: 16 UNAUTHENTICATED: {code:8,message:"A token(puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet_' "}
at Object.exports.createStatusError (/wechaty/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/wechaty/node_modules/grpc/src/client_interceptors.js:1209:28)
at InterceptingListener._callNext (/wechaty/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/wechaty/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/wechaty/node_modules/grpc/src/client_interceptors.js:847:24) {
code: 16,
metadata: Metadata { _internal_repr: {}, flags: 0 },
details: `{code:8,message:"A token(puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet_' "}`
}
03:17:51 ERR Wechaty start() exception: 16 UNAUTHENTICATED: {code:8,message:"A token(puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet_' "}
Bot error: Error: 16 UNAUTHENTICATED: {code:8,message:"A token(puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet_' "}
at Object.exports.createStatusError (/wechaty/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/wechaty/node_modules/grpc/src/client_interceptors.js:1209:28)
at InterceptingListener._callNext (/wechaty/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/wechaty/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/wechaty/node_modules/grpc/src/client_interceptors.js:847:24) {
code: 16,
metadata: Metadata { _internal_repr: {}, flags: 0 },
details: `{code:8,message:"A token(puppet_34e2b701-a21a-4f12-8f5a-90b1331bbe8f) must be prefixed with a 'puppet_' "}`
}
03:17:51 WARN PuppetService stop() is called on a OFF puppet. await ready(off) and return.
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ ___
| ____|_ _(_) |_ / _ \
| _| \ \/ / | __| | | | |
| |___ > <| | |_ | |_| |
|_____/_/\_\_|\__| \___/
This is my wechaty gateway.
It would be better if we can post text instead of a screenshot image because text is copyable and searchable.
First, It seems that you are run into https://github.com/wechaty/wechaty/discussions/1985#discussioncomment-316928 : WECHATY_TOKEN should not equal to WECHATY_PUPPET_PADLOCAL_TOKEN
Second, in order to provider a Wechaty puppet service, you must have a workable Wechaty puppet provider, like PadLocal, or Donut.
Which means you have to set the environment variable WECHATY_PUPPET
correctly.
Please read the issue I posted above, and learn more from https://wechaty.js.org/2021/01/28/csharp-wechaty-for-padlocal-puppet-service/
Thank you. It works now.
Congratulations!
It's great to know that you have made matrix-appservice-wechaty works for you!
Would you like to write a blog post for sharing your experiences about how to set up this appservice with Wechaty and Matrix, so that other developers who want to do the same setup could be benefited from your post? Because this project is new, and it has very limited documentation for this topic, so there will be very valuable for creating this article and sharing to the community!
Ok, I will write a blog post when I have time.
Thank you very much, appreciate it!
this is my docker-compose.yml file.
and matrix connects to matrix-appservice-wechaty successfully. But matrix-appservice-wechaty get UNAUTHENTICATED error
when I delete WECHATY_PUPPET_SERVICE_ENDPOINT environment, I get these errors.