0
votes

How do I fix this problem. Been lately receiving this causing my bot to be unresponsive.

enter image description here

I use node v8.11.2 and bot framework sdk v4 botbuilder version 4.8.0.

Thank you!

UPDATE: when I add console.error(error) this shows up:

code: undefined,statusCode: 401,request:WebResource {streamResponseBody: false,url:'https://facebook.botframework.com/v3/conversations/2073757266064270-1820074761374022/activities/IaVk3v72Rl1',method: 'POST',headers: HttpHeaders { _headersMap: [Object] },body:'{"type":"typing","serviceUrl":"https://facebook.botframework.com/","channelId":"facebook","from":{"id":"1820074761374022"},"conversation":{"id":"2073757266064270-1820074761374022"},"recipient":{"id":"2073757266064270"},"replyToId":"IaVk3v72Rl1"}',query: undefined,formData: undefined,withCredentials: false,abortSignal: undefined,timeout: 0,onUploadProgress: undefined,onDownloadProgress: undefined,operationSpec:{ httpMethod: 'POST',path: 'v3/conversations/{conversationId}/activities/{activityId}',urlParameters: [Array],requestBody: [Object],responses: [Object],serializer: [Serializer] } },response:{ body: '',headers: HttpHeaders { _headersMap: [Object] },status: 401 },body: undefined }

ERROR in my other bot:

[onTurnError] unhandled error: Error (node:11104) UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 500 ERRORErrorat new RestError (D:\home\site\wwwroot\node_modules@azure\ms-rest-js\dist\msRest.node.js:1397:28)at D:\home\site\wwwroot\node_modules@azure\ms-rest-js\dist\msRest.node.js:1849:37at process._tickCallback (internal/process/next_tick.js:68:7)at BotFrameworkAdapter. (D:\home\site\wwwroot\node_modules\botbuilder\lib\botFrameworkAdapter.js:638:27) at Generator.throw ()at rejected (D:\home\site\wwwroot\node_modules\botbuilder\lib\botFrameworkAdapter.js:13:65)at process._tickCallback (internal/process/next_tick.js:68:7)(node:11104) 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(). (rejection id: 15)

1
What steps can reproduce this error? Does it only happen in a particular situation? In index.js, in the onTurnErrorHandler, please add console.error(error) so that we can get the full stack trace. If you can provide your appId and/or bot name, I can look up things on the back end.mdrichardson
thank you @mdrichardson! I updated the question above and you can see what it shows when I put console.error(error). Can I personally message you about appId/bot name?Aleimar Villabrille
I was able to get the information I needed from your conversationId. Can you try removing the Facebook channel from your bot, then re-adding it? It looks like it needs to be re-authenticated: Error validating access token: The user has not authorized application 2219050101643998. See here for instructionsmdrichardson
OMG it fixed the problem! Thank you so much @mdrichardson ! So, in the future when this thing happens again, I'll just delete and reestablish my bot fb channel. noted with so many thanks!Aleimar Villabrille
Good to hear! I've added this as an answer, now that we've found it. Glad it worked!mdrichardson

1 Answers

1
votes

This can happen if your Facebook token expires. Unfortunately, we don't have a way to refresh it, ourselves. To fix it, delete the Facebook channel, then re-add it following these instructions.