{"record":{"id":"b973c68114516774","repo":"abhigyanpatwari/GitNexus","slug":"fts-repair-failed-missing-indexes-after-rebuild","errorCode":null,"errorMessage":"FTS repair failed - missing indexes after rebuild: ${missing.join(', ')}.${reasons} Run `gitnexus analyze --force` to perform a full graph+FTS rebuild; if that also fails, verify FTS extension availability via `gitnexus doctor`.","messagePattern":"FTS repair failed - missing indexes after rebuild: (.+?)\\.(.+?) Run `gitnexus analyze --force` to perform a full graph\\+FTS rebuild; if that also fails, verify FTS extension availability via `gitnexus doctor`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/run-analyze.ts","lineNumber":1479,"sourceCode":"          ? (table, indexName) => log(`FTS: creating ${table}.${indexName}`)\n          : undefined,\n        onIndexReady: options.verbose\n          ? (table, indexName) => log(`FTS: ready ${table}.${indexName}`)\n          : undefined,\n      });\n      const missing = await verifySearchFTSIndexes(executeQuery, ftsIndexes);\n      if (missing.length > 0) {\n        // #2889: name WHY each index is missing when the build itself said so.\n        // Repair now rebuilds every table it can before reporting, so the tables\n        // absent from this list were genuinely repaired even on a failed run —\n        // previously the first failure aborted the sweep and the message could\n        // only ever list \"missing\", never a reason. Same sentence the analyze\n        // degrade path prints, so one failure does not read two ways.\n        const reasons =\n          repairFailures.length > 0\n            ? ` ${summarizeFtsIndexBuildFailures(repairFailures, ftsIndexes)}.`\n            : '';\n        throw new Error(\n          `FTS repair failed - missing indexes after rebuild: ${missing.join(', ')}.${reasons} ` +\n            'Run `gitnexus analyze --force` to perform a full graph+FTS rebuild; ' +\n            'if that also fails, verify FTS extension availability via `gitnexus doctor`.',\n        );\n      }\n      await ensureGitNexusIgnored(repoPath, storagePath);\n      // #2767: stamp ONLY capabilities.fts so a long-lived MCP session's\n      // ensureInitialized() has an explicit, correctly-scoped signal that FTS\n      // changed — indexedAt/lastCommit/runnerIdentity/stats are copied through\n      // untouched (see the \"must not claim a new analyzer identity\" comment\n      // below). capabilities is forensic/no-programmatic-readers-until-now, so\n      // graph/vectorSearch are backfilled with conservative, honest defaults\n      // when a legacy meta.json predates this field entirely — repair-fts\n      // never touched them and cannot claim a capability it did not verify.\n      // Best-effort: a write failure must not turn an already-successful FTS\n      // rebuild into a reported repair failure.\n      try {\n        // Re-read the on-disk meta immediately before writing, rather than","sourceCodeStart":1461,"sourceCodeEnd":1497,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/run-analyze.ts#L1461-L1497","documentation":"Error \"FTS repair failed - missing indexes after rebuild: ${missing.join(', ')}.${reasons} Run `gitnexus analyze --force` to perform a full graph+FTS rebuild; if that also fails, verify FTS extension availability via `gitnexus doctor`.\" thrown in abhigyanpatwari/GitNexus.","triggerScenarios":"Thrown at gitnexus/src/core/run-analyze.ts:1225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `gitnexus analyze --force` to perform a full graph+FTS rebuild from scratch, replacing the partially repaired indexes.","Run `gitnexus doctor` to verify FTS extension availability; if the extension is missing, install/load the FTS support required by the storage backend before rebuilding.","Review the per-index `reasons` in the message: indexes absent from the missing list were already repaired; focus on the named ones and any reported cause (e.g. table creation failure or extension unavailability).","If full rebuild also fails, check disk space and database file integrity, then recreate the index directory and re-run `gitnexus analyze`."],"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"}