I am trying to upload around 1400 json data to cosmos db using @azure/cosmos@3.13.0 package but i am getting timeout error for some records what could be causing it?

Ankush 1 Reputation point
2021-08-16T11:20:49.213+00:00
  1. Throughput (RU/s):- 400
  2. Error details :- TimeoutError
    at httpRequest (C:\Users\ankush.a.singhal\Desktop\project\phase1\angularcsvJsonTool\backend\csvtocosmosdb\node_modules\@azure\cosmos\dist\index.js:7732:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async execute (C:\Users\ankush.a.singhal\Desktop\project\phase1\angularcsvJsonTool\backend\csvtocosmosdb\node_modules\@azure\cosmos\dist\index.js:7582:26)
    at async ClientContext.create (C:\Users\ankush.a.singhal\Desktop\project\phase1\angularcsvJsonTool\backend\csvtocosmosdb\node_modules\@azure\cosmos\dist\index.js:8244:30)
    at async Items.create (C:\Users\ankush.a.singhal\Desktop\project\phase1\angularcsvJsonTool\backend\csvtocosmosdb\node_modules\@azure\cosmos\dist\index.js:5355:26) {
    code: 'TimeoutError',
    headers: {
    'x-ms-throttle-retry-count': 0,
    'x-ms-throttle-retry-wait-time-ms': 0
    }
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,440 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,316 Reputation points
    2021-08-16T15:26:54.56+00:00

    @Ankush Welcome to Microsoft Q&A forums.

    Seems like you are running into throttling issues because you provisioned for 400RU's only.
    You are performing more operations than the container can accommodate within the provisioned capacity.

    Either increase the throughput on your Cosmos container or upload the records in small batches with delay of a few seconds between each batch.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.
    And if you have further questions or issues, please let us know.