Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upon calling ExecuteNextAsync in v1.14.0 in Azure App Services #259

Closed
hghansen opened this issue May 15, 2017 · 15 comments
Closed

Error upon calling ExecuteNextAsync in v1.14.0 in Azure App Services #259

hghansen opened this issue May 15, 2017 · 15 comments

Comments

@hghansen
Copy link

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

@jkonecki
Copy link

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

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

@jkonecki
Copy link

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.

@hghansen
Copy link
Author

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

@vip32
Copy link

vip32 commented May 18, 2017

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

@kieronlanning
Copy link

Me too.

@kieronlanning
Copy link

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.

@jkonecki
Copy link

jkonecki commented May 20, 2017 via email

@arramac
Copy link
Contributor

arramac commented May 21, 2017

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.

@jkonecki
Copy link

jkonecki commented May 21, 2017 via email

@arramac
Copy link
Contributor

arramac commented May 21, 2017

https://twitter.com/AzureCosmosDB/status/866341263955550208

@arramac
Copy link
Contributor

arramac commented May 24, 2017

@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.

@codecadwallader
Copy link

codecadwallader commented May 24, 2017

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.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.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.

@jkonecki
Copy link

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

@arramac
Copy link
Contributor

arramac commented May 24, 2017

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

@arramac
Copy link
Contributor

arramac commented May 24, 2017

@codecadwallader #267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants