wechaty / friday

Friday is an Assistant BOT Built on Wechaty for Serving our Community
http://friday.chatie.io:5200
Apache License 2.0
83 stars 20 forks source link

Error when reconnect to a existing Puppet Server #106

Open huan opened 3 years ago

huan commented 3 years ago

Wechaty Version

Puppet Service (client)

12:54:00 VERB PuppetLoginMixin login(wxid_4wkls7tu62ua12)
12:54:00 VERB PuppetService hookPayloadStore() this.on(login) contactId: "wxid_4wkls7tu62ua12"
12:54:00 VERB PayloadStore start(wxid_4wkls7tu62ua12)
12:54:00 VERB user/mixins/poolify poolifyMixin() PoolifiedMixin get pool() init pool
12:54:00 VERB PuppetService contactRawPayload(wxid_4wkls7tu62ua12)
12:54:00 VERB ContactSelf name()
12:54:00 INFO startBot onLogin(Contact<Friday BOT>) Friday BOT BOT5 Wechaty@0.77.24 logged in
12:54:00 VERB Contact say(Friday BOT BOT5 Wechaty@0.77.24 logged in)
12:54:00 VERB PuppetService messageSend(wxid_4wkls7tu62ua12, Friday BOT BOT5 Wechaty@0.77.24 logged in)
12:54:00 INFO WechatyPluginContrib EventLogger login: Contact<Friday BOT>
12:54:00 VERB WechatyPluginContrib Heartbeat wechaty.on(login)
12:54:00 VERB user/mixins/poolify poolifyMixin() PoolifiedMixin get pool() init pool
12:54:00 VERB Room say(Der! I just got online!
Friday.BOT v0.12.11, )
12:54:00 VERB PuppetService messageSend(18131996049@chatroom, Der! I just got online!
Friday.BOT v0.12.11)
12:54:00 VERB Room ready()
12:54:00 VERB PuppetRoomMixin roomPayload(24980472405@chatroom)
12:54:00 VERB PuppetService roomRawPayload(24980472405@chatroom)
12:54:00 VERB PuppetService roomMemberList(24980472405@chatroom)
12:54:00 ERR Config ###########################
12:54:00 ERR Config unhandledRejection: Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) [object Promise]
12:54:00 ERR Config ###########################
12:54:00 ERR Config process.on(unhandledRejection) promise.catch(13 INTERNAL: Cannot read properties of undefined (reading 'api'))
Config Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 13,
  details: "Cannot read properties of undefined (reading 'api')",
  metadata: Metadata {
    internalRepr: Map(1) { 'authorization' => [Array] },
    options: {}
  }
}
(node:1819303) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
(Use `node --trace-warnings ...` to show where the warning was created)
12:54:00 VERB GError from("{"code":13,"details":"Cannot read properties of undefined (reading 'api')","metadata":{"authorization":["Wechaty undefined"]}}")
12:54:00 VERB GError constructor("{"code":13,"details":"Cannot read properties of undefined (reading 'api')","metadata":{"authorization":["Wechaty undefined"]}}")
12:54:00 ERR on-error onError(Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api'))
GError: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 2,
  details: [
    'Error',
    "Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')",
    '    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)',
    '    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)',
    '    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)',
    '    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)',
    '    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78',
    '    at processTicksAndRejections (node:internal/process/task_queues:78:11)'
  ]
}
Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
12:54:00 INFO WechatyPluginContrib EventLogger error: Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
12:54:00 ERR Config ###########################
12:54:00 ERR Config unhandledRejection: Error: 13 INTERNAL: Cannot read properties of undefined (reading 'getRoomMember')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) [object Promise]
12:54:00 ERR Config ###########################
12:54:00 ERR Config process.on(unhandledRejection) promise.catch(13 INTERNAL: Cannot read properties of undefined (reading 'getRoomMember'))
Config Error: 13 INTERNAL: Cannot read properties of undefined (reading 'getRoomMember')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 13,
  details: "Cannot read properties of undefined (reading 'getRoomMember')",
  metadata: Metadata {
    internalRepr: Map(1) { 'authorization' => [Array] },
    options: {}
  }
}
(node:1819303) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)
^Cfinis: SIGNIT received.

Puppet Server

