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

Azure cosmos version update to 4.1.0 and above: Entity with the specified id does not exist in the system #32521

Open
6 tasks
sourabh1007 opened this issue Jan 13, 2025 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team.
Milestone

Comments

@sourabh1007
Copy link

sourabh1007 commented Jan 13, 2025

  • Package Name: azure/cosmos

  • Package Version: 4.1.0

  • Operating system: windows

  • nodejs -

    • version: 20
  • browser Chrome

    • name/version:
  • typescript

    • version: N/A
  • Is the bug related to documentation in

Describe the bug
When using cosmos version 4.1.0 and above - updating cosmos entity throws error:

error updating clientDetailsStageDb: Error: Entity with the specified id does not exist in the system. More info: https://aka.ms/cosmosdb-tsg-not-found, {"Summary":{"DirectCalls":{"(404, 0)":1}},"name":"HandleDocumentRequest","id":"64a330d0-e088-4e0d-87d6-38a710c26db4","start time":"09:02:44:895","duration in milliseconds":15.3337,"data":{"Client Side Request Stats":{"Id":"AggregatedClientSideRequestStatistics","ContactedReplicas":[{"Count":1,"Uri":"rntbd://cdb-ms-prod-eastus1-be198.documents.azure.com:14070/apps/0d401a1b-9d8f-4227-afc2-c21d885e7cab/services/a0df8879-ac3c-4c7c-a70f-b2e09c8d447f/partitions/cedf3a82-9b88-4868-ab45-89a3808b6ecf/replicas/133779636034855225p"},{"Count":1,"Uri":"rntbd://cdb-ms-prod-eastus1-be198.documents.azure.com:14068/apps/0d401a1b-9d8f-4227-afc2-c21d885e7cab/services/a0df8879-ac3c-4c7c-a70f-b2e09c8d447f/partitions/cedf3a82-9b88-4868-ab45-89a3808b6ecf/replicas/133808497487430632s"},{"Count":1,"Uri":"rntbd://cdb-ms-prod-eastus1-be198.documents.azure.com:14346/apps/0d401a1b-9d8f-4227-afc2-c21d885e7cab/services/a0df8879-ac3c-4c7c-a70f-b2e09c8d447f/partitions/cedf3a82-9b88-4868-ab45-89a3808b6ecf/replicas/133808836790380076s"},{"Count":1,"Uri":"rntbd://cdb-ms-prod-eastus1-be198.documents.azure.com:14414/apps/0d401a1b-9d8f-4227-afc2-c21d885e7cab/services/a0df8879-ac3c-4c7c-a70f-b2e09c8d447f/partitions/cedf3a82-9b88-4868-ab45-89a3808b6ecf/replicas/133741668972881787s"}],"RegionsContacted":[],"FailedReplicas":[],"AddressResolutionStatistics":[],"StoreResponseStatistics":[{"ResponseTimeUTC":"2025-01-10T21:02:44.9107950Z","ResourceType":"Document","OperationType":"Replace","LocationEndpoint":"[https://api-marketplace-cosmosdb-account-test2-eastus.sql.cosmos.azure.com/","StoreResult":{"ActivityId":"ac3f1a38-5446-41e4-bdf9-8dc26e2b165b","StatusCode":"NotFound","SubStatusCode":"Unknown","LSN":386,"PartitionKeyRangeId":"0","GlobalCommittedLSN":386,"ItemLSN":-1,"UsingLocalLSN":false,"QuorumAckedLSN":386,"SessionToken":"-1#386","CurrentWriteQuorum":3,"CurrentReplicaSetSize":4,"NumberOfReadRegions":0,"IsValid":true,"StorePhysicalAddress":"rntbd://cdb-ms-prod-eastus1-be198.documents.azure.com:14070/apps/0d401a1b-9d8f-4227-afc2-c21d885e7cab/services/a0df8879-ac3c-4c7c-a70f-b2e09c8d447f/partitions/cedf3a82-9b88-4868-ab45-89a3808b6ecf/replicas/133779636034855225p","RequestCharge":1.24,"RetryAfterInMs":null,"BELatencyInMs":"0.5","transportRequestTimeline":{"requestTimeline":[{"event":](https://api-marketplace-cosmosdb-account-test2-eastus.sql.cosmos.azure.com/%22%2c%22StoreResult%22:%7b%22ActivityId%22:%22ac3f1a38-5446-41e4-bdf9-8dc26e2b165b%22%2c%22StatusCode%22:%22NotFound%22%2c%22SubStatusCode%22:%22Unknown%22%2c%22LSN%22:386%2c%22PartitionKeyRangeId%22:%220%22%2c%22GlobalCommittedLSN%22:386%2c%22ItemLSN%22:-1%2c%22UsingLocalLSN%22:false%2c%22QuorumAckedLSN%22:386%2c%22SessionToken%22:%22-1#386%22%2c%22CurrentWriteQuorum%22:3%2c%22CurrentReplicaSetSize%22:4%2c%22NumberOfReadRegions%22:0%2c%22IsValid%22:true%2c%22StorePhysicalAddress%22:%22rntbd://cdb-ms-prod-eastus1-be198.documents.azure.com:14070/apps/0d401a1b-9d8f-4227-afc2-c21d885e7cab/services/a0df8879-ac3c-4c7c-a70f-b2e09c8d447f/partitions/cedf3a82-9b88-4868-ab45-89a3808b6ecf/replicas/133779636034855225p%22%2c%22RequestCharge%22:1.24%2c%22RetryAfterInMs%22:null%2c%22BELatencyInMs%22:%220.5%22%2c%22transportRequestTimeline%22:%7b%22requestTimeline%22:%5b%7b%22event%22:) "Created", "startTimeUtc": "2025-01-10T21:02:44.8955812Z", "durationInMs": 0.0027},{"event": "ChannelAcquisitionStarted", "startTimeUtc": "2025-01-10T21:02:44.8955839Z", "durationInMs": 13.885},{"event": "Pipelined", "startTimeUtc": "2025-01-10T21:02:44.9094689Z", "durationInMs": 0.0674},{"event": "Transit Time", "startTimeUtc": "2025-01-10T21:02:44.9095363Z", "durationInMs": 1.2018},{"event": "Received", "startTimeUtc": "2025-01-10T21:02:44.9107381Z", "durationInMs": 0.042},{"event": "Completed", "startTimeUtc": "2025-01-10T21:02:44.9107801Z", "durationInMs": 0}],"serviceEndpointStats":{"inflightRequests":1,"openConnections":1},"connectionStats":{"waitforConnectionInit":"True","callsPendingReceive":0,"lastSendAttempt":"2025-01-10T21:02:44.9085573Z","lastSend":"2025-01-10T21:02:44.9085882Z","lastReceive":"2025-01-10T21:02:44.9091328Z"},"requestSizeInBytes":1410,"requestBodySizeInBytes":825,"responseMetadataSizeInBytes":184,"responseBodySizeInBytes":84},"TransportException":null}}]}}}, Windows/10.0.20348 cosmos-netstandard-sdk/3.18.0
2025-01-10T21:02:44.909 [Information] Document undefined
2025-01-10T21:02:44.909 [Information] clientData: undefined
2025-01-10T21:02:44.909 [Information] Executed 'Functions.upsertSecretKey' (Succeeded, Id=66468dfd-caf3-4a02-bf16-ac4b7f04d5c6, Duration=107ms)

Updating existing record for a field with this code:

const { resource: updatedItem } = await clientContainer
                    .item(clientItems[0].id)
                    .replace(clientItems[0]);

To Reproduce

  1. Works with v4.0.0
  2. upgrade to 4.1.0 or above
  3. update any cosmos document

Expected behavior
Should update the existing record without errors

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
none

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Cosmos needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. labels Jan 13, 2025
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sajeetharan @simorenoh.

@ujjwalsoni1707
Copy link
Member

ujjwalsoni1707 commented Jan 15, 2025

Hi @sourabh1007 . Actually this is the expected behavior. You need to pass both id and partition key value while calling the replace method.

Let us say partition key is ["/category"]

const item = { id: "1", category: "category-1", age: 25 };  

const {resource:readItem} = container.item("1", "category-1").read();

item.age = 30;
const {resource:replaceItem} = container.item("1", "category-1").replace(item);
const {resource:deleteItem} = container.item("1", "category-1").delete();

If you pass both the id and partition key value, it works fine.

Passing only the id works when we have a non partitioned container. Like if we dont specify the partition key value while creating the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team.
Projects
Status: Ready to start
Development

No branches or pull requests

3 participants