BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

Rootbot throw "Error invoking the skill id: \"\" at \"http://localhost:3980/api/messages\" (status is 500)" when it return from skill

Open Seungchul-de opened this issue 2 years ago • 5 comments

Describe the bug

Rootbot invoke skill with input text, and Skill QnA Intent recognized is triggered and answer on question and end dialog

But after it returns to Rootbot, in the next dialog of Rootbot crashed with following error

Error invoking the skill id: "" at "http://localhost:3980/api/messages" (status is 500). \r\n Microsoft.Bot.Schema.ErrorResponseException: Operation returned an invalid status code 'InternalServerError'\n at Microsoft.Bot.Connector.Conversations.ReplyToActivityWithHttpMessagesAsync(String conversationId, String activityId, Activity activity, Dictionary2 customHeaders, CancellationToken cancellationToken)\n at Microsoft.Bot.Connector.ConversationsExtensions.ReplyToActivityAsync(IConversations operations, String conversationId, String activityId, Activity activity, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.CloudAdapterBase.SendActivitiesAsync(ITurnContext turnContext, Activity[] activities, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.TurnContext.<>c__DisplayClass31_0.<<SendActivitiesAsync>g__SendActivitiesThroughAdapter|1>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at Microsoft.Bot.Builder.SetSpeakMiddleware.<>c__DisplayClass3_0.<<OnTurnAsync>b__0>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at Microsoft.Bot.Builder.TurnContext.SendActivityAsync(IActivity activity, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.TurnContext.SendActivityAsync(String textReplyToSend, String speak, String inputHint, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime.CoreBotAdapter.<.ctor>b__0_0(ITurnContext turnContext, Exception exception)\n at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.CloudAdapterBase.ProcessActivityAsync(AuthenticateRequestResult authenticateRequestResult, Activity activity, BotCallbackHandler callback, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.CloudAdapterBase.ProcessActivityAsync(String authHeader, Activity activity, BotCallbackHandler callback, CancellationToken cancellationToken)\n at Microsoft.Bot.Builder.Integration.AspNet.Core.CloudAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken)\n at faq_bot_skill.Controllers.BotController.PostAsync(String route) in /home/seungchul/work/B2B repo/azure-bot/bahn-info-bot-framework/faq_bot_skill/Controllers/BotController.cs:line 67\n at lambda_method(Closure , Object )\n at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)\n\nHEADERS\n=======\nConnection: close\nContent-Type: application/json\nAccept: application/json\nHost: localhost:3980\nUser-Agent: Microsoft-BotFramework/3.1 botframework-connector/4.16.0 ms-rest-js/1.9.1 Node/v16.8.0 OS/(x64-Linux-5.4.0-120-generic)\nContent-Length: 958\nx-ms-conversation-id: 55c2f00f-91f8-45e9-9405-19613db5d606\

Version

image

Browser

  • [ ] Electron distribution
  • [ X ] Chrome
  • [ ] Safari
  • [ ] Firefox
  • [ ] Edge

OS

  • [ ] macOS
  • [ ] Windows
  • [ X ] Ubuntu

To Reproduce

Steps to reproduce the behavior:

as described above

  1. call skill image

  2. skill response and directly end of dialog image

  3. Continue conversation in Rootbot

Expected behavior

No error

Screenshots

given in each steps

Additional context

I believe this is same issue rasied in here : https://github.com/microsoft/BotFramework-Composer/issues/8891 and same work-around that set confirmation in skill, solve the issue as well. (but our use-case is broken).

but answer in above issue was concluded like it happen in 3 bot case and one bot is used skill and also skill consumer, but it is not in my case, it happen only with rootBot and skillBot without additional 3rd bot. So I need clarification on this issue or hope to get work around. I think this is more generic issue.

Seungchul-de avatar Jun 24 '22 07:06 Seungchul-de

Hi @Seungchul-de If you do not have 3 bots (root->skill1->skill2), then this is not the same issue as 8891.

  • Does this still reproduce if you remove the Repeat this Dialog action?
  • This is with a local running root bot and skill, correct? Not deployed to Azure/cloud.

dmvtech avatar Jun 27 '22 23:06 dmvtech

Hi @dmvtech 1) yes 2) yes.

Seungchul-de avatar Jun 28 '22 06:06 Seungchul-de

@dmvtech for your reproduce, I create a sample here, issue.zip

you can reproduce issue as following image Thanks

Seungchul-de avatar Jun 28 '22 10:06 Seungchul-de

I have isolated the issue in that this happens with a Node runtime root bot and a C# skill. Will continue to investigate.

dmvtech avatar Jul 06 '22 22:07 dmvtech

I am testing some other scenarios and will update shortly.

dmvtech avatar Jul 19 '22 17:07 dmvtech

@tracyboehrer I did not get this with a dotnet root bot and a node skill.

dmvtech avatar Aug 17 '22 16:08 dmvtech

Hello @ceciliaavila do you have any update on this issue?

axelsrz avatar Aug 29 '22 18:08 axelsrz

Hello @ceciliaavila do you have any update on this issue?

Hi @axelsrz, we are currently working on this issue. We noticed differences in the conversation states between .NET and JS implementations. We'll let you know as soon as we have more information.

ceciliaavila avatar Aug 29 '22 20:08 ceciliaavila

Hi @axelsrz, this is what we have on this issue: The error happens when a JS root bot connects with a skill that contains only one conversation turn. After coming back from the call, the next action seems to get lost, and the root bot tries to begin the skill again.

We debugged the code, comparing the execution with a .NET root bot, and found a difference in the BeginSkill action's state stored in the dialogOptionsData (in JS, the BeginSkill action is remaining as the active child dialog while in .NET it's the next TextInput action). This difference is causing the conversation state to be saved when it shouldn't, replacing the correct conversation state and causing the issue.

We could use some help to find the reason behind this difference to apply a fix. If you have time we could sync up to figure out how to continue.

As a workaround, we noticed the error doesn't happen when the skill dialog has more than one turn. Adding an input or an EndTurn action to the skill bot will prevent the error.

ceciliaavila avatar Sep 01 '22 15:09 ceciliaavila

@munozemilio Closing as it was corrected by linked PR. Will require SDK release.

ceciliaavila avatar Sep 19 '22 20:09 ceciliaavila