{"record":{"id":"5b4c49ed3b877009","repo":"abhigyanpatwari/GitNexus","slug":"the-ladybugdb-graph-store-at-lbugpath-is-missing-run","errorCode":null,"errorMessage":"The LadybugDB graph store at ${lbugPath} is missing. Run gitnexus analyze first.","messagePattern":"The LadybugDB graph store at (.+?) is missing\\. Run gitnexus analyze first\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/embeddings-sync.ts","lineNumber":65,"sourceCode":"  const metaDir = path.dirname(metaPath);\n  const lock = await acquireIndexLock(metaDir);\n  try {\n    requireExclusiveIndexLock(\n      lock,\n      `Cannot acquire the index lock at ${metaDir}; refusing an unlocked embeddings sync.`,\n    );\n    const meta = await loadMeta(metaDir);\n    if (!meta)\n      throw new Error(`No GitNexus index found for ${repoPath}. Run gitnexus analyze first.`);\n    if (meta.incrementalInProgress) {\n      throw new Error('The structural index is incomplete. Run gitnexus analyze --force first.');\n    }\n\n    let lbugStat;\n    try {\n      lbugStat = await lstat(lbugPath);\n    } catch {\n      throw new Error(\n        `The LadybugDB graph store at ${lbugPath} is missing. Run gitnexus analyze first.`,\n      );\n    }\n    if (!lbugStat.isFile()) {\n      throw new Error(\n        `The LadybugDB graph store at ${lbugPath} is not a usable database file. Run gitnexus analyze first.`,\n      );\n    }\n\n    const { resolveEmbeddingIdentity } = await import('../core/embeddings/embedding-identity.js');\n    const identity = resolveEmbeddingIdentity();\n    let forceReembedNodeIds: ReadonlySet<string> | undefined;\n    let resumedFrom: EmbeddingCheckpoint | undefined;\n    if (meta.embeddingCheckpoint) {\n      const checkpoint = meta.embeddingCheckpoint;\n      const decision = decideEmbeddingResume(checkpoint, identity);\n      if (decision.action === 'abort') throw new Error(decision.error);\n      const identityDiffers =","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/cli/embeddings-sync.ts#L47-L83","documentation":"Metadata was found but the LadybugDB graph database file at lbugPath could not be stat'd — the database backing the graph store is missing from disk. Sync cannot add embeddings without the graph store that defines the nodes they attach to.","triggerScenarios":"The `.lbug`/LadybugDB file referenced by the storage paths was deleted, moved, or never created — e.g. `gitnexus clean` removed it, storage was on an unmounted volume, or the metadata is stale relative to the storage directory.","commonSituations":"Disk cleanup tools deleting large index files; GITNEXUS_STORAGE_PATH pointing at an emptied directory; interrupted analyze that wrote metadata but not the database; restoring metadata from git without the ignored DB file.","solutions":["Run `gitnexus analyze` to recreate the LadybugDB database, then re-run embeddings sync.","Verify the file exists at the reported lbugPath and the volume is mounted.","Check that GITNEXUS_STORAGE_PATH / GITNEXUS_STORAGE_ROOT point at directories that actually contain the index.","If .gitnexus is gitignored, do not expect it to survive a fresh clone — rebuild it with analyze."],"exampleFix":"// before\n$ ls .gitnexus/          # meta present, no .lbug file\n$ gitnexus embeddings-sync .   # Error: graph store missing\n// after\n$ gitnexus analyze\n$ gitnexus embeddings-sync .","handlingStrategy":"validation","validationCode":"import { existsSync, statSync } from 'node:fs';\nfunction graphStorePresent(repoPath) {\n  const p = join(repoPath, '.gitnexus');\n  return existsSync(p) && statSync(p).isFile?.() || existsSync(p);\n}\n// confirm the .lbug database file exists under the storage dir before syncing\nif (!graphStorePresent(repo)) await run('gitnexus analyze');","typeGuard":null,"tryCatchPattern":"try {\n  await gitnexus.embeddingsSync(repo);\n} catch (err) {\n  if (err.message.includes('graph store') && err.message.includes('missing')) {\n    await run('gitnexus analyze');\n    await gitnexus.embeddingsSync(repo);\n  } else throw err;\n}","preventionTips":["Exclude .gitnexus index files from disk-cleaner/backup-pruning tools.","Keep index storage on a reliably mounted volume; avoid ephemeral mounts for the DB path.","After `gitnexus clean`, plan to re-run analyze before any read/sync command.","Don't restore metadata files without their database file."],"tags":["database","file-missing","embeddings","index"],"backgroundTag":"file-not-found","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"}