Skip to content

[bug]: Batch creation max retries exceeded #1595

Closed

Description

@jorgealemangonzalez

Description

We are getting the following error when doing a batch creation 1/100 times. ¿Could it be possible that Algolia takes more that 10 seconds to create a single entry in the index?:

Error while executing operation: Error: The maximum number of retries exceeded. (10/10)
    at /workspace/node_modules/@algolia/client-common/src/createIterablePromise.ts:33:27
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Our current code:

const response = await algoliaClient.batch({
        indexName,
        batchWriteParams: {
            requests: ingredients.map(ingredient => ({
                action: 'addObject',
                body: mapIngredientToIndexable(ingredient) as unknown as Record<string, unknown>,
            })),
        },
    })

    await algoliaClient.waitForTask({
        indexName,
        taskID: response.taskID,
        maxRetries: 10,
        timeout: (retryCount: number) => 1000 * retryCount,
    })

Client

All

Version

5.38.0

Relevant log output

Error while executing operation: Error: The maximum number of retries exceeded. (10/10)
    at /workspace/node_modules/@algolia/client-common/src/createIterablePromise.ts:33:27
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Activity

  1. millotp commented on Oct 7, 2025

    @millotp
    Contributor

    Hello @jorgealemangonzalez, there is no guarantee or maximum delay on the indexing API, so yes, it can take more than 10s.

    From the Algolia doc: search requests always have priority over indexing operations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions