Gokul_NorthStar
Gokul_NorthStar

Reputation: 51

LUIS Exception : Operation returned an invalid status code 'Forbidden'

Getting an error like this. Earlier it was sometime only. Now, even for simple 'hi' it is giving me this exception.

Please help.

Exception caught : Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'




=============================
 Exception caught : Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'
         at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Prediction.ResolveWithHttpMessagesAsync(String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, Dictionary`2 customHeaders, CancellationToken cancellationToken)
         at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.PredictionExtensions.ResolveAsync(IPrediction operations, String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, CancellationToken cancellationToken)
         at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeInternalAsync(ITurnContext turnContext, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 413
         at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeAsync(ITurnContext turnContext, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 104
         at Microsoft.BotBuilderSamples.BasicBot.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in C:\Users\Gokul.Gopinath\Desktop\A-BI\GokulAssistanceEngine-src\BasicBot.cs:line 115
         at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\MiddlewareSet.cs:line 55
         at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\BotAdapter.cs:line 167

Upvotes: 0

Views: 2422

Answers (1)

Sebastian Zolg
Sebastian Zolg

Reputation: 1961

Even though the initial question does not follow mcve, there are two common pitfalls related to 403 when working with LUIS.

Wrong or no authoring/subscription key

When working with samples from the web using LUIS, you have to provide the subscription and authoring key from your LUIS app. In the most recent bot builder samples, it is usually located in the *.bot file as shown here.

The concept of authoring keys and queries is described in the official documentation.

403 Out of call volume quota

You reached the quota limit of the LUIS starter key. In order to solve this permanently, follow my guidance here.

Upvotes: 3

Related Questions