{"record":{"id":"284d48ea6918c3d1","repo":"abhigyanpatwari/GitNexus","slug":"search-index-build-failed-with-an-integrity-error","errorCode":null,"errorMessage":"Search index build failed with an integrity error and the analysis was aborted to avoid publishing a broken index: ${ftsResult.error}. The previous index is left intact. Re-run `gitnexus analyze`; if it persists, check the disk for space or corruption.","messagePattern":"Search index build failed with an integrity error and the analysis was aborted to avoid publishing a broken index: (.+?)\\. The previous index is left intact\\. Re-run `gitnexus analyze`; if it persists, check the disk for space or corruption\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/run-analyze.ts","lineNumber":3529,"sourceCode":"        onIndexStart: options.verbose\n          ? (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      if (ftsResult.ok) {\n        progress('fts', 90, 'Search indexes ready');\n      } else if (ftsFailureIsFatal(ftsResult.failureClass, useAtomicSwap)) {\n        // #2658: an IO/rename/checkpoint/corruption failure while building FTS\n        // is a genuinely broken build on this disk — not a concurrent writer\n        // (the single-writer lock rules that out). ONLY fatal on the atomic-swap\n        // path: the graph was built into a throwaway staging DB, so throwing\n        // before the swap abandons the staging file and leaves the previous live\n        // index intact. On an in-place build the live DB is already mutated and\n        // cannot be rolled back by throwing (see ftsFailureIsFatal) — those\n        // degrade in the branch below instead.\n        throw new Error(\n          `Search index build failed with an integrity error and the analysis was aborted ` +\n            `to avoid publishing a broken index: ${ftsResult.error}. The previous index is ` +\n            `left intact. Re-run \\`gitnexus analyze\\`; if it persists, check the disk for space ` +\n            `or corruption.`,\n        );\n      } else {\n        ftsReady = false;\n        ftsSkipReason = 'build-failed';\n        log(\n          `FTS index build failed (${ftsResult.error}) — keyword search degraded this run. ` +\n            'Graph and embeddings analysis completed successfully. Run `gitnexus analyze --repair-fts` to retry.',\n        );\n        progress('fts', 90, 'Search indexes skipped (build failed)');\n      }\n    } else if (ftsDisabledReason) {\n      log(FTS_DISABLED_MESSAGE);\n      progress('fts', 90, 'Search indexes skipped (explicitly disabled)');\n    } else {","sourceCodeStart":3511,"sourceCodeEnd":3547,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/run-analyze.ts#L3511-L3547","documentation":"Error \"Search index build failed with an integrity error and the analysis was aborted to avoid publishing a broken index: ${ftsResult.error}. The previous index is left intact. Re-run `gitnexus analyze`; if it persists, check the disk for space or corruption.\" thrown in abhigyanpatwari/GitNexus.","triggerScenarios":"Thrown at gitnexus/src/core/run-analyze.ts:2762 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ac9a4e9abd8fd3058c070b72c23402a4f887929a","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}