Azure Bot未在团队上响应



我有一个使用Microsoft bot框架Node构建的机器人。JS SDK,该机器人部署在windows服务器上,一年多来一直运行良好。

就在几天前,机器人停止了响应,检查了机器人的日志,发现了这个错误。

node:14628) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:14628) UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 400 ERROR
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (C:inetpubwwwrootBotServiceTokennode_modulesbotbuilderlibbotFrameworkAdapter.js:1262:37)
at IncomingMessage.emit (events.js:327:22)
at IncomingMessage.EventEmitter.emit (domain.js:482:12)
at endReadableNT (_stream_readable.js:1221:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
at BotFrameworkAdapter.<anonymous> (C:inetpubwwwrootBotServiceTokennode_modulesbotbuilderlibbotFrameworkAdapter.js:687:27)
at Generator.throw (<anonymous>)
at rejected (C:inetpubwwwrootBotServiceTokennode_modulesbotbuilderlibbotFrameworkAdapter.js:12:65)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:14628) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:14628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

注意:当我使用Botframework Emulator进行测试时,该机器人程序运行良好。

有没有办法解决这个问题,我已经检查了错误中提到的botFrameworkAdapter.js文件,但我似乎找不到错误。

就像警告所说的

弃用警告:由于安全性和可用性问题,Buffer((已弃用。请改用Buffer.alloc((、Buffer.allocUnsafe((或Buffer.from((方法。

以避免折旧警告。您需要在代码中找到新的Buffer((方法,并用新方法替换它们。

最新更新