Azure-cosmos-dotnet-v2: Error upon calling ExecuteNextAsync in v1.14.0 in Azure App Services

Created on 15 May 2017  Â·  15Comments  Â·  Source: Azure/azure-cosmos-dotnet-v2

With the 1.14.0 of Microsoft.Azure.Documents.Client.dll I have been unable to make calls to IDocumentQuery.ExecuteNextAsync after deploying my Web Api to Azure App Services.

When running my Web Api from localhost it works just fine, but not in Azure. Reverting to the 1.13.4 dll fixes the problem.

I've attached what the eventlog says.

Microsoft.Azure.Documents.Client-error.txt

Most helpful comment

I have exactly the same problem when running in Azure Cloud Service:

http://stackoverflow.com/questions/43985540/documentdb-client-1-14-kills-running-process

All 15 comments

I have exactly the same problem when running in Azure Cloud Service:

http://stackoverflow.com/questions/43985540/documentdb-client-1-14-kills-running-process

I've run into another related problem: when running DocumendDB client 1.13.4 against the latest local emulator I get the following exception:

Newtonsoft.Json.JsonReaderException
{"Unexpected character encountered while parsing value: ≻. Path '', line 0, position 0."}
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Microsoft.Azure.Documents.Query.QueryPartitionProvider.GetPartitionedQueryExecutionInfoInternal(SqlQuerySpec querySpec, PartitionKeyDefinition partitionKeyDefinition, Boolean requireFormattableOrderByQuery, Boolean isContinuationExpected)
   at Microsoft.Azure.Documents.Routing.PartitionRoutingHelper.GetProvidedPartitionKeyRanges(SqlQuerySpec querySpec, Boolean enableCrossPartitionQuery, Boolean parallelizeCrossPartitionQuery, Boolean isContinuationExpected, PartitionKeyDefinition partitionKeyDefinition, QueryPartitionProvider queryPartitionProvider, String clientApiVersion, QueryInfo& queryInfo)
   at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.<TryGetTargetPartitionKeyRangeAsync>d__1e.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.<ExecuteOnceAsync>d__a.MoveNext()

Clearly there has been a breaking change in handling partition keys.

I have also seen that JsonReadException (with 1.13.4 client). Also happens when connecting to Cosmos DB in Azure.

happens to me when ddb used inside an azure webjob, locally it runs fine

Me too.

Three days of issues, compounded by the West Europe outage, and going via Premium Support.

We eventually found this.

This is a breaking release - it should be fixed or pulled. At least acknowledged.

I've got a tweet from DocDB team a few days ago stating that they are
"actively looking" into it.

On Sat, 20 May 2017 21:40 Kieron Lanning, notifications@github.com wrote:

Three days of issues, compounded by the West Europe outage, and going via
Premium Support.

We eventually found this.

This is a breaking release - it should be fixed or pulled. At least
acknowledged.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Azure/azure-documentdb-dotnet/issues/259#issuecomment-302897437,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABsWj3J006WCIFFSLMz6A3jyyD_0B0huks5r70-xgaJpZM4NbonB
.

To summarize, we identified a critical issue in the .NET SDK v1.14.0 release on x64 machines that dont support SSE4 instructions. We are working on a patch, but meanwhile please use https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/1.13.4 or earlier. We will post an update when a patch is available.

We have posted an advisory on Twitter.

Could you please include the link to the tweet? I can't find any related
tweet under @DocumentDB handle.

On Sun, 21 May 2017 18:18 Aravind Ramachandran, notifications@github.com
wrote:

To summarize, we identified a critical issue in the .NET SDK v1.14.0
release on x64 machines that dont support SSE4 instructions. We are working
on a patch, but meanwhile please use
https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/1.13.4 or
earlier. We will post an update when a patch is available.

We have posted an advisory on Twitter.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Azure/azure-documentdb-dotnet/issues/259#issuecomment-302950120,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABsWj81Owqfs23wwvjnNDdZFfpq8NXfjks5r8HHvgaJpZM4NbonB
.

@jkonecki and others - can you please test https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/1.14.1

We believe this addresses the issue, but would like to validate that this covers all cases.

This seems to have fixed the original erroring use case (Azure WebJob would fail on first call to database) but I'm seeing a new issue where new logins are failing (Azure Website). I'm debugging and will update this as I know more.. but wanted to put it out quick for anyone else experimenting.

EDIT: I think the original error may be addressed, but I'm seeing errors with JSON serialization through the Azure Website after reading from the database. It seems like the read occurs, but deserialization is failing.

Error parsing boolean value. Path 'queryRanges[0].isMinInclusive', line 1, position 295.
Exception type: Newtonsoft.Json.JsonReaderExceptionFailed method: Newtonsoft.Json.JsonTextReader.ParseTrueProblem Id: Newtonsoft.Json.JsonReaderException at Newtonsoft.Json.JsonTextReader.ParseTrue

I override a few JsonSerializerSettings.. this is unchanged code but in case it's related:

            settings.Formatting = Formatting.Indented;
            settings.NullValueHandling = NullValueHandling.Ignore;

            settings.Converters.Add(new StringEnumConverter());

EDIT 2: Deeper call stack. Note that this is a single partition database that is struggling (multi partition database was fine with v1.14.0)

"Newtonsoft.Json.JsonReaderException: Error parsing boolean value. Path 'queryRanges[0].isMinInclusive', line 1, position 295.
at Newtonsoft.Json.JsonTextReader.ParseTrue()
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.Skip()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetExtensionData(JsonObjectContract contract, JsonProperty member, JsonReader reader, String memberName, Object o)
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.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObjectT
at Microsoft.Azure.Documents.Query.QueryPartitionProvider.GetPartitionedQueryExecutionInfoInternal(SqlQuerySpec querySpec, PartitionKeyDefinition partitionKeyDefinition, Boolean requireFormattableOrderByQuery, Boolean isContinuationExpected)
at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextBase.d__0.MoveNext()

EDIT 3: I have reverted back to v1.13.4 of the SDK for now. I'd be happy to work with you guys to look into this issue and/or split it out into a new issue if desired.

I can confirm te original issue has been solved for me. I haven't experienced the problem reported by @codecadwallader

@codecadwallader let's follow up on a new Github issue for the problem you reported. Closing this one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brokentriangles picture brokentriangles  Â·  8Comments

felschr picture felschr  Â·  5Comments

Lihan-Chen picture Lihan-Chen  Â·  6Comments

ryancole picture ryancole  Â·  6Comments

matthewacme picture matthewacme  Â·  4Comments