microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
869 stars 372 forks source link

Microsoft Teams no longer working with QnAMaker #9355

Closed rmgitting closed 2 years ago

rmgitting commented 2 years ago

Describe the bug

Hello, we are encountering a very weird thing happening on Microsoft Teams while working with the QnA Maker. We had a bot developed for a client. It was working fine this morning, nothing really changed. Other than an update to the different libraries used. The versions of the libraries are shown below: image We are using .NET 3.1 Then it started behaving weird when it comes to QnAMaker prompts. The last prompt, always gives this error: image As you can see when you click on the prompt, it gives: Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.Int64'. This problem only occurs on Teams, on other channels such as web chat or emulator, it doesn't happen. And on teams if you write the question yourself, then it will be fine, but if you click on the button it gives this error.

Then what we did is that we created a completely new bot, there is literally nothing in it other than a QnA Maker, as shown below: image So really nothing is there. And we published this bot, and again the same thing happened. On teams, it is showing this weird error, on other channels, it is not. We are testing on Teams through the link in the Azure portal, and it is not an option to create a teams app and link it to the bot at this stage, because the bot is deployed on a different tenant (client's tenant), and we are testing on our teams for now. But my concern is that we always used to work this way, and even this morning, it was working just fine. The QnAMaker was working as expected in Teams. So I don't know what changed, especially that we created a completely new project with only QnA.

Version

The version of the composer is v2.1.2 and I put the versions of the libraries above.

OS

We are deploying to an Azure App Service (I believe it is Windows)

To Reproduce

Just create a simple knowledge base on qnamaker.ai and create some questions with prompts. On the composer, only create a chatbot with QnAMaker dialog in the unknown intent, we dind't really do anything else. We deployed to Azure, and we used the Teams link in the channels to test. Again, we always do it like that, and it was working just this morning.

Expected behavior

To just go with the flow and execute the QnA Maker prompts naturally.

Additional context

I checked old bots that we have deployed a couple of days ago (on Teams), they are still working fine, now I am afraid if I publish again the QnAMaker will do the same on Teams.

Also there is this message that started appearing after pressing the QnAMaker buttons: "You response was sent to the app". as shown below: image

this was not the case, and this is not the case in the other bots deployed a couple of days ago that are still working. They don't show this message, for example: image After clicking the QnA prompt, it just simply shows the right answer.

I am not sure if it is something related to us, or something twisted happened with Microsoft Teams.

Note: we tried to connect to other qnamaker KBs and also publish to other App Services, but it still gave the same error.

Appreciate your responses.

stevkan commented 2 years ago

@rmgitting - Thank you for reporting this. A couple questions:

rmgitting commented 2 years ago

@rmgitting - Thank you for reporting this. A couple questions:

  • If you downgrade the BotBuilder packages to a previous build, does the error then go away?
  • Do you specifically use Newtonsoft.Json in your project? If so, can you try aligning the version you use with the version used in the BotFramework SDK?

Thanks for your reply. I created a new project with only qnamaker dialog in the unkonw intent and I downgraded the libraries in it from 4.17.1 to 4.13.4 as shown here: image So basically I downgraded three libraries: bot.builder.AI.Luis, Bot.Builder.AI.QnA, and Bot.Builder.Dialogs.Adaptive.Runtime. But the same problem persisted (only on Teams). image

now regarding your second point, I am creating the project in composer, so I am not explicitly touching the code. but I can see this code in the startup.cs using (AddNewtonsoftJson) image but I am not sure what version this is? and what version exists in the SDK, and how to align them. Could you please give me more details about that.

Just to add, here is the above exception logged in Application Insights "assembly":"Microsoft.Bot.Builder.AI.QnA, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.AI.QnA.Dialogs.QnAMakerDialog.ResetOptions","level":0,"line":0} 1 {"assembly":"Microsoft.Bot.Builder.AI.QnA, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.AI.QnA.Dialogs.QnAMakerDialog+d91.MoveNext","level":1,"line":0} 2 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":2,"line":0} 3 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":3,"line":0} 4 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":4,"line":0} 5 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult","level":5,"line":0} 6 {"assembly":"Microsoft.Bot.Builder.Dialogs, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Dialog+d18.MoveNext","level":6,"line":0} 7 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":7,"line":0} 8 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":8,"line":0} 9 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":9,"line":0} 10 {"assembly":"Microsoft.Bot.Builder.Dialogs, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.DialogContext+d41.MoveNext","level":10,"line":0} 11 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":11,"line":0} 12 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":12,"line":0} 13 {"assembly":"Microsoft.Bot.Builder.Dialogs, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.DialogExtensions+d1.MoveNext","level":13,"line":0} 14 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":14,"line":0} 15 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":15,"line":0} 16 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":16,"line":0} 17 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult","level":17,"line":0} 18 {"assembly":"Microsoft.Bot.Builder.Dialogs, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.DialogExtensions+d0.MoveNext","level":18,"line":0} 19 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":19,"line":0} 20 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":20,"line":0} 21 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":21,"line":0} 22 {"assembly":"Microsoft.Bot.Builder.Dialogs.Adaptive, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialogBot+d17.MoveNext","level":22,"line":0} 23 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":23,"line":0} 24 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":24,"line":0} 25 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":25,"line":0} 26 {"assembly":"Microsoft.Bot.Builder, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.SetSpeakMiddleware+d3.MoveNext","level":26,"line":0} 27 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":27,"line":0} 28 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":28,"line":0} 29 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":29,"line":0} 30 {"assembly":"Microsoft.Bot.Builder, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.TelemetryLoggerMiddleware+d7.MoveNext","level":30,"line":0} 31 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":31,"line":0} 32 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":32,"line":0} 33 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":33,"line":0} 34 {"assembly":"Microsoft.Bot.Builder.Integration.ApplicationInsights.Core, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Integration.ApplicationInsights.Core.TelemetryInitializerMiddleware+d4.MoveNext","level":34,"line":0} 35 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":35,"line":0} 36 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":36,"line":0} 37 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":37,"line":0} 38 {"assembly":"Microsoft.Bot.Builder, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.MiddlewareSet+d3.MoveNext","level":38,"line":0} 39 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw","level":39,"line":0} 40 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":40,"line":0} 41 {"assembly":"System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":41,"line":0} 42 {"assembly":"Microsoft.Bot.Builder, Version=4.17.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.BotAdapter+d__23.MoveNext","level":42,"line":0}

There still mentions of 4.17.1 (even though I thought I downgraded), and this system.private.corelib is at version 4

@stevkan your inputs are appreciated

rmgitting commented 2 years ago

I downgraded the libraries used, but I upgraded the newtonsoft libraries, and then I deleted the release bin and regenerated it. and It worked, but overall it is a confusing experience unfortunately.

Users588 commented 1 year ago

I downgraded the libraries used, but I upgraded the newtonsoft libraries, and then I deleted the release bin and regenerated it. and It worked, but overall it is a confusing experience unfortunately.

Hi @rmgitting, we are facing the same issue. We have downgraded the libraries to version 4.13.4, as a lower version is not available.

Unfortunately we do not know how to regnerate the bin folder after deleting it.

Could you explain how to proceed?

Thanks!