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

hostie stucked when connected to Wechaty Gateway Server with Padlocal token #41

Closed
inkpool opened this issue Jan 7, 2021 · 3 comments
Closed

Comments

@inkpool
Copy link

inkpool commented Jan 7, 2021

Just switched to padlocal token.

Started my endpoint (gateway server). Got logs:

10:40:01 VERB Wechaty initPuppetEventBridge() puppet.on(error) (listenerCount:0) registering...
10:40:01 VERB Wechaty initPuppetEventBridge() puppet.on(heartbeat) (listenerCount:0) registering...
10:40:01 VERB Wechaty initPuppetEventBridge() puppet.on(ready) (listenerCount:0) registering...
10:40:01 VERB Wechaty initPuppetEventBridge() puppet.on(reset) (listenerCount:0) registering...
10:40:01 VERB Wechaty wechatifyUserModules(Puppet#0(mytokenxx123766x))
10:40:01 VERB StateSwitch on(pending) <- (false)
10:40:01 INFO
============================================================
Welcome to Wechaty PadLocal puppet!

   - wechaty-puppet-padlocal version: 0.2.3
   - padlocal-ts-client version: 0.2.3
  ============================================================

10:40:01 VERB Wechaty on(heartbeat, listener) registering... listenerCount: 1
10:40:01 VERB StateSwitch on(true) <- (pending)
10:40:01 VERB IoClient startHostie()
10:40:01 VERB PuppetServer constructor({endpoint: "0.0.0.0:9001", puppet: "Puppet#0(mytokenxxxxxx)", token: "mytokenxxxxxx"})
10:40:01 VERB PuppetServer start()
10:40:01 VERB EventStreamManager constructor(Puppet#0(mytokenxxxxxx))
10:40:01 VERB StateSwitch on(true) <- (pending)
10:40:01 VERB [PuppetPadlocal] start login with type: QrLogin
10:40:02 VERB [PuppetPadlocal] scan event, status: Waiting, with qrcode: http://weixin.qq.com/x/AbXxxxxxOXGBn
10:40:02 INFO IoClient [2] http://weixin.qq.com/x/AbXxxxxOXGBn
Online QR Code Image: https://wechaty.js.org/qrcode/http%3A%2F%2Fweixin.qq.com%2Fx%xxxxwXrlv-1OXGBn

On the python side, everything looks fine. But no QR code popped up. The hostile exit after stucking for a while.

I got logs:

2021-01-07 02:40:45,412 - Wechaty - INFO - init_puppet_event_bridge() <<wechaty_puppet_hostie.puppet.HostiePuppet object at 0x11f5e7b80>>
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(dong) (listenerCount:1) registering...
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(error) (listenerCount:1) registering...
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(heart-beat) (listenerCount:1) registering...
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(ready) (listenerCount:1) registering...
2021-01-07 02:40:45,412 - Wechaty - INFO - receive event <%s>
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(reset) (listenerCount:0) registering...
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(friendship) (listenerCount:1) registering...
2021-01-07 02:40:45,412 - Wechaty - INFO - initPuppetEventBridge() puppet.on(login) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(logout) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(message) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-invite) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-join) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-leave) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-topic) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - initPuppetEventBridge() puppet.on(scan) (listenerCount:1) registering...
2021-01-07 02:40:45,413 - Wechaty - INFO - starting puppet ...
2021-01-07 02:40:45,413 - HostiePuppet - INFO - init puppet
2021-01-07 02:40:45,414 - HostiePuppet - INFO - starting the puppet ... <<<<< stucked here.
2021-01-07 02:43:16,481 - Wechaty - ERROR - The network is not good, the bot will try to restart after 60 seconds.
2021-01-07 02:44:16,486 - Wechaty - INFO - restarting the bot ...
2021-01-07 02:44:16,486 - Wechaty - INFO - wechaty is stoping ...
2021-01-07 02:44:16,486 - Wechaty - INFO - stopping - stop puppet
2021-01-07 02:44:16,486 - HostiePuppet - INFO - stop()

@inkpool
Copy link
Author

inkpool commented Jan 12, 2021

Here are my steps to set up the environments:

  1. Create the Gateway Server with following CMDs:

docker run -ti -e WECHATY_LOG="verbose" -e WECHATY_PUPPET="wechaty-puppet-padlocal" -e WECHATY_PUPPET_PADLOCAL_TOKEN="puppet_padlocal_xxxxx" -e WECHATY_HOSTIE_PORT="9001" -e WECHATY_TOKEN="mytokenxxx" -p "$WECHATY_HOSTIE_PORT:9001" wechaty/wechaty:next

  1. Run my project with python-puppet. Since I switched from donut token to Padlocal token, I did not change anything except the WECHATY_PUPPET_HOSTIE_TOKEN. It was updated with my self-defined token shown above.

From the logs, I could tell somehow the puppet had handshakes with the gateway server. But nothing popped up from the hostile-puppet side.

@huan
Copy link
Member

huan commented Jan 29, 2021

Link to wechaty/puppet-supports#84

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented Jun 12, 2021

This is fixed, I will close it now.

@wj-Mcat wj-Mcat closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants