{"record":{"id":"5b6541b298116b03","repo":"abhigyanpatwari/GitNexus","slug":"cannot-park-path-basename-failedpath-after-an-in-place-fts","errorCode":null,"errorMessage":"Cannot park ${path.basename(failedPath)} after an in-place FTS abort${detail ? ` (${detail})` : ''}. The database was not opened. Run `gitnexus clean --lbug-sidecars` after stopping any GitNexus MCP or serve process, then retry `gitnexus analyze` or `gitnexus analyze --repair-fts`.","messagePattern":"Cannot park (.+?) after an in-place FTS abort(.+?)\\)` : ''\\}\\. The database was not opened\\. Run `gitnexus clean --lbug-sidecars` after stopping any GitNexus MCP or serve process, then retry `gitnexus analyze` or `gitnexus analyze --repair-fts`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/lbug/sidecar-recovery.ts","lineNumber":386,"sourceCode":"): Promise<void> => {\n  const state = await inspectLbugSidecars(dbPath);\n  if (state.kind === 'wal-with-shadow') {\n    warnOnce(\n      logger,\n      `${dbPath}:present-shadow-refuse:${mode}`,\n      `GitNexus: refusing to quarantine WAL at ${dbPath}.wal during ${mode} recovery — ` +\n        'the .shadow sidecar is present on disk, so the open likely failed on path reachability or a lock ' +\n        'rather than a missing shadow. Run `gitnexus analyze --force <repo-path> --index-only` if the index is genuinely broken.',\n    );\n    throw new Error(presentShadowUnreachableMessage(dbPath, triggeringErr));\n  }\n  if (state.kind === 'orphan-wal') {\n    if (crashEvidence?.kind === 'fts-inplace-checkpointed') {\n      const { failed } = await quarantineSidecarsForDirtyRecovery(dbPath, (message) =>\n        logger.warn(message),\n      );\n      if (failed.length > 0) {\n        throw new Error(ftsCrashParkFailureMessage(failed[0]!));\n      }\n      return;\n    }\n    warnOnce(\n      logger,\n      `${dbPath}:large-wal-refuse:${mode}`,\n      `GitNexus: refusing to quarantine large WAL (${state.walBytes} bytes) at ${dbPath}.wal during ${mode} recovery; ` +\n        'manual recovery required — run `gitnexus analyze --force <repo-path> --index-only`.',\n    );\n    throw new Error(shadowSidecarRecoveryMessage(dbPath, triggeringErr));\n  }\n};\n\nexport async function quarantineWalForMissingShadow(\n  dbPath: string,\n  options: {\n    logger: SidecarRecoveryLogger;\n    level?: 'debug' | 'info' | 'warn';","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/lbug/sidecar-recovery.ts#L368-L404","documentation":"guardWalQuarantine attempted dirty-recovery parking of leftover WAL/shadow sidecars after an in-place FTS abort (orphan-wal with fts-inplace-checkpointed crash evidence) and at least one sidecar could not be parked or removed. The database was not opened; ftsCrashParkFailureMessage reports the first failed path and points to manual cleanup via `gitnexus clean --lbug-sidecars`.","triggerScenarios":"A sync/analyze flow calls guardWalQuarantine on a database with an orphan WAL left by a crashed in-place FTS checkpoint, and quarantineSidecarsForDirtyRecovery reports failed paths (permission issues, locked files, disk problems).","commonSituations":"Sidecar files locked by antivirus or another GitNexus process; insufficient write permissions on .gitnexus/; read-only filesystem or disk full preventing the park/rename.","solutions":["Stop any GitNexus MCP or serve process holding handles on the sidecar files.","Run `gitnexus clean --lbug-sidecars` to remove the leftover WAL/shadow sidecars.","Retry `gitnexus analyze`, or `gitnexus analyze --repair-fts` if FTS indexes need rebuilding.","Check write permissions on the repo's .gitnexus directory and available disk space."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import fs from 'node:fs';\n// Writable check before recovery\nfs.accessSync(gitnexusDir, fs.constants.W_OK);","typeGuard":null,"tryCatchPattern":"try {\n  await runSync();\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Cannot park')) {\n    console.error('Stop MCP/serve, run `gitnexus clean --lbug-sidecars`, then re-run analyze.');\n  } else throw err;\n}","preventionTips":["Ensure .gitnexus/ is writable by the process user and has free disk space.","Stop MCP/serve processes before analyze after an FTS crash.","Exclude sidecar files from antivirus locking."],"tags":["database","wal","fts","sidecar","crash-recovery"],"backgroundTag":"fts-crash-wal-leftover","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"}