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

GetItemLinqQueryable throwing "Response status code does not indicate success: 400 Substatus: 0 Reason: (Message: {"Errors":["x-ms-documentdb-partitionkey header cannot be specified for this request"]}" #610

Closed
coffeymatt opened this issue Jul 30, 2019 · 2 comments · Fixed by #612
Assignees
Labels
bug Something isn't working

Comments

@coffeymatt
Copy link

coffeymatt commented Jul 30, 2019

Describe the bug

I previously reported an issue here:

#555

Unfortunately it seems the fix that has been merged has not worked and I'm seeing a different error message attempting the same thing. If I try and query for items without where or select conditions, I get an error.

To Reproduce

Rough example code:

var partition = "example";
var options = new QueryRequestOptions
{
         PartitionKey = new PartitionKey(partition)
};

var query = this.container.GetItemLinqQueryable<ExampleObject>(true, requestOptions: options).AsQueryable();

var allObjects = query.ToList();

Expected behavior

I should get a list of Example object.

Actual behavior

It throws an error:

Response status code does not indicate success: 400 Substatus: 0 Reason: (Message: {"Errors":["x-ms-documentdb-partitionkey header cannot be specified for this request"]}ActivityId: 869f5188-a259-494d-a9d6-7604fa4ea5d2, Request URI: /apps/c8568c7b-6923-431d-8862-9f1b9c78f80a/services/b32cfe7c-3cb1-484a-8868-5ca172efeb8e/partitions/d0f00795-e827-422f-a1e0-ca9b93ca4e76/replicas/132079474666377990s/, RequestStats: RequestStartTime: 2019-07-30T13:50:05.3769613Z, RequestEndTime: 2019-07-30T13:50:05.4826153Z, Number of regions attempted: 1ResponseTime: 2019-07-30T13:50:05.4826153Z, StoreResult: StorePhysicalAddress: rntbd://cdb-ms-prod-westeurope1-fd15.documents.azure.com:14026/apps/c8568c7b-6923-431d-8862-9f1b9c78f80a/services/b32cfe7c-3cb1-484a-8868-5ca172efeb8e/partitions/d0f00795-e827-422f-a1e0-ca9b93ca4e76/replicas/132079474666377990s/, LSN: 48373, GlobalCommittedLsn: 48372, PartitionKeyRangeId: , IsValid: True, StatusCode: 400, SubStatusCode: 0, RequestCharge: 0, ItemLSN: -1, SessionToken: -1#48373, UsingLocalLSN: True, TransportException: null, ResourceType: Document, OperationType: ReadFeed, SDK: Windows/10.0.18362 cosmos-netstandard-sdk/3.1.3).

If I user the previous work around, e.g. add 'query.Select(i => i).ToList()' it works fine.

Environment summary
SDK Version: 3.0.1
OS Version Windows 10

Additional context
Related PR:

#561

@j82w j82w self-assigned this Jul 30, 2019
@j82w j82w added the bug Something isn't working label Jul 30, 2019
@j82w
Copy link
Contributor

j82w commented Jul 31, 2019

Hi @coffeymatt ,

I'm sorry I missed this with the other fix. I thought there was test running with read feed and partition key values, but there isn't any test for that scenario. I sent out a PR with the fix and additional tests to make sure this doesn't happen again.

@coffeymatt
Copy link
Author

@j82w No worries, I'm impressed with how quick you guys turn around fixes, thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants