1

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.trafficmanagerissue. Somehow the "canceled" action showed up randomly. Not sure about what is the cause. Is this related to MS Teams?

enter image description here

JenniLync11
  • 147
  • 1
  • 9
  • Can you specify on which channel are you getting this error? Also, can you check your App Service configuration on Azure to see if the Web Sockets is turned On or Off? – ranusharao Oct 22 '19 at 21:48
  • This issue is gone now but have a new one. ```smba.trafficmanager.net``` ```POST/amer/v3/conversations/xxxx``` cancelled. Is this normal? – JenniLync11 Oct 24 '19 at 15:31
  • when do you encounter this issue?If you post a screenshot of the complete error, that would be helpful. – ranusharao Oct 24 '19 at 17:09
  • Could you please elaborate more on what you are exactly trying to do(which channel and what activity) and when do you get this error? Are you trying to do some specific activity on Teams? – ranusharao Oct 24 '19 at 23:09
  • The issue occurs during conversations between users and our bot through MS teams. It is quite random and it works sometime and sometimes it doesn't. – JenniLync11 Oct 25 '19 at 15:52
  • did you run it locally and see if you were getting the same error? Can you share your botHandle? – ranusharao Oct 28 '19 at 17:26

0 Answers0