{"record":{"id":"16b2c95584274e87","repo":"abhigyanpatwari/GitNexus","slug":"repair-fts-cannot-be-used-with-skip-fts-or-gitnexus-skip-fts","errorCode":null,"errorMessage":"--repair-fts cannot be used with --skip-fts or GITNEXUS_SKIP_FTS=1.","messagePattern":"--repair-fts cannot be used with --skip-fts or GITNEXUS_SKIP_FTS=1\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/run-analyze.ts","lineNumber":1143,"sourceCode":" * genuinely-changed tree does one follow-up incremental. No new flag: waiting\n * is the default, which is what hook-driven re-index wants.\n *\n * The lock is held by whichever process runs the pipeline (the heap-respawn\n * child, or the original) — see index-lock.ts for why ownership lives with the\n * writer, not a supervising parent. Released as soon as the write completes or\n * throws; the post-analysis steps in the CLI (skills, registry) run lock-free.\n */\nexport async function runFullAnalysis(\n  repoPath: string,\n  options: AnalyzeOptions,\n  callbacks: AnalyzeCallbacks,\n  runnerIdentityAtBootstrap?: AnalyzerRunnerIdentity,\n): Promise<AnalyzeResult> {\n  // Validate operator-provided FTS config before anything else — a typo fails\n  // here in ms, without taking the lock. (createSearchFTSIndexes reuses the\n  // cached value via getSearchFTSStemmer.)\n  if (options.repairFts && resolveFtsDisableReason(options.skipFts)) {\n    throw new Error('--repair-fts cannot be used with --skip-fts or GITNEXUS_SKIP_FTS=1.');\n  }\n  initialiseSearchFTSStemmer();\n  initialiseSearchFTSCjkSegmentation();\n  const contentRetention = contentRetentionFromEnvironment();\n  // Scope the degraded-parse log throttle to this run (module-level counter\n  // would otherwise stay saturated on a reused process).\n  resetDegradedParseCounter();\n  // The workspace-package memo is per process: this run must see the tree as it\n  // is now, not as the previous run in a long-lived watch/server process saw it.\n  invalidateNodeWorkspacePackages(repoPath);\n\n  const log = (msg: string) => callbacks.onLog?.(stripControlCharacters(msg));\n  const acquireOpts = {\n    log,\n    onWaitStart: () =>\n      callbacks.onProgress('lock', 0, 'Waiting for another analyze to finish on this index…'),\n  };\n","sourceCodeStart":1125,"sourceCodeEnd":1161,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/run-analyze.ts#L1125-L1161","documentation":"runFullAnalysis validates operator-provided FTS configuration before taking any lock, and rejects combining --repair-fts with FTS being disabled via --skip-fts or GITNEXUS_SKIP_FTS=1. Repairing FTS indexes is meaningless (and contradictory) when FTS is disabled; failing fast here takes milliseconds and avoids taking the index lock.","triggerScenarios":"Invoking `gitnexus analyze --repair-fts` together with `--skip-fts`, or in an environment where GITNEXUS_SKIP_FTS=1 is set (resolveFtsDisableReason returns a reason).","commonSituations":"A CI job or shell profile exports GITNEXUS_SKIP_FTS=1 globally while a developer tries to repair FTS; a script template keeps --skip-fts hardcoded and someone appends --repair-fts.","solutions":["Remove --skip-fts from the command line (or unset GITNEXUS_SKIP_FTS) and re-run `gitnexus analyze --repair-fts`.","If FTS must stay disabled, drop --repair-fts from the invocation.","Check where GITNEXUS_SKIP_FTS is exported (shell profile, CI env) and scope it to the runs that need it."],"exampleFix":"// before\nGITNEXUS_SKIP_FTS=1 gitnexus analyze --repair-fts\n// after\nunset GITNEXUS_SKIP_FTS && gitnexus analyze --repair-fts","handlingStrategy":"validation","validationCode":"const skipFts = process.env.GITNEXUS_SKIP_FTS === '1';\nif (repairFts && skipFts) {\n  throw new Error('Drop --repair-fts or unset GITNEXUS_SKIP_FTS before running.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runAnalyze(options);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('--repair-fts cannot be used')) {\n    console.error('Conflicting FTS flags: remove --skip-fts/GITNEXUS_SKIP_FTS or drop --repair-fts.');\n  } else throw err;\n}","preventionTips":["Check GITNEXUS_SKIP_FTS in your shell profile/CI env before using --repair-fts.","Do not hardcode --skip-fts in shared analyze scripts that operators extend.","Document that repair requires FTS enabled."],"tags":["cli","fts","configuration","flags"],"backgroundTag":"mutually-exclusive-flags","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"}