04:52:40 INFO Io on(jsonrpc): [object Object]
04:52:40 VERB Io on(jsonrpc) send({"id":-9007199254727037,"jsonrpc":"2.0","result":58788})
04:52:41 VERB PuppetServiceImpl event()
04:52:41 VERB EventStreamManager start(stream)
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() for Puppet#1<PuppetPadlocal>(insecure_7bda5366-9e72-4876-bf1a-e7f44d50a616)
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(friendship) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(login) (listenerCount:2) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(logout) (listenerCount:2) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(message) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-invite) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-join) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-leave) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-topic) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(scan) (listenerCount:2) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dirty) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dong) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(error) (listenerCount:1) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(heartbeat) (listenerCount:2) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(ready) (listenerCount:2) registering...
04:52:41 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(reset) (listenerCount:0) registering...
04:52:41 VERB EventStreamManager onStreamingCallEnd(callback)
04:52:41 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"Wechaty Puppet gRPC stream connect successfully"})
04:52:41 VERB EventStreamManager start() puppet is logged in, emit a login event for downstream
04:52:41 VERB PuppetLoginMixin get currentUserId()
04:52:41 VERB EventStreamManager grpcEmit(EVENT_TYPE_LOGIN[25], {"contactId":"wxid_4wkls7tu62ua12"})
04:52:41 VERB PuppetServiceImpl start()
04:52:41 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@padlocal"})
04:52:41 VERB StateSwitch <PuppetState> on(pending) <- (false)
04:52:41 VERB PuppetServiceImpl messageSendText()
04:52:41 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
04:52:41 VERB PuppetServiceImpl messageSendText()
04:52:41 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
04:52:41 VERB PuppetServiceImpl roomMemberList()
04:52:41 ERR PuppetServiceImpl grpcError() roomMemberList() rejection: Cannot read properties of undefined (reading 'getRoomMember')
04:52:56 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@padlocal"})
04:53:11 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@padlocal"})
04:53:26 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@padlocal"})
04:53:41 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@padlocal"})
04:53:41 ERR PuppetServiceImpl grpcError() start() rejection: 4 DEADLINE_EXCEEDED: Deadline exceeded
04:53:46 VERB PuppetServiceImpl stop()
04:53:46 VERB EventStreamManager stop()
04:53:46 VERB StateSwitch <PuppetState> off(pending) <- (false)
04:53:46 ERR PuppetServiceImpl grpcError() stop() rejection: Cannot read properties of undefined (reading 'removeAllListeners')
04:53:46 VERB EventStreamManager this.onStreamingCallEnd() this.eventStream.on(finish) fired
04:53:46 VERB EventStreamManager connectPuppetEventToStreamingCall() offAll() 14 callbacks
04:53:46 WARN EventStreamManager this.onStreamingCallEnd() this.eventStream.on(finish) eventStream is undefined
04:53:46 VERB EventStreamManager this.onStreamingCallEnd() this.eventStream.on(close) fired
04:53:46 WARN EventStreamManager this.onStreamingCallEnd() this.eventStream.on(close) eventStream is undefined
04:53:46 VERB EventStreamManager this.onStreamingCallEnd() this.eventStream.on(cancelled) fired with arguments: {}
04:53:46 WARN EventStreamManager this.onStreamingCallEnd() this.eventStream.on(cancelled) eventStream is undefined
04:53:46 VERB PuppetServiceImpl logout()
04:53:46 ERR PuppetServiceImpl grpcError() logout() rejection: logout before login?
04:54:00 INFO Io on(jsonrpc): [object Object]
04:54:00 VERB Io on(jsonrpc) send({"id":-9007199254727027,"jsonrpc":"2.0","result":58788})
04:54:00 VERB PuppetServiceImpl event()
04:54:00 VERB EventStreamManager start(stream)
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() for Puppet#1<PuppetPadlocal>(insecure_7bda5366-9e72-4876-bf1a-e7f44d50a616)
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(friendship) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(login) (listenerCount:2) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(logout) (listenerCount:2) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(message) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-invite) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-join) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-leave) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-topic) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(scan) (listenerCount:2) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dirty) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dong) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(error) (listenerCount:1) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(heartbeat) (listenerCount:2) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(ready) (listenerCount:2) registering...
04:54:00 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(reset) (listenerCount:0) registering...
04:54:00 VERB EventStreamManager onStreamingCallEnd(callback)
04:54:00 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"Wechaty Puppet gRPC stream connect successfully"})
04:54:00 VERB EventStreamManager start() puppet is logged in, emit a login event for downstream
04:54:00 VERB PuppetLoginMixin get currentUserId()
04:54:00 VERB EventStreamManager grpcEmit(EVENT_TYPE_LOGIN[25], {"contactId":"wxid_4wkls7tu62ua12"})
04:54:00 VERB PuppetServiceImpl start()
04:54:00 VERB StateSwitch <PuppetState> on(pending) <- (false)
04:54:00 VERB PuppetServiceImpl messageSendText()
04:54:00 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
04:54:00 VERB PuppetServiceImpl messageSendText()
04:54:00 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
04:54:00 VERB PuppetServiceImpl roomMemberList()
04:54:00 ERR PuppetServiceImpl grpcError() roomMemberList() rejection: Cannot read properties of undefined (reading 'getRoomMember')
04:54:04 VERB PuppetServiceImpl messageSendText()
04:54:04 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
04:54:06 VERB EventStreamManager this.onStreamingCallEnd() this.eventStream.on(cancelled) fired with arguments: {}
04:54:06 VERB EventStreamManager connectPuppetEventToStreamingCall() offAll() 14 callbacks
04:55:00 ERR PuppetServiceImpl grpcError() start() rejection: 4 DEADLINE_EXCEEDED: Deadline exceeded
huan commented 3 years ago

