medusajs/medusa · error · Error

[Index engine] Failed to full sync

Error message

[Index engine] Failed to full sync

What it means

fullSync wraps a full re-synchronization of all entities; any exception from the data synchronizer is logged and rethrown as '[Index engine] Failed to full sync'.

Source

Thrown at packages/modules/index/src/services/index-module-service.ts:429

            internal: true,
          },
        })
      })

      return
    }

    try {
      const entities = await this.configurationChecker_.checkChanges()

      if (!entities.length) {
        return
      }

      return await this.dataSynchronizer_.syncEntities(entities)
    } catch (e) {
      this.logger_.error(e)
      throw new Error("[Index engine] Failed to full sync")
    }
  }

  private async resetSync() {
    if (!this.#isWorkerMode) {
      await this.baseRepository_.transaction(
        async (transactionManager: SqlEntityManager) => {
          const metadata = transactionManager.getDriver().getMetadata()
          const truncableTables = [
            toMikroORMEntity(IndexData),
            toMikroORMEntity(IndexRelation),
            toMikroORMEntity(IndexMetadata),
            toMikroORMEntity(IndexSync),
          ].map((entity) => metadata.get(entity.name).collection)

          await transactionManager.execute(
            `TRUNCATE TABLE ${truncableTables.join(", ")} CASCADE`
          )

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Inspect the logged root cause immediately before this error
  2. Fix data/constraint issues or increase DB timeouts, then retry full sync
  3. If schema changed, ensure index module was re-initialized with the current configuration
Defensive patterns

Strategy: retry

Try / catch

try { await indexService.sync({ strategy: 'full' }) } catch (e) { if (e.message === '[Index engine] Failed to full sync') { /* inspect logger output, fix data, retry with backoff */ await retry(() => indexService.sync({ strategy: 'full' })) } }

Prevention

When it happens

Trigger: sync({ strategy: 'full' }) where inserting/transforming some entity fails — DB constraints, connection loss, or misconfigured schema object representation.

Common situations: First-time index build against a large dataset hitting timeouts; schema changes not reflected in the index configuration.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/eecca5f511f0a290. Report an issue: GitHub.