Repository navigation
Description
运行 ding-dong-bot.py 后,我得到以下消息:
2022-07-14 09:38:15,183 - Wechaty - INFO - on() listen event with <<function on_scan at 0x10bb9d3f0>>
2022-07-14 09:38:15,183 - Wechaty - INFO - on() listen event with <<function on_login at 0x10d3b41f0>>
2022-07-14 09:38:15,183 - Wechaty - INFO - on() listen event with <<function on_message at 0x10a8a4700>>
2022-07-14 09:38:15,195 - Wechaty - INFO - init_puppet_event_bridge() <<wechaty_puppet_service.puppet.PuppetService object at 0x10d61ded0>>
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(dong) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(error) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(heart-beat) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(ready) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - receive event <%s>
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(reset) (listenerCount:0) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(friendship) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(login) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(logout) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(message) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-invite) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-join) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-leave) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(room-topic) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - initPuppetEventBridge() puppet.on(scan) (listenerCount:1) registering...
2022-07-14 09:38:15,195 - Wechaty - INFO - starting puppet ...
2022-07-14 09:38:15,195 - PuppetService - INFO - init puppet ...
2022-07-14 09:38:15,195 - PuppetService - INFO - fetching endpoint from chatie-server: https://api.chatie.io/v0/hosties/puppet_padlocal_187a9a65139c4bf482654606645f9da1
2022-07-14 09:38:16,818 - PuppetService - INFO - starting the puppet ...
2022-07-14 09:38:16,957 - Wechaty - ERROR - The network is not good, the bot will try to restart after 60 seconds.
But here are some suggestions for you:
- 查看token是否可用?(过期或协议不可用)
- docker 服务是否正常启动?
- python-wechaty bot 是否正常启动?
- python-wechaty bot 是否能ping通docker服务?
- 由于版本细节问题,目前python-wechaty 支持最好的wechaty镜像为:wechaty/wechaty:0.65
I suggest that you should follow the template code from: https://wechaty.readthedocs.io/zh_CN/latest/ to avoid the unnecessary bugs.
2022-07-14 09:39:16,951 - Wechaty - INFO - restarting the bot ...
2022-07-14 09:39:16,952 - Wechaty - INFO - wechaty is stopping ...
2022-07-14 09:39:16,952 - PuppetService - INFO - stop()
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 368, in recv_initial_metadata
headers = await self._stream.recv_headers()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/protocol.py", line 342, in recv_headers
await self.headers_received.wait()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/locks.py", line 214, in wait
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/wechaty_puppet_service/puppet.py", line 916, in start
await self.puppet_stub.stop()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/wechaty_grpc/wechaty/init.py", line 25, in stop
return await self._unary_unary(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/betterproto/init.py", line 1124, in _unary_unary
response = await stream.recv_message()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 425, in recv_message
await self.recv_initial_metadata()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 367, in recv_initial_metadata
with self._wrapper:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/utils.py", line 70, in exit
raise self._error
grpclib.exceptions.StreamTerminatedError: Connection lost
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/wechaty/wechaty.py", line 396, in start
await self.puppet.start()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/wechaty_puppet_service/puppet.py", line 918, in start
await self.puppet_stub.start()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/betterproto/init.py", line 1124, in _unary_unary
response = await stream.recv_message()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 425, in recv_message
await self.recv_initial_metadata()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 367, in recv_initial_metadata
with self._wrapper:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/utils.py", line 70, in exit
raise self._error
grpclib.exceptions.StreamTerminatedError: Connection lost
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/huanglinghao/Desktop/test_python/python-wechaty-getting-started/examples/ding-dong-bot.py", line 100, in
asyncio.run(main())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/Users/huanglinghao/Desktop/test_python/python-wechaty-getting-started/examples/ding-dong-bot.py", line 95, in main
await bot.start()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/wechaty/wechaty.py", line 417, in start
await self.restart()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/betterproto/init.py", line 1124, in _unary_unary
response = await stream.recv_message()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 425, in recv_message
await self.recv_initial_metadata()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/client.py", line 367, in recv_initial_metadata
with self._wrapper:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/grpclib/utils.py", line 70, in exit
raise self._error
grpclib.exceptions.StreamTerminatedError: Connection lost
Activity
wj-Mcat commentedon Jul 14, 2022
Which protocol do you use ? Web or Padlocal ?
we create a bot template project for developer, you can refer to this repo and try to start your bot. Hope you can start your bot when following this readme.
sevenler commentedon Jun 26, 2023
i got the same issue:
this is log from wechaty-puppet-padlocal server
it looks like python puppet client is already connected to the padlocal server. but got StreamTerminatedError error. i am following the guide: https://wechaty.js.org/docs/puppet-services/padlocal
any way to fix this ?
wenmj commentedon Apr 6, 2024
how to deal with this error