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

6
  • 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, 2019 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? Oct 24, 2019 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, 2019 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, 2019 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. Oct 25, 2019 at 15:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.