Azure / azure-cosmos-dotnet-v2

Contains samples and utilities relating to the Azure Cosmos DB .NET SDK
MIT License
577 stars 838 forks source link

Microsoft.Azure.Documents.BadRequestException: Message: , Windows/10.0.15063 documentdb-netcore-sdk/2.4.1 ---> System.NullReferenceException: Object reference not set to an instance of an object. #737

Open njumazhen opened 5 years ago

njumazhen commented 5 years ago

Describe the bug

After upgrade to the documentdb-netcore-sdk to 2.4.1, I got the below error. The code works well at the documentdb-dotnet version 2. Could you guild me what is wrong here and how to resolve this? Thanks!

The collection is non-partition collection and the error is thrown at IDocumentQuery.ExecuteNextAsync()... The query is just simple: {{"query":"SELECT VALUE root FROM root WHERE ((root[\"aux\"][\"PartnerId\"] = \"necj79ij4hfc\") AND (false OR (root[\"aux\"][\"UniqueDocumentPrefix\"] = \"jarvis\"))) "}}

Microsoft.Azure.Documents.BadRequestException: Message: , Windows/10.0.15063 documentdb-netcore-sdk/2.4.1 ---> System.NullReferenceException: Object reference not set to an instance of an object.\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Azure.Documents.Query.QueryPartitionProvider.GetPartitionedQueryExecutionInfoInternal(SqlQuerySpec querySpec, PartitionKeyDefinition partitionKeyDefinition, Boolean requireFormattableOrderByQuery, Boolean isContinuationExpected, Boolean allowNonValueAggregateQuery)\r\n at Microsoft.Azure.Documents.Routing.PartitionRoutingHelper.GetProvidedPartitionKeyRanges(SqlQuerySpec querySpec, Boolean enableCrossPartitionQuery, Boolean parallelizeCrossPartitionQuery, Boolean isContinuationExpected, PartitionKeyDefinition partitionKeyDefinition, QueryPartitionProvider queryPartitionProvider, String clientApiVersion, QueryInfo& queryInfo)\r\n at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.d13.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Microsoft.Azure.Documents.Query.DefaultDocumentQueryExecutionContext.d9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at ....

image

0if commented 4 years ago

Bump, I am also experiencing this issue

Skubakoob commented 4 years ago

Did you work this one out? For me, it was working... and then it was not

0if commented 4 years ago

I was able to resolve this by downgrading the version of documentdb-netcore-sdk