{"record":{"id":"e68baccdbf00a6aa","repo":"abhigyanpatwari/GitNexus","slug":"cannot-repair-fts-indexes-because-this-repository","errorCode":null,"errorMessage":"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`.","messagePattern":"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`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/run-analyze.ts","lineNumber":1326,"sourceCode":"      indexedAt: new Date().toISOString(),\n    });\n  }\n\n  // ── FTS-only repair path ────────────────────────────────────────────\n  const requestedRepairFts = Boolean(options.repairFts);\n  if (\n    options.repairFts &&\n    existingMeta &&\n    contentRetentionMismatch(existingMeta, contentRetention)\n  ) {\n    log(\n      'content retention or FTS profile changed; forcing a full rebuild before rebuilding search indexes.',\n    );\n    options = { ...options, force: true, repairFts: false };\n  }\n  if (options.repairFts) {\n    if (!existingMeta) {\n      throw new Error(\n        'Cannot repair FTS indexes because this repository has not been analyzed yet. ' +\n          'Run `gitnexus analyze` first to create the initial index, then retry `--repair-fts`.',\n      );\n    }\n    if (shouldRefuseRepairFtsWhileDirty(existingMeta.incrementalInProgress)) {\n      // #2409 / tri-review 4669518496 (R6): a non-FTS dirty flag means the\n      // previous run died mid-writeback — the graph may be half-written and\n      // its WAL possibly poisoned. This branch returns early, so the\n      // dirty-recovery sidecar quarantine below would never run: repairing\n      // FTS now would open the DB and replay that WAL pre-quarantine, and\n      // even a survivable open would certify FTS over a half-written graph.\n      // An FTS-phase flag with a successful checkpoint is different (KTD4):\n      // the graph-boundary checkpoint already ran, so `--repair-fts` must\n      // stay usable (R8). Missing/failed checkpoint is treated like a\n      // half-written graph.\n      throw new Error(\n        'Cannot repair FTS indexes: the index is mid-incremental-recovery ' +\n          '(a previous analyze run did not complete cleanly). ' +","sourceCodeStart":1308,"sourceCodeEnd":1344,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/run-analyze.ts#L1308-L1344","documentation":"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.","triggerScenarios":"Thrown at gitnexus/src/core/run-analyze.ts:1120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `gitnexus analyze` once to create the initial index for this repository, then re-run with `--repair-fts`.","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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ac9a4e9abd8fd3058c070b72c23402a4f887929a","analyzedAt":"2026-09-15T23:29:44.066Z","contentChangedAt":"2026-09-15T23:29:44.066Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}