medusajs/medusa · error · Error

[Index engine] Failed to reset sync

Error message

[Index engine] Failed to reset sync

What it means

resetSync clears and rebuilds index data; any failure while deleting/re-syncing changes is logged and rethrown as '[Index engine] Failed to reset sync'.

Source

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

            },
          })
        }
      )

      return
    }

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

      if (!changes.length) {
        return
      }

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

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Read the logged underlying error to identify whether delete or insert failed
  2. Stop competing sync workers, then retry reset
  3. Verify DB user has DML/DDL rights on the index schema
Defensive patterns

Strategy: retry

Try / catch

try { await indexService.sync({ strategy: 'reset' }) } catch (e) { if (e.message === '[Index engine] Failed to reset sync') { /* stop other workers, verify DB perms, retry */ } throw e }

Prevention

When it happens

Trigger: sync({ strategy: 'reset' }) failing mid-way — e.g. inability to delete existing index rows (locks/permissions) or subsequent re-sync insert failures.

Common situations: Resetting the index after schema changes while another sync or worker holds locks; insufficient DB privileges on index tables.

Related errors


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