wechaty@1.0.6

Client

17:01:11 VERB PuppetServiceMixin start()
17:01:11 VERB ServiceCtl<PuppetServiceMixin> start()
17:01:11 VERB StateSwitch <PuppetServiceMixin> active(pending) <- (false)
17:01:11 VERB ServiceCtl<PuppetServiceMixin> start() super.start() ...
17:01:11 VERB PuppetLoginMixin start()
17:01:11 VERB PuppetCacheMixin start()
17:01:11 VERB PuppetMemoryMixin start()
17:01:11 VERB PuppetSkelton start()
17:01:11 VERB CacheAgent start()
17:01:11 VERB CacheAgent clear()
17:01:11 VERB ServiceCtl<PuppetServiceMixin> start() super.start() ... done
17:01:11 VERB ServiceCtl<PuppetServiceMixin> start() this.onStart() ...
17:01:11 VERB PuppetService onStart()
17:01:11 VERB GrpcClient constructor({})
17:01:11 VERB GrpcClient constructor() tlsRootCert(hash): "88ab8b62777f0fb1179ec567c5019c31d646428cc0a3fdb007fcffa1e9f
ac5a8"
17:01:11 VERB GrpcClient constructor() token: "insecure_7bda5366-9e72-4876-bf1a-e7f44d50a616"
17:01:11 VERB GrpcClient constructor() endpoint: "wechaty://api.chatie.io/insecure_7bda5366-9e72-4876-bf1a-e7f44d50a61
6"
17:01:11 VERB GrpcClient constructor() disableTls: "false"
17:01:11 VERB GrpcClient constructor() serverName(SNI): "insecure"
17:01:11 VERB PuppetService bridgeGrpcEventStream(client)
17:01:11 VERB GrpcClient start()
17:01:11 VERB GrpcClient initClient()
17:01:11 VERB GrpcClient initClient() TLS: enabled
17:01:11 VERB GrpcClient startStream()
17:01:12 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:58)})
17:01:12 INFO WechatyPluginContrib EventLogger heartbeat: Wechaty Puppet gRPC stream connect successfully
17:01:12 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_LOGIN(25), payload(len:35)})
17:01:12 INFO WechatyPluginContrib EventLogger heartbeat: onGrpcStreamEvent(EVENT_TYPE_LOGIN)
17:01:12 VERB PuppetLoginMixin login(wxid_4wkls7tu62ua12)
17:01:12 VERB PuppetService hookPayloadStore() this.on(login) contactId: "wxid_4wkls7tu62ua12"
17:01:12 VERB PayloadStore start(wxid_4wkls7tu62ua12)
17:01:12 VERB user/mixins/poolify poolifyMixin() PoolifiedMixin get pool() init pool
17:01:12 VERB PuppetService contactRawPayload(wxid_4wkls7tu62ua12)
17:01:12 VERB PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload(len:29)})
17:01:12 INFO WechatyPluginContrib EventLogger heartbeat: heartbeat@padlocal
17:01:12 VERB ContactSelf name()
17:01:12 INFO startBot onLogin(Contact<Friday BOT>) Friday BOT BOT5 Wechaty@1.0.6 logged in
17:01:12 VERB Contact say(Friday BOT BOT5 Wechaty@1.0.6 logged in)
17:01:12 VERB PuppetService messageSend(wxid_4wkls7tu62ua12, Friday BOT BOT5 Wechaty@1.0.6 logged in)
17:01:12 INFO WechatyPluginContrib EventLogger login: Contact<Friday BOT>
17:01:12 VERB WechatyPluginContrib Heartbeat wechaty.on(login)
17:01:12 VERB user/mixins/poolify poolifyMixin() PoolifiedMixin get pool() init pool
17:01:12 VERB Room say(Der! I just got online!
Friday.BOT v1.0.2, )
17:01:12 VERB PuppetService messageSend(18131996049@chatroom, Der! I just got online!
Friday.BOT v1.0.2)
17:01:12 VERB Room ready()
17:01:12 VERB PuppetRoomMixin roomPayload(24980472405@chatroom)
17:01:12 VERB PuppetService roomRawPayload(24980472405@chatroom)
17:01:12 VERB PuppetService roomMemberList(24980472405@chatroom)
17:01:12 ERR Config ###########################
17:01:12 ERR Config Wechaty unhandledRejection: Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api'
)
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) [object Promise]
17:01:12 ERR Config ###########################
17:01:12 ERR Config process.on(unhandledRejection) promise.catch(13 INTERNAL: Cannot read properties of undefined (reading 'api'))
Config Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 13,
  details: "Cannot read properties of undefined (reading 'api')",
  metadata: Metadata {
    internalRepr: Map(1) { 'authorization' => [Array] },
    options: {}
  }
}
[(node:2096406) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
(Use `node --trace-warnings ...` to show where the warning was created)
17:01:12 VERB GError from("{"code":13,"details":"Cannot read properties of undefined (reading 'api')","metadata":{"authorization":["Wechaty undefined"]}}")
17:01:12 VERB GError constructor("{"code":13,"details":"Cannot read properties of undefined (reading 'api')","metadata":{"authorization":["Wechaty undefined"]}}")
17:01:12 ERR on-error onError(Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api'))
GError: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 2,
  details: [
    "Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')\n" +
      '    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)\n' +  
      '    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)\n' +   
      '    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)\n' +
      '    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)\n' +
      '    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:78:11)'
  ]
}
Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
17:01:12 INFO WechatyPluginContrib EventLogger error: Error: 13 INTERNAL: Cannot read properties of undefined (reading 'api')
17:01:12 ERR Config ###########################
17:01:12 ERR Config Wechaty unhandledRejection: Error: 13 INTERNAL: Cannot read properties of undefined (reading 'getRoomMember')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) [object Promise]
17:01:12 ERR Config ###########################
17:01:12 ERR Config process.on(unhandledRejection) promise.catch(13 INTERNAL: Cannot read properties of undefined (reading 'getRoomMember'))
Config Error: 13 INTERNAL: Cannot read properties of undefined (reading 'getRoomMember')
    at Object.callErrorFromStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /home/friday/git/friday/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 13,
  details: "Cannot read properties of undefined (reading 'getRoomMember')",
  metadata: Metadata {
    internalRepr: Map(1) { 'authorization' => [Array] },
    options: {}
  }
}

Server

09:01:12 INFO Io on(jsonrpc): [object Object]
09:01:12 VERB Io on(jsonrpc) send({"id":-9007199254739033,"jsonrpc":"2.0","result":58788})
09:01:12 VERB PuppetServiceImpl event()
09:01:12 VERB EventStreamManager start(stream)
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() for Puppet#1<PuppetPadlocal>(insecure_7bda5366-9e72-4876-bf1a-e7f44d50a616)
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(friendship) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(login) (listenerCount:2) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(logout) (listenerCount:2) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(message) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-invite) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-join) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-leave) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-topic) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(scan) (listenerCount:2) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dirty) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dong) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(error) (listenerCount:1) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(heartbeat) (listenerCount:2) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(ready) (listenerCount:2) registering...
09:01:12 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(reset) (listenerCount:0) registering...
09:01:12 VERB EventStreamManager onStreamingCallEnd(callback)
09:01:12 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"Wechaty Puppet gRPC stream connect successfully"})
09:01:12 VERB EventStreamManager start() puppet is logged in, emit a login event for downstream
09:01:12 VERB PuppetLoginMixin get currentUserId()
09:01:12 VERB EventStreamManager grpcEmit(EVENT_TYPE_LOGIN[25], {"contactId":"wxid_4wkls7tu62ua12"})
09:01:12 VERB PuppetServiceImpl start()
09:01:12 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@padlocal"})
09:01:12 VERB StateSwitch <PuppetState> on(pending) <- (false)
09:01:12 VERB PuppetServiceImpl messageSendText()
09:01:12 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
09:01:12 VERB PuppetServiceImpl messageSendText()
09:01:12 ERR PuppetServiceImpl grpcError() messageSendText() rejection: Cannot read properties of undefined (reading 'api')
09:01:12 VERB PuppetServiceImpl roomMemberList()
09:01:12 ERR PuppetServiceImpl grpcError() roomMemberList() rejection: Cannot read properties of undefined (reading 'getRoomMember')
huan commented 3 years ago

After investigating this a lot, we finally figure out that the problem is related to the PadLocal.

Will file an issue on PadLocal repo: