juzibot / wechaty-puppet-macpro

One puppet based on Mac WeChat for Wechaty.
Apache License 2.0
38 stars 10 forks source link

demo执行后,反复报错:INFO start grpc gateway failed for reason: Error: Try to connect to server timeout., retry start in 5 seconds #48

Open woshidamaomao opened 4 years ago

woshidamaomao commented 4 years ago

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:

  2. Please search in the issue first, and make sure your problem had not been reported before

1. Versions

2. Describe the bug

如果我用 wechaty@next v0.29.33 和wechaty-puppet-macpro@next v0.3.3,并执行node ./index.js, 就一直报错“INFO start grpc gateway failed for reason: Error: Try to connect to server timeout., retry start in 5 seconds.”.

当我换成 wechaty@latest v0.28.3 和 wechaty-puppet-macpro@latest v0.2.6,并删除node_modules 重新安装,再次执行 node ./index.js时,不报错了,但是卡着不动最后一段log为“INFO Wechaty <Puppet#0()>(testsetset) start() v0.28.3 is starting...”

3. To Reproduce

  1. 创建目录wechaty-macpro-test
  2. cd ./wechaty-macpro-test
  3. npm init
  4. npm install --save wechaty@next
  5. npm install --save wechaty-puppet-macpro@next
  6. npm install --save qrcode-terminal
  7. 创建index.js
  8. index.js代码如下面代码块:
const { Wechaty } = require('wechaty');
const { PuppetMacpro } = require('wechaty-puppet-macpro');
const { generate } = require('qrcode-terminal');

const token = 'puppet_macpro_c76*********';
const name = 'your-bot-name'

process.env.BROLOG_LEVEL = 'silly';
console.log("process.env", process.env)
const puppet = new PuppetMacpro({
  token
})

const bot = new Wechaty({
  puppet,
  name // login without scan qrcode at next time, it will generate xxxx.memory-card.json and save login data.
})

bot.on('scan', (qrcode) => {
  generate(qrcode, {
    small: true
  })
}).on('login', (user) => {
  console.log(`login user : ${user}`)
}).on('message', msg => {
  console.log(`msg : ${msg}`)
}).start()
  1. 执行node ./index.js

4. Expected behavior

期望执行.start() 后出现登录二维码

5. Actual behavior

实际上.start()执行后,一直在报错,报错内容如下:

16:54:43 INFO Wechaty <Puppet#0<PuppetMacpro>()>(your-bot-name) start() v0.29.33 is starting...
16:54:48 INFO start grpc gateway failed for reason: Error: Try to connect to server timeout., retry start in 5 seconds.
16:54:58 INFO start grpc gateway failed for reason: Error: Try to connect to server timeout., retry start in 5 seconds.
16:55:03 INFO start grpc gateway failed for reason: Error: Failed to connect to server, state changed to 1, retry start in 5 seconds.
16:55:13 INFO start grpc gateway failed for reason: Error: Try to connect to server timeout., retry start in 5 seconds.

6. Full Output Logs

加上 BROLOG_LEVEL = 'silly' 之后的报错如如下所示:

17:49:20 SILL PUPPET_MACPRO start()
brolog.js:190
17:49:20 SILL StateSwitch <PuppetMacpro> on() is pending
brolog.js:190
17:49:20 VERB StateSwitch <PuppetMacpro> on(pending) <- (pending)
brolog.js:190
17:49:20 SILL GRPC_GATEWAY notify(getLoginUserInfo, undefined)
brolog.js:190
17:49:25 INFO start grpc gateway failed for reason: Error: Try to connect to server timeout., retry start in 5 seconds. 
brolog.js:183
17:49:30 SILL PUPPET_MACPRO start()
brolog.js:190
17:49:30 SILL StateSwitch <PuppetMacpro> on() is pending
brolog.js:190
17:49:30 VERB StateSwitch <PuppetMacpro> on(pending) <- (pending)
brolog.js:190
17:49:30 SILL GRPC_GATEWAY notify(getLoginUserInfo, undefined)
brolog.js:190
17:49:35 INFO start grpc gateway failed for reason: Error: Failed to connect to server, state changed to 1, retry start in 5 seconds. 
brolog.js:183
17:49:40 SILL PUPPET_MACPRO start()
brolog.js:190
17:49:40 SILL StateSwitch <PuppetMacpro> on() is pending
brolog.js:190
17:49:40 VERB StateSwitch <PuppetMacpro> on(pending) <- (pending)
brolog.js:

7. Additional context

请问,使用哪个wechaty和wechaty-puppet-macprod的版本可以正常使用,且已经修复每天晚上自动掉线的问题?

woshidamaomao commented 4 years ago

我随便换了个假token效果和这个是一样的,我怀疑是提供的token有问题。

wuchaoya commented 3 years ago

我也是这个问题

su-chang commented 3 years ago

wechaty-puppet-macpro 已经停用