cosmos db DataIntegrityViolationException BulkWriteError{index=0, code=2, message='Error=2, Details='Response status code does not indicate success: BadRequest (400);

Nitin Gupta 1 Reputation point
2021-06-11T20:25:59.79+00:00

We are getting this error intermittently while doing bulk upsert in Cosmos db though we have created compound index on collection fields which we are using in criteria to insert records. Below is the error details -

2021-06-11 16:31:38,213 org.springframework.dao.DataIntegrityViolationException: Bulk write operation error on server <mongodb>:10255. Write errors: [BulkWriteError{index=0, code=2, message='Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 88b8b7e2-4046-4ed2-8782-cf30fcc8810b; Reason: (Failed to parse the value 'dbs/osim/colls/collectionname' as ResourceId.

As per doumentation it is due to indexes on sort query but in our case we are not using sort query -

https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb-troubleshoot

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,693 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Narayangaonkar, Prashant 1 Reputation point
    2021-09-06T08:12:05.94+00:00

    I am also getting same issue on bulk upsert of the cosmosdb
    Let me know @Oury Ba-MSFT if you have solution


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.