Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.Bot.Builder - sporadic error - "Operation returned an invalid status code 'Unauthorized'"

Tags:

I'm developing a chatbot using Microsoft.Bot.Builder v3.15.2.2, QnA Maker (preview mode, aka 'old') and QnAMakerDialog (from Microsoft.Bot.Builder.CognitiveServices v1.1.7). I'm using Direct API as a channel and BotFramework-WebChat to embed my chatbox in a web page. I've also implemented a custom bot data store to persist the bot's state.

From time to time (I cannot establish a pattern), during a conversation with the bot, I receive the following error:

Microsoft.Bot.Connector.ErrorResponseException: Operation returned an invalid status code 
'Unauthorized' at Microsoft.Bot.Connector.Conversations.
<ReplyToActivityWithHttpMessagesAsync>d__9.MoveNext() --- End of stack trace from previous 
location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.
ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.
HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Connector.
ConversationsExtensions.<ReplyToActivityAsync>d__9.MoveNext() --- End of stack trace from 
previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.
TaskAwaiter`1.GetResult() at UCB.ChatBot.Bot.Controllers.MessagesController.<Post>d__3.
MoveNext() in [...]Bot\Controllers\MessagesController.cs:line 39

After this error shows up, the bot keeps replying 'Sorry! Not able to match any of the options.' or, keeps giving you an answer to a question asked way before, in the beginning of the conversation. A Ctrl + F5 fixes this issue and the bot returns to the expected behavior.

This happens sporadically - as I said, I cannot establish a pattern or reproduce it. Maybe once or twice a day or a week.

Any thoughts or hints are very welcomed.

like image 403
Diana Avatar asked Jun 05 '18 13:06

Diana


1 Answers

We have released a new package 3.15.2.3 that we believe addresses this issue. Please let us know if you are still experiencing this issue after upgrading by commenting in this GitHub issue on the botbuilder repository

like image 126
D4RKCIDE Avatar answered Sep 28 '22 19:09

D4RKCIDE