{"record":{"id":"dd0a724768363995","repo":"abhigyanpatwari/GitNexus","slug":"cannot-repair-fts-indexes-graph-store-at-lbugpa","errorCode":null,"errorMessage":"Cannot repair FTS indexes: graph store at ${lbugPath} is missing. Run `gitnexus analyze` (full) to rebuild from scratch.","messagePattern":"Cannot repair FTS indexes: graph store at (.+?) is missing\\. Run `gitnexus analyze` \\(full\\) to rebuild from scratch\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/run-analyze.ts","lineNumber":1135,"sourceCode":"    if (existingMeta.incrementalInProgress) {\n      // #2409 / tri-review 4669518496 (R6): a dirty flag means the previous\n      // run died mid-writeback — the graph may be half-written and its WAL\n      // possibly poisoned. This branch returns early, so the dirty-recovery\n      // sidecar quarantine below would never run: repairing FTS now would\n      // open the DB and replay that WAL pre-quarantine, and even a\n      // survivable open would certify FTS over a 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). ' +\n          'Run `gitnexus analyze` first — it recovers the index automatically — ' +\n          'then retry `--repair-fts`.',\n      );\n    }\n    let lbugStat;\n    try {\n      lbugStat = await fs.lstat(lbugPath);\n    } catch {\n      throw new Error(\n        `Cannot repair FTS indexes: graph store at ${lbugPath} is missing. ` +\n          'Run `gitnexus analyze` (full) to rebuild from scratch.',\n      );\n    }\n    if (!lbugStat.isFile()) {\n      const foundType = lbugStat.isDirectory()\n        ? 'a directory'\n        : lbugStat.isSymbolicLink()\n          ? 'a symbolic link'\n          : lbugStat.isSocket()\n            ? 'a socket'\n            : lbugStat.isBlockDevice()\n              ? 'a block device'\n              : lbugStat.isCharacterDevice()\n                ? 'a character device'\n                : lbugStat.isFIFO()\n                  ? 'a FIFO'\n                  : 'not a regular file';","sourceCodeStart":1117,"sourceCodeEnd":1153,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/core/run-analyze.ts#L1117-L1153","documentation":"Thrown during the `--repair-fts` path when `fs.lstat(lbugPath)` rejects — the LadybugDB graph store file does not exist on disk. FTS indexes live inside the same database file as the graph, so there is nothing to attach FTS indexes to without a graph store. The remedy is to run a full `gitnexus analyze` which creates the graph store from scratch.","triggerScenarios":"The FTS-only repair path reaches the `fs.lstat(lbugPath)` call and it throws ENOENT (or any lstat error). Occurs when the repository was never fully analyzed, the `.gitnexus` store directory was manually deleted, or a previous `--force` rebuild failed before creating the DB.","commonSituations":"An operator deletes `.gitnexus/` to save space or recover from corruption and then tries `--repair-fts` without re-indexing first; or a fresh clone where only a partial/meta write happened but the DB file itself was never created.","solutions":["Run `gitnexus analyze` (full) to create the graph store from scratch.","Once the full analyze completes and `gitnexus status` shows the graph, retry `--repair-fts` if keyword search is still degraded.","If the issue persists, check that `.gitnexus/` is writable and not on a filesystem that silently drops files."],"exampleFix":"// before\ngitnexus analyze --repair-fts  // fails: graph store missing\n// after\ngitnexus analyze               // creates the graph store\ngitnexus analyze --repair-fts  // FTS repair now has a DB to work with","handlingStrategy":"validation","validationCode":"// Before repair-fts, verify the graph store file exists:\nimport { access } from 'fs/promises';\ntry {\n  await access(lbugPath);\n} catch {\n  console.error(`Graph store not found at ${lbugPath}. Run 'gitnexus analyze' first.`);\n  process.exit(1);\n}","typeGuard":"import { pathExists } from 'fs-extra';\nconst graphStoreExists = async (p: string): Promise<boolean> => {\n  try { await access(p); return true; } catch { return false; }\n};","tryCatchPattern":"try {\n  await runAnalyze({ ...options, repairFts: true });\n} catch (err) {\n  if (err instanceof Error && err.message.includes('graph store at') && err.message.includes('is missing')) {\n    console.error('Run `gitnexus analyze` (full) to create the graph store first.');\n  }\n  throw err;\n}","preventionTips":["Run `gitnexus status` before `--repair-fts` to confirm the graph store exists and is indexed.","Never manually delete `.gitnexus/` store files without re-running `gitnexus analyze` afterward."],"tags":["fts","analyze","filesystem","graph-store"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}