The answer above is not correct, I think there's a bug in the UI and no one has addressed it...
PartitionKey extracted from document doesn't match the one specified in the header
I created new container and given partition key as zone.
I can't add new item, I am facing following error,
Message: {"Errors":["PartitionKey extracted from document doesn't match the one specified in the header. Learn more: https://aka.ms/CosmosDB/sql/errors/wrong-pk-value"]} ActivityId: 1bd747bb-29de-4067-bab7-45994968e717, Request URI: /apps/c0759384-3173-4bae-9da1-e9adc88a7791/services/3cb63744-5ee3-456c-af65-bb8bece3a0d6/partitions/ea676d97-7ab5-488b-99e6-ed9520b49f8e/replicas/132745797013276843p, RequestStats: RequestStartTime: 2021-08-29T15:37:23.4498781Z, RequestEndTime: 2021-08-29T15:37:23.4598757Z, Number of regions attempted:1 ResponseTime: 2021-08-29T15:37:23.4598757Z, StoreResult: StorePhysicalAddress: rntbd://10.28.95.165:11448/apps/c0759384-3173-4bae-9da1-e9adc88a7791/services/3cb63744-5ee3-456c-af65-bb8bece3a0d6/partitions/ea676d97-7ab5-488b-99e6-ed9520b49f8e/replicas/132745797013276843p, LSN: 19, GlobalCommittedLsn: 19, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 400, SubStatusCode: 1001, RequestCharge: 1.24, ItemLSN: -1, SessionToken: -1#19, UsingLocalLSN: False, TransportException: null, BELatencyMs: 0.486, ActivityId: 1bd747bb-29de-4067-bab7-45994968e717, ResourceType: Document, OperationType: Create , SDK: Microsoft.Azure.Documents.Common/2.14.0
3 answers
Sort by: Most helpful
-
-
Franklin Dilan Maturana Cogollo 5 Reputation points
2023-07-09T20:22:59.1433333+00:00 I have encountered the same issue, and I have discovered that if you enable the 'Automatic' option in indexing, it can cause the addition of certain items to fail. Therefore, I opted to turn off the 'Automatic' option, and it resolved the problem for me
-
Santhosh Kumar Dhanasekaran 1 Reputation point
2021-08-30T07:52:57.15+00:00 @Swathi When creating a new container make sure use use "/" before the key name. For your case, it should be /zone
Hope this helps.