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

Cosmos Bulk Delete Response Status {statusCode: -1, requestCharge: 0} #12979

Closed
sergsalo opened this issue Dec 19, 2020 · 7 comments · Fixed by #13143
Closed

Cosmos Bulk Delete Response Status {statusCode: -1, requestCharge: 0} #12979

sergsalo opened this issue Dec 19, 2020 · 7 comments · Fixed by #13143
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@sergsalo
Copy link

@azure/cosmos
3.9.3
NodeJS 12

When Bulk operation is executed next response is returned:

{statusCode: -1, requestCharge: 0}

Expected behavior
successful status code with a body of deleted item

Additional context

My CosmosDB instance doesn't have partitionKey, so I don't pass it.

 await container.items.bulk([{  
        id: docId,
        operationType: "Delete",
}]);

docId sample: 'ad159f73-9368-451a-8765-48ebd7772a1e'

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 19, 2020
@ghost
Copy link

ghost commented Dec 19, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @southpolesteve, @zfoster

@sergsalo
Copy link
Author

const write = await container.items.bulk([
      {
        resourceBody: {
          id: "foo ad159f73-9368-451a-8765-48ebd7772a1e",
          name: "foo",
        },
        operationType: "Upsert",
      },
    ]);
    const read = await container.items.bulk([
      {
        id: "foo ad159f73-9368-451a-8765-48ebd7772a1e",
        operationType: "Read",
      },
    ]);
    const bulkDelete = await container.items.bulk([
      {
        id: "foo ad159f73-9368-451a-8765-48ebd7772a1e",
        operationType: "Delete",
      },
    ]);

write - works
read and delete - return statusCode = -1

@southpolesteve
Copy link
Contributor

Thanks for the detailed repo @sergsalo. We will investigate.

@ramya-rao-a ramya-rao-a added Client This issue points to a problem in the data-plane of the library. Cosmos labels Dec 21, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 21, 2020
@ramya-rao-a ramya-rao-a added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jan 4, 2021
@zfoster
Copy link
Contributor

zfoster commented Jan 11, 2021

We may have a bug in the type here @sergsalo. The read and delete operations should work if you pass partitionKey: {} as an argument. Read/Delete require a partitionKey since we can't extract one without a body present in the args

@zfoster
Copy link
Contributor

zfoster commented Jan 11, 2021

Actually, I just wrote a patch that will default the partitionKey for Read/Delete operations if it's not present

@sergsalo
Copy link
Author

great, do you know when this will be released?

@zfoster
Copy link
Contributor

zfoster commented Jan 12, 2021

@sergsalo within a couple days. For sure by end of the week Friday

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
4 participants