{"record":{"id":"272d91a0d8922261","repo":"abhigyanpatwari/GitNexus","slug":"cannot-repair-fts-indexes-the-ladybugdb-fts-extension-failed","errorCode":null,"errorMessage":"Cannot repair FTS indexes: the LadybugDB FTS extension failed to load${ftsReason ? ` — ${ftsReason}` : ''}${remedyTail}","messagePattern":"Cannot repair FTS indexes: the LadybugDB FTS extension failed to load(.+?)` : ''\\}(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/run-analyze.ts","lineNumber":1432,"sourceCode":"        // generic text — which is exactly the contradiction #2383 fixed.\n        const rawFtsReason = getExtensionCapabilities().find((c) => c.name === 'fts')?.reason;\n        const ftsReason = rawFtsReason?.replace(/\\.$/, '');\n        // A missing runtime dependency (Windows error 126, #2374) is not healed\n        // by re-installing — the file is already present. Route that class to the\n        // classified remedy (install VC++ redist / OpenSSL) instead of the old\n        // \"retry the network install\" text that trapped the user in a loop.\n        const inspectPath = extractExtensionPath(rawFtsReason);\n        const { kind, remedy } = diagnoseExtensionLoad(\n          rawFtsReason,\n          'FTS',\n          inspectPath,\n          resolveFtsVersionPair(inspectPath),\n        );\n        const remedyTail = usesClassifiedLoadRemedy(kind)\n          ? ` ${remedy}`\n          : '. Retry with network access and GITNEXUS_LBUG_EXTENSION_INSTALL=auto to install it, ' +\n            'or pre-install the extension file; run `gitnexus doctor` for live FTS status.';\n        throw new Error(\n          'Cannot repair FTS indexes: the LadybugDB FTS extension failed to load' +\n            (ftsReason ? ` — ${ftsReason}` : '') +\n            remedyTail,\n        );\n      }\n      progress('fts', 85, 'Repairing search indexes...');\n      // Restamp before CREATE so a second native abort still has in-place\n      // FTS dirty evidence after persist cleared the first stamp.\n      try {\n        const latestBeforeCreate = (await loadMeta(metaDir)) ?? existingMeta;\n        await saveMeta(metaDir, {\n          ...latestBeforeCreate,\n          incrementalInProgress: buildFtsDirtyStamp({\n            prior: latestBeforeCreate.incrementalInProgress,\n            writePlan: 'in-place',\n            checkpointSucceeded: true,\n          }),\n        });","sourceCodeStart":1414,"sourceCodeEnd":1450,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/run-analyze.ts#L1414-L1450","documentation":"runFullAnalysisInner throws when the LadybugDB FTS extension fails to load during --repair-fts, including an optional load-failure reason and a remedy tail that depends on the extension kind (classified-load remedy or a network/pre-install remedy plus `gitnexus doctor` for live FTS status). FTS repair cannot proceed without the extension binary.","triggerScenarios":"Running `gitnexus analyze --repair-fts` when the LadybugDB FTS extension is not installed locally and cannot be downloaded (no network, GITNEXUS_LBUG_EXTENSION_INSTALL not set to auto), or the extension file is present but fails to load (wrong platform/arch build).","commonSituations":"Air-gapped or restricted-network CI where the extension was never pre-installed; upgrading platforms (e.g. ARM vs x64) leaving a stale extension binary; GITNEXUS_LBUG_EXTENSION_INSTALL left at its default instead of 'auto'.","solutions":["Run `gitnexus doctor` for live FTS status to see the concrete load failure.","Re-run with network access and GITNEXUS_LBUG_EXTENSION_INSTALL=auto to install the extension.","Pre-install the extension file matching your platform/arch if the network is unavailable.","If the binary is corrupt or for the wrong arch, delete the cached extension and reinstall."],"exampleFix":"// before (offline, default install mode)\ngitnexus analyze --repair-fts\n// after\nGITNEXUS_LBUG_EXTENSION_INSTALL=auto gitnexus analyze --repair-fts","handlingStrategy":"try-catch","validationCode":"// Pre-flight: check live FTS status before attempting repair\nimport { execSync } from 'node:child_process';\nconsole.log(execSync('gitnexus doctor').toString());","typeGuard":null,"tryCatchPattern":"try {\n  await runAnalyze({ repairFts: true });\n} catch (err) {\n  if (err instanceof Error && err.message.includes('FTS extension failed to load')) {\n    console.error('Pre-install the FTS extension or set GITNEXUS_LBUG_EXTENSION_INSTALL=auto with network access.');\n  } else throw err;\n}","preventionTips":["Pre-install the LadybugDB FTS extension for your platform in air-gapped environments.","Run `gitnexus doctor` after upgrades to verify FTS extension status.","Keep the cached extension arch in sync when switching machines/containers."],"tags":["fts","extension","dependency","database"],"backgroundTag":"module-init-failed","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"}