We have chatbot built with MS Virtual Assistant Template(C#) deployed on Azure platform for enterprise uses. We Keep having an issue with startWebsockAsync
in BotController and getting 500 all the time. And the bot would go down randomly during conversations.
After we deployed our chatbot to the Azure platform, we have noticed http 500 from Get Bot/startWebsocketAsync. This happens quite frequently and we could not figure out any reason for this. We put this await _webSocketEnabledHttpAdapter.ProcessAsync(Request, Response, _bot);
in a try block and got the same error all the time.
In addition, our chatbot would go down randomly during conversations with users. Is this related to the error we have on the startWebsocketAsync
?
Here is what the startWebsocketAsync look like inside the botController
[HttpGet]
public async Task StartWebSocketAsync()
{
// Delegate the processing of the Websocket Get request to the adapter.
// The adapter will invoke the bot.
try
{
await _webSocketEnabledHttpAdapter.ProcessAsync(Request, Response, _bot);
}
catch (Exception e)
{
...
...
}
}
}
The error we have on the Get Bot/startWebsocketAsync
System.ArgumentNullException: Value cannot be null.Parameter name: activity
at Microsoft.Bot.Builder.BotFrameworkAdapter.ProcessActivityAsync(String authHeader, Activity activity, BotCallbackHandler callback, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Integration.AspNet.Core.BotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken)
at Microsoft.Bot.Protocol.StreamingExtensions.NetCore.WebSocketEnabledHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken)
at XXBOT.Controllers.BotController.StartWebSocketAsync()
We wonder if how we get rid of the 500 when we talk to the bot. And why our bot suddenly goes down during conversations.
Here is a screenshot from azure portal about the smba.trafficmanager
issue.
Somehow the "canceled" action showed up randomly. Not sure about what is the cause. Is this related to MS Teams?
smba.trafficmanager.net
POST/amer/v3/conversations/xxxx
cancelled. Is this normal?