abhigyanpatwari/GitNexus · error
The LadybugDB graph store at
Error message
The LadybugDB graph store at ${lbugPath} is missing. Run gitnexus analyze first. What it means
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.
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.
Example fix
// before $ ls .gitnexus/ # meta present, no .lbug file $ gitnexus embeddings-sync . # Error: graph store missing // after $ gitnexus analyze $ gitnexus embeddings-sync .
Defensive patterns
Strategy: validation
Validate before calling
import { existsSync, statSync } from 'node:fs';
function graphStorePresent(repoPath) {
const p = join(repoPath, '.gitnexus');
return existsSync(p) && statSync(p).isFile?.() || existsSync(p);
}
// confirm the .lbug database file exists under the storage dir before syncing
if (!graphStorePresent(repo)) await run('gitnexus analyze'); Try / catch
try {
await gitnexus.embeddingsSync(repo);
} catch (err) {
if (err.message.includes('graph store') && err.message.includes('missing')) {
await run('gitnexus analyze');
await gitnexus.embeddingsSync(repo);
} else throw err;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- The LadybugDB graph store at
- Cannot sync embeddings: the index checkpoint was written by
- [embed] could not count persisted embeddings; leaving…
- [embed] Failed to delete stale embedding rows — aborting to…
- No GitNexus index found for
AI-assisted analysis of abhigyanpatwari/GitNexus@ac9a4e9abd (2026-09-15).
Data as JSON: /api/errors/5b4c49ed3b877009.
Report an issue: GitHub.
Appendix: source
Thrown at gitnexus/src/cli/embeddings-sync.ts:65
const metaDir = path.dirname(metaPath);
const lock = await acquireIndexLock(metaDir);
try {
requireExclusiveIndexLock(
lock,
`Cannot acquire the index lock at ${metaDir}; refusing an unlocked embeddings sync.`,
);
const meta = await loadMeta(metaDir);
if (!meta)
throw new Error(`No GitNexus index found for ${repoPath}. Run gitnexus analyze first.`);
if (meta.incrementalInProgress) {
throw new Error('The structural index is incomplete. Run gitnexus analyze --force first.');
}
let lbugStat;
try {
lbugStat = await lstat(lbugPath);
} catch {
throw new Error(
`The LadybugDB graph store at ${lbugPath} is missing. Run gitnexus analyze first.`,
);
}
if (!lbugStat.isFile()) {
throw new Error(
`The LadybugDB graph store at ${lbugPath} is not a usable database file. Run gitnexus analyze first.`,
);
}
const { resolveEmbeddingIdentity } = await import('../core/embeddings/embedding-identity.js');
const identity = resolveEmbeddingIdentity();
let forceReembedNodeIds: ReadonlySet<string> | undefined;
let resumedFrom: EmbeddingCheckpoint | undefined;
if (meta.embeddingCheckpoint) {
const checkpoint = meta.embeddingCheckpoint;
const decision = decideEmbeddingResume(checkpoint, identity);
if (decision.action === 'abort') throw new Error(decision.error);
const identityDiffers =View on GitHub (pinned to ac9a4e9abd)