microsoft / botframework-solutions

Welcome to the Bot Framework Solutions repository which is the home for a set of templates and solutions to help build advanced conversational experiences using Azure Bot Service and Bot Framework. Microsoft Bot Framework is a comprehensive framework for building enterprise-grade conversational AI experiences.
https://aka.ms/bfsolutionsdocs
MIT License
1.05k stars 529 forks source link

Unable to connect to Skill from VA #3281

Closed ipraveenMS closed 4 years ago

ipraveenMS commented 4 years ago

What project is affected?

0.8

What language is this in?

c#

What happens?

Get 401 error

What are the steps to reproduce this issue?

Followed all steps to configure VA and template skill starting from https://microsoft.github.io/botframework-solutions/virtual-assistant/tutorials/create-assistant/csharp/1-intro/. Get 401 error while calling sample dialog I already checked issue https://microsoft.github.io/botframework-solutions/help/known-issues/#http-401-error-when-invoking-a-skill and ensured settings are correct.

What were you expecting to happen?

Success

Can you share any logs, error output, etc.?

text: "Exception Message: Error invoking the skill id: "IcmSkill" at "https://icmskillprachand2-sdiz5at.azurewebsites.net/api/messages" (status is 401). , Stack: at Microsoft.Bot.Solutions.Skills.SkillDialog.SendToSkillAsync(DialogContext dc, Activity activity, CancellationToken cancellationToken) at Microsoft.Bot.Solutions.Skills.SkillDialog.BeginDialogAsync(DialogContext dc, Object options, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken) at VirtualAssistant.Dialogs.MainDialog.RouteStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) in C:\Users\prachand\source\repos\VirtualAssistant\VirtualAssistant\VirtualAssistant\Dialogs\MainDialog.cs:line 329 at Microsoft.Bot.Builder.Dialogs.WaterfallDialog.OnStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.WaterfallDialog.RunStepAsync(DialogContext dc, Int32 index, DialogReason reason, Object result, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.WaterfallDialog.ResumeDialogAsync(DialogContext dc, DialogReason reason, Object result, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.DialogContext.EndDialogAsync(Object result, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.Prompt1.ContinueDialogAsync(DialogContext dc, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.DialogContext.ContinueDialogAsync(CancellationToken cancellationToken) at VirtualAssistant.Dialogs.MainDialog.OnContinueDialogAsync(DialogContext innerDc, CancellationToken cancellationToken) in C:\Users\prachand\source\repos\VirtualAssistant\VirtualAssistant\VirtualAssistant\Dialogs\MainDialog.cs:line 160 at Microsoft.Bot.Builder.Dialogs.ComponentDialog.ContinueDialogAsync(DialogContext outerDc, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.DialogContext.ContinueDialogAsync(CancellationToken cancellationToken) at Microsoft.Bot.Builder.Dialogs.DialogExtensions.RunAsync(Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor1 accessor, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Teams.TeamsActivityHandler.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) at VirtualAssistant.Bots.DefaultActivityHandler`1.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in C:\Users\prachand\source\repos\VirtualAssistant\VirtualAssistant\VirtualAssistant\Bots\DefaultActivityHandler.cs:line 41 at Microsoft.Bot.Solutions.Feedback.FeedbackMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken) at Microsoft.Bot.Solutions.Middleware.EventDebuggerMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) at Microsoft.Bot.Solutions.Middleware.SetLocaleMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken) at Microsoft.Bot.Builder.ShowTypingMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) at Microsoft.Bot.Builder.TranscriptLoggerMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate nextTurn, CancellationToken cancellationToken) at Microsoft.Bot.Builder.TelemetryLoggerMiddleware.OnTurnAsync(ITurnContext context, NextDelegate nextTurn, CancellationToken cancellationToken) at Microsoft.Bot.Builder.Integration.ApplicationInsights.Core.TelemetryInitializerMiddleware.OnTurnAsync(ITurnContext context, NextDelegate nextTurn, CancellationToken cancellationToken) at Microsoft.Bot.Builder.BotFrameworkAdapter.TenantIdWorkaroundForTeamsMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)"

Any screenshots or additional context?

pavolum commented 4 years ago

@ipraveenMS looking into this now :)

ipraveenMS commented 4 years ago

Thanks! BTW before this, I hit the issue https://github.com/microsoft/botframework-solutions/issues/3271 so worked around that by setting the manifest version manually in the local manifest-1.1.json and cloud manifest1-1.json to be able to register the skill with VA. I also set the SkillHostEndpoint endpoint in appsettings.json of VA with the ngrok url (500 error in FAQ)

pavolum commented 4 years ago

@ipraveenMS can you ping me through teams so we can get on a screen share and hopefully get this resolved, I think I may know the issue but need to get a better idea of your environment. My alias is the same as my github UN

pavolum commented 4 years ago

This particular issue was resolved by fixing mismatching appIDs. The skills AppId was different then the appID declared for this skill in the VA's appsettings.json BotFrameworkSkills field. @ipraveenMS I will close this issue since it is resolved.

For the other issue you encountered (LUIS models not created correctly for the skill on deploy.ps1), if you encounter that again, please create a new bug report and also shoot me a ping so we can unblock you sooner then later. Thanks!