wechaty/puppet-service

[Donut] Error: 2 UNKNOWN: can not load this file

Opened this issue · 0 comments

huan commented

Message.forward()

When we received an image message and then use message.forward() to forward it, we might get errors.

  1. If the message was sent from others, then it will be OK.
  2. If the message was sent from the bot itself, then the following errors will be triggered.
async function onMessage (msg: Message) {
  log.info('StarterBot', msg.toString())

  if (msg.self() && msg.type() === bot.Message.Type.Image) {
    await msg.forward(bot.Contact.load('filehelper'))
  }
}

Update: it is not only related to the self() but all the contacts.

Error: 2 UNKNOWN: can not load this file

15:38:32 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_MESSAGE(2), payload:"{"messageId":"6722107151486558686"}"})
15:38:32 VERB Message static load(6722107151486558686)
15:38:32 VERB Message constructor(6722107151486558686) for class WechatifiedMessage
15:38:32 VERB Message ready()
15:38:32 VERB Puppet messagePayload(6722107151486558686)
15:38:32 VERB PuppetHostie messageRawPayload(6722107151486558686)
15:38:32 VERB Room ready()
15:38:32 VERB Puppet roomPayload(5611663299@chatroom)
15:38:32 VERB PuppetHostie roomRawPayload(5611663299@chatroom)
15:38:32 VERB PuppetHostie roomMemberList(5611663299@chatroom)
15:38:32 INFO StarterBot Message#Image[🗣Contact<Huan (李卓桓)>@👥Room<ChatOps - Mike BO>]
15:38:32 VERB Message forward(Room<ChatOps - Mike BO>)
15:38:32 VERB Puppet messageForward("5611663299@chatroom", 6722107151486558686)
15:38:32 VERB Puppet messagePayload(6722107151486558686)
15:38:32 VERB PuppetHostie messageFile(6722107151486558686)
15:38:33 VERB PuppetHostie messageSend(5611663299@chatroom, FileBox#Stream< e29029f019e364201b346831261dad5b.jpg>)
15:38:35 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_MESSAGE(2), payload:"{"messageId":"6637982875548185575"}"})
15:38:35 VERB Message static load(6637982875548185575)
15:38:35 VERB Message constructor(6637982875548185575) for class WechatifiedMessage
15:38:35 VERB Message ready()
15:38:35 VERB Puppet messagePayload(6637982875548185575)
15:38:35 VERB PuppetHostie messageRawPayload(6637982875548185575)
15:38:35 VERB Room ready()
15:38:35 INFO StarterBot Message#Image[🗣Contact<Huan LI>@👥Room<ChatOps - Mike BO>]
15:38:35 VERB Message forward(Room<ChatOps - Mike BO>)
15:38:35 VERB Puppet messageForward("5611663299@chatroom", 6637982875548185575)
15:38:35 VERB Puppet messagePayload(6637982875548185575)
15:38:35 VERB PuppetHostie messageFile(6637982875548185575)
15:38:46 ERR Message forward(Room<ChatOps - Mike BO>) exception: Error: 2 UNKNOWN: can not load this file: C:\users\user\My Documents\WeChat Files\huan-us\FileStorage\Image\2020-11\67dee89f75bac1ee4ab676d11600eb3c.jpg
15:38:46 ERR Config ###########################
15:38:46 ERR Config unhandledRejection: Error: 2 UNKNOWN: can not load this file: C:\users\user\My Documents\WeChat Files\huan-us\FileStorage\Image\2020-11\67dee89f75bac1ee4ab676d11600eb3c.jpg
    at Object.exports.createStatusError (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/common.js:91:15)
    at ClientReadableStream._emitStatusIfDone (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:233:26)
    at ClientReadableStream._receiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:211:8)
    at Object.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1277:15)
    at InterceptingListener._callNext (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:618:8)
    at /Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1033:24 [object Promise]
15:38:46 ERR Config ###########################
15:38:46 ERR Config process.on(unhandledRejection) promise.catch(2 UNKNOWN: can not load this file: C:\users\user\My Documents\WeChat Files\huan-us\FileStorage\Image\2020-11\67dee89f75bac1ee4ab676d11600eb3c.jpg)
Config Error: 2 UNKNOWN: can not load this file: C:\users\user\My Documents\WeChat Files\huan-us\FileStorage\Image\2020-11\67dee89f75bac1ee4ab676d11600eb3c.jpg
    at Object.exports.createStatusError (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/common.js:91:15)
    at ClientReadableStream._emitStatusIfDone (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:233:26)
    at ClientReadableStream._receiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:211:8)
    at Object.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1277:15)
    at InterceptingListener._callNext (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:618:8)
    at /Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1033:24 {
  code: 2,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'can not load this file: C:\\users\\user\\My Documents\\WeChat Files\\huan-us\\FileStorage\\Image\\2020-11\\67dee89f75bac1ee4ab676d11600eb3c.jpg'
}
(node:93215) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
15:38:48 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT(1), payload:"{"data":"[object Object]"}"})

Error: 2 UNKNOWN: can not load message payload or url of the payload.

15:44:02 VERB PuppetHostie onGrpcStreamEvent({type:EVENT_TYPE_MESSAGE(2), payload:"{"messageId":"7561178795750972312"}"})
15:44:02 VERB Message static load(7561178795750972312)
15:44:02 VERB Message constructor(7561178795750972312) for class WechatifiedMessage
15:44:02 VERB Message ready()
15:44:02 VERB Puppet messagePayload(7561178795750972312)
15:44:02 VERB PuppetHostie messageRawPayload(7561178795750972312)
15:44:02 VERB Room ready()
15:44:02 VERB Puppet roomPayload(5611663299@chatroom)
15:44:02 VERB PuppetHostie roomRawPayload(5611663299@chatroom)
15:44:02 VERB PuppetHostie roomMemberList(5611663299@chatroom)
15:44:02 VERB PuppetHostie contactRawPayload(wxid_a8d806dzznm822)
15:44:02 VERB PuppetHostie contactRawPayload(lizhuohuan)
15:44:02 VERB PuppetHostie contactRawPayload(qq512436430)
15:44:02 INFO StarterBot Message#Image[🗣Contact<Huan LI>@👥Room<ChatOps - Mike BO>]
room id 5611663299@chatroom
15:44:02 VERB Message forward(Room<ChatOps - Mike BO>)
15:44:02 VERB Puppet messageForward("5611663299@chatroom", 7561178795750972312)
15:44:02 VERB Puppet messagePayload(7561178795750972312)
15:44:02 VERB PuppetHostie messageFile(7561178795750972312)
15:44:02 ERR Message forward(Room<ChatOps - Mike BO>) exception: Error: 2 UNKNOWN: can not load message payload or url of the payload.
15:44:02 ERR Config ###########################
15:44:02 ERR Config unhandledRejection: Error: 2 UNKNOWN: can not load message payload or url of the payload.
    at Object.exports.createStatusError (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/common.js:91:15)
    at ClientReadableStream._emitStatusIfDone (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:233:26)
    at ClientReadableStream._receiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:211:8)
    at Object.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1277:15)
    at InterceptingListener._callNext (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:618:8)
    at /Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1033:24 [object Promise]
15:44:02 ERR Config ###########################
15:44:02 ERR Config process.on(unhandledRejection) promise.catch(2 UNKNOWN: can not load message payload or url of the payload.)
Config Error: 2 UNKNOWN: can not load message payload or url of the payload.
    at Object.exports.createStatusError (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/common.js:91:15)
    at ClientReadableStream._emitStatusIfDone (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:233:26)
    at ClientReadableStream._receiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client.js:211:8)
    at Object.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1277:15)
    at InterceptingListener._callNext (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:618:8)
    at /Users/huan/chatie/wechaty-getting-started/node_modules/grpc/src/client_interceptors.js:1033:24 {
  code: 2,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'can not load message payload or url of the payload.'
}
(node:93465) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)