question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] LUIS Authoring adding example throws exception

See original GitHub issue

Describe the bug The adding example operation Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Examples.AddWithHttpMessagesAsync method throws Microsoft.Rest.SerializationException exception. With message:

Unable to deserialize the response.
JSON integer 2148095092 is too large or small for an Int32. Path 'ExampleId', line 1, position 23.

Seems like an issue with response deserialization to LabelExampleResponse class, caused by the type of ExampleId property. The actual response content is:

{"ExampleId":2148095092,"UtteranceText":"test example"}

The ExampleId value 2148095092 > 2147483647 (Int32.MaxValue)

Expected behavior Executes successfully.

Actual behavior (include Exception or Stack Trace)

Microsoft.Rest.SerializationException
Unable to deserialize the response.
JSON integer 2148095092 is too large or small for an Int32. Path 'ExampleId', line 1, position 23

   at Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Examples.<AddWithHttpMessagesAsync>d__5.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.ExamplesExtensions.<AddAsync>d__0.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at LuisApplicationSettingsBug.Program.<Main>d__1.MoveNext() in 

To Reproduce

var luisAppId = new Guid("590e74a6-4bb4-4729-8c78-7c53d7068750");
const string intentName = "B5578F30-59AA-4801-9A27-C73BB3C1C4FE";
const string versionId = "8.Rc";
using (var localClient = CreateClient(localApiKey))
{
    var example = new ExampleLabelObject("test example", null, intentName
    try
    {
        var exampleResult = await localClient.Examples.AddAsync(luisAppId, versionId, example);
    }
    catch (Exception ex)
    {
        Console.Error.WriteLine(ex.Message);
        throw;
    }
}

Environment:

  • LUIS region: WestUS
  • Name and version of the Library package used: Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring 3.2.0-preview.3 reproduces also on versions: 3.1.0, 2.0.0
  • Hosting platform or OS and .NET runtime version: 5.0.102
  • IDE and version: Visual Studio 2019

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
plantycommented, Apr 19, 2022

What is the status of this bug? We have just started to receive the same error this evening, and it was working fine earlier today (5 hours ago). We are using authoring resources in West Europe , and are now receiving the following error when using the Client.Examples.BatchAsync method (Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring v3.1.0):

Microsoft.Rest.SerializationException: Unable to deserialize the response.
 ---> Newtonsoft.Json.JsonReaderException: JSON integer 2147569261 is too large or small for an Int32. Path '[0].value.ExampleId', line 1, position 33.

We have 3 environments, all authoring resources are in West Europe, and all 3 are failing - this is causing an issue for our live production software.

We have been using LUIS for the past few years, why would we have only started seeing this bug today?

2reactions
cahanncommented, Jan 22, 2021

Issue detected and planned to be fixed in a couple of weeks, will update the issue with the exact ETA 1st week of Feb.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LUIS response throws error with Bad Request
The LUIS query works great in a browser, but when invoked through code, the response from LUIS GetResult throws an error.
Read more >
How to update your LUIS model using the REST API
Add an authoring resource to the Pizza app. Select MANAGE. Select Azure Resources. Select Authoring Resource. Select Change authoring resource.
Read more >
LUIS Programmatic APIs v3.0-preview - Cognitive Services
This error can be returned if the request's parameters are incorrect meaning the required parameters are missing, malformed, or too large. This error...
Read more >
com.microsoft.azure.cognitiveservices.language.luis. ...
This package contains the models classes for LUISAuthoringClient. ... Response when adding a batch of labeled example utterances. BatchOptionalParameter.
Read more >
Error handler package
Use the Throw action in the Error handler package to create an error condition, which will immediately shift the bot execution to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found