question

Ankush-8045 avatar image
0 Votes"
Ankush-8045 asked 72553118 answered

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?

  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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered KalyanChanumolu-MSFT edited

@Ankush-8045 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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

hi when i am trying to upload around 300 JSON data still the timeout error is coming @KalyanChanumolu-MSFT

0 Votes 0 ·

Did you add a delay between the batches?
Please shorten the batch size to 50 and try.

0 Votes 0 ·