abhigyanpatwari/GitNexus · error

Cannot repair FTS indexes because this repository has not…

Error message

Cannot repair FTS indexes because this repository has not been analyzed yet. Run `gitnexus analyze` first to create the initial index, then retry `--repair-fts`.

What it means

Error "Cannot repair FTS indexes because this repository has not been analyzed yet. Run `gitnexus analyze` first to create the initial index, then retry `--repair-fts`." thrown in abhigyanpatwari/GitNexus.

Solutions

  1. Run `gitnexus analyze` once to create the initial index for this repository, then re-run with `--repair-fts`.
  2. Verify the index exists (check `.gitnexus/` storage or `gitnexus status`); if the repo was analyzed into a different storage path, point GITNEXUS_STORAGE_PATH/GITNEXUS_STORAGE_ROOT at it or re-analyze in place.
  3. If the index directory was deleted or moved, a plain `--repair-fts` cannot restore it — perform a fresh `gitnexus analyze` to rebuild graph and FTS indexes from scratch.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at gitnexus/src/core/run-analyze.ts:1120 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of abhigyanpatwari/GitNexus@ac9a4e9abd (2026-09-15). Data as JSON: /api/errors/e68baccdbf00a6aa. Report an issue: GitHub.

Appendix: source

Thrown at gitnexus/src/core/run-analyze.ts:1326

      indexedAt: new Date().toISOString(),
    });
  }

  // ── FTS-only repair path ────────────────────────────────────────────
  const requestedRepairFts = Boolean(options.repairFts);
  if (
    options.repairFts &&
    existingMeta &&
    contentRetentionMismatch(existingMeta, contentRetention)
  ) {
    log(
      'content retention or FTS profile changed; forcing a full rebuild before rebuilding search indexes.',
    );
    options = { ...options, force: true, repairFts: false };
  }
  if (options.repairFts) {
    if (!existingMeta) {
      throw new Error(
        'Cannot repair FTS indexes because this repository has not been analyzed yet. ' +
          'Run `gitnexus analyze` first to create the initial index, then retry `--repair-fts`.',
      );
    }
    if (shouldRefuseRepairFtsWhileDirty(existingMeta.incrementalInProgress)) {
      // #2409 / tri-review 4669518496 (R6): a non-FTS dirty flag means the
      // previous run died mid-writeback — the graph may be half-written and
      // its WAL possibly poisoned. This branch returns early, so the
      // dirty-recovery sidecar quarantine below would never run: repairing
      // FTS now would open the DB and replay that WAL pre-quarantine, and
      // even a survivable open would certify FTS over a half-written graph.
      // An FTS-phase flag with a successful checkpoint is different (KTD4):
      // the graph-boundary checkpoint already ran, so `--repair-fts` must
      // stay usable (R8). Missing/failed checkpoint is treated like a
      // half-written graph.
      throw new Error(
        'Cannot repair FTS indexes: the index is mid-incremental-recovery ' +
          '(a previous analyze run did not complete cleanly). ' +

View on GitHub (pinned to ac9a4e9abd)