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

突发性出现【can not parse json data from grpc server.】然后心跳超时,接着【logout in wechaty】退出登录 #285

Open
iguxiaobei opened this issue Jul 30, 2020 · 1 comment

Comments

@iguxiaobei
Copy link
Contributor

iguxiaobei commented Jul 30, 2020

Important:Please file the issue follow the template, or we won't help you to solve the problem.

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:
npm install wechaty-puppet-padlus@next
  1. Please search in the issue first, and make sure your problem had not been reported before

1. Versions

  • What is your wechaty version?
    Answer:
    [email protected]

  • What is your wechaty-puppet-padplus version?
    Answer:
    [email protected]

  • What is your node version? (run node --version)
    Answer:
    v10.15.0

  • What os are you using
    Answer:
    Linux

2. Describe the bug

突发性出现can not parse json data from grpc server.,最后,以【logout in wechaty】退出登录

3. To Reproduce

This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.

Steps to reproduce the behavior:

  1. run '...'
  2. ...
  3. ...

4. Expected behavior

没有异常或出现异常能自动重连来修复问题

5. Actual behavior

以【logout in wechaty】退出登录

6. Full Output Logs

08:57:23 ERR Config ###########################

08:57:23 ERR Config unhandledRejection: Error: can not parse json data from grpc server. [object Promise]

08:57:23 ERR Config ###########################

08:57:23 ERR Config process.on(unhandledRejection) promise.catch(can not parse json data from grpc server.)
Config Error: can not parse json data from grpc server.
at GrpcGateway. (/xiaoju-bot/node_modules/wechaty-puppet-padplus/dist/src/server-manager/grpc-gateway.js:478:35)
at Generator.next ()
at /xiaoju-bot/node_modules/wechaty-puppet-padplus/dist/src/server-manager/grpc-gateway.js:8:71
at new Promise ()
at __awaiter (/xiaoju-bot/node_modules/wechaty-puppet-padplus/dist/src/server-manager/grpc-gateway.js:4:12)
at ClientReadableStream.stream.on (/xiaoju-bot/node_modules/wechaty-puppet-padplus/dist/src/server-manager/grpc-gateway.js:391:41)
at ClientReadableStream.emit (events.js:182:13)
at ClientReadableStream.EventEmitter.emit (domain.js:441:20)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at ClientReadableStream.Readable.push (_stream_readable.js:219:10)
at Object.onReceiveMessage (/xiaoju-bot/node_modules/grpc/src/client_interceptors.js:1263:19)
at InterceptingListener.recvMessageWithContext (/xiaoju-bot/node_modules/grpc/src/client_interceptors.js:607:19)
at /xiaoju-bot/node_modules/grpc/src/client_interceptors.js:707:14
(node:10) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 20)

08:57:53 ERR GRPC_GATEWAY ApiType: HEARTBEAT request timeout, traceId: 7e1785a1-e768-41ba-aa8e-f6ae5f5d54df

08:57:53 ERR GRPC_GATEWAY can not get heartbeat from grpc server

08:57:53 INFO PadplusManager ready to restart due to receive event: reconnect

08:58:23 ERR GRPC_GATEWAY ApiType: HEARTBEAT request timeout, traceId: 68ad1b93-4bcf-4477-9eae-c3d6003f93b5

08:58:23 ERR GRPC_GATEWAY can not get heartbeat from grpc server

08:58:23 INFO PadplusManager ready to restart due to receive event: reconnect

08:58:24 ERR GRPC_GATEWAY ApiType: INIT request timeout, traceId: fd9c4602-3ac5-4160-9a60-e83324b07371

08:58:24 ERR PadplusUser can not get callback result of INIT

08:58:54 ERR GRPC_GATEWAY ApiType: INIT request timeout, traceId: b9c31e2f-5450-4bca-abdb-f0b00992a3c7

08:58:54 ERR PadplusUser can not get callback result of INIT

09:01:23 WARN Puppet constructor() watchdog.on(reset) reason: {"data":"","timeout":240000}

09:01:23 INFO PuppetPadplus stop()

09:01:23 INFO PuppetPadplus logout(true, logout in wechaty)

09:01:23 INFO logoutListener BOT LOGOUT: 蓝秘书 logout

$ WECHATY_LOG=silly node yourbot.js

Question: Paste your FULL(DO NOT ONLY PROVIDE FRAGMENTS) log messages
Answer:

7. Additional context

Add any other context about the problem here.

[bug]

@su-chang
Copy link
Member

su-chang commented Jul 31, 2020

Analyze the Log
It seems grpc listen on some bad JSON data from padplus-server, and can not parse this data successfully.

When the bot miss padplus-server heartbeat, it will try to reconnect by padplus, but it seems that the bot lost connect with padplus-server.

In the end, wechaty watch dog timeout, and reset itself, so we could listen on logout event in wechaty.

Conclusion
We have to keep watching on this issue, if we can not reproduce it.

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

2 participants