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] Exception retrieving examples from LUIS with Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.LUISAuthoringClient

See original GitHub issue

Description Hi, Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.LUISAuthoringClient.Examples.ListAsync fails when try to retrieve data

Expected behavior should retrieve the list of examples

Actual behavior (include Exception or Stack Trace) When I try to get the list of LUIS examples, it throws an exception wher indicates that the id it tries to return is greater than int32, when checking the LabeledUtterance and LabelExampleResponse class I see that the id is indeed an int32? on the image can see that try ot cast 5259086643 as Int32 and throws the exception

imagen

System.AggregateException HResult=0x80131500 Mensaje = One or more errors occurred. (Unable to deserialize the response.) Origen = System.Private.CoreLib Seguimiento de la pila: en System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) en System.Threading.Tasks.Task1.get_Result() en LuisConsole.Program.Main(String[] args) en C:\Users\ddurano\source\repos\ConsoleApp2\LuisConsole\Program.cs: línea 30

Esta excepción se generó originalmente en esta pila de llamadas: [Código externo]

Excepción interna 1: SerializationException: Unable to deserialize the response.

Excepción interna 2: JsonReaderException: JSON integer 5259086643 is too large or small for an Int32. Path ‘[0].id’, line 1, position 17.

imagen

imagen

What is the actual behavior?

To Reproduce

imagen

Environment:

  • Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring [3.1.0]
  • Windows 10 [.NET 5.0]
  • IDE and version : [Microsoft Visual Studio Community 2022 Preview ]

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
agentschmittcommented, Apr 30, 2022

Hi @asturm0 i dont know the exactly command i used but i was able to build it Ehen running Autorest in legacy Mode so it uses c# Client 2 instead of 3. I have an fork of the SDK too with the updated Client. https://github.com/SamhammerAG/azure-sdk-for-net/commit/718cce652600c455599ba9c73e3ebbbc48325fca Hope that helps you. I was able to build a nuget package from this one and used that until we geht a fix.

1reaction
agentschmittcommented, Apr 20, 2022

I have the issue with integer overflow in LabelUtterance too on a production system.

I tried also with latest preview version 3.2.0-preview4, but it only has fix for LabelExampleResponse which fixes adding. see https://github.com/Azure/azure-sdk-for-net/issues/18041#issuecomment-765668823

But i really need a fix for the get api to receive the LabelUtterance. I found there was a PR to fix it, but there was no reaction on it and was closed. see https://github.com/Azure/azure-sdk-for-net/pull/24456 @MahmoudYounes @cahann Can you maybe have a look at that?

Stacktrace:

Microsoft.Rest.SerializationException: Unable to deserialize the response.
 ---> Newtonsoft.Json.JsonReaderException: JSON integer 2149417471 is too large or small for an Int32. Path '[0].id', line 1, position 17.
   at Newtonsoft.Json.JsonTextReader.ParseReadNumber(ReadType readType, Char firstChar, Int32 initialPosition)
   at Newtonsoft.Json.JsonTextReader.ReadNumberValue(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ReadAsInt32()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
   at Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Examples.ListWithHttpMessagesAsync(Guid appId, String versionId, Nullable`1 skip, Nullable`1 take, Nullable`1 enableNestedChildren, Dictionary`2 customHeaders, CancellationToken cancellationToken)
Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] LUIS Authoring adding example throws exception
Describe the bug The adding example operation Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Examples.
Read more >
Language Understanding (LUIS) SDK client libraries and ...
The Language Understanding (LUIS) authoring client is a LUISAuthoringClient object that authenticates to Azure, which contains your ...
Read more >
Getting Microsoft.Azure.CognitiveServices.Language.LUIS. ...
Getting Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'.
Read more >
azure.cognitiveservices.language.luis.authoring.operations ...
[docs]class AppsOperations(object): """AppsOperations operations. You should not instantiate directly this class, but create a Client instance that will ...
Read more >
How to use the msrest.authentication. ...
This will execute LUIS prediction """ client = LUISRuntimeClient( 'https://westus.api.cognitive.microsoft.com', CognitiveServicesCredentials(subscription_key), ) ...
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