abhigyanpatwari/GitNexus · warning
deleteNodesForFile: ${EMBEDDING_TABLE_NAME} table does not e
Error message
deleteNodesForFile: ${EMBEDDING_TABLE_NAME} table does not exist — skipping embedding-row deletes for this DB. What it means
deleteNodesForFile (the singular legacy variant) hit the pinned legacy-permissive contract: it resolves {deletedNodes: 0} even on a bogus dbPath and swallows per-statement failures wholesale. The one diagnostic it emits is when the EMBEDDING table does not exist — embedding-row deletes are skipped for this DB. Node-table deletes in the loop below proceed (or fail silently) per the same permissive policy.
Source
Thrown at gitnexus/src/core/lbug/lbug-adapter.ts:2467
// DELETE loop below the join would match nothing.
try {
await queryAndDrain(
targetConn!,
`MATCH (n:${embeddableLabelMatch()}) WHERE n.filePath = '${escapedPath}' ` +
`MATCH (e:${EMBEDDING_TABLE_NAME}) WHERE e.nodeId = n.id DELETE e`,
);
} catch (err) {
// Deliberately legacy-permissive (pinned contract:
// lbug-conn-serialization U5 and lbug-core-adapter expect this variant
// to resolve `{deletedNodes: 0}` even on a bogus dbPath): the singular
// variant swallows per-statement failures wholesale — its per-table
// loop below does the same — so a partial rethrow here would be
// incoherent with the rest of the function. The STRICT
// rethrow-except-missing-table policy lives in deleteNodesForFiles,
// the #2409 incremental writeback path (FIX 4). The one case worth a
// diagnostic is the missing embedding table.
if (isMissingEmbeddingTableError(err)) {
logger.warn(
{ err },
`deleteNodesForFile: ${EMBEDDING_TABLE_NAME} table does not exist — ` +
'skipping embedding-row deletes for this DB.',
);
}
}
// Delete nodes from each table that has filePath
// DETACH DELETE removes the node and all its relationships
for (const tableName of NODE_TABLES) {
// Skip tables that don't have filePath (Community, Process)
if (tableName === 'Community' || tableName === 'Process') continue;
try {
// First count how many we'll delete. On the singleton connection this
// count runs inside withConnLock (incremental --pdg writeback executes
// while the WAL driver is live); per-query/temp connections skip the
// lock, matching queryAndDrain's `targetConn === conn` gate — the siblingView on GitHub (pinned to aac7515d2a)
Solutions
- If you need embeddings, do a full rebuild (`gitnexus analyze --force`) with a current version so EMBEDDING_SCHEMA is created.
- If embeddings are intentionally unused, ignore the warn — deletes of file nodes continue in the loop below.
- Prefer deleteNodesForFiles (plural) for the strict rethrow-except-missing-table behavior on the incremental writeback path.
- Check which schema variant created the DB (index age/version) before incremental updates.
Defensive patterns
Strategy: type-guard
Validate before calling
// Before incremental deletes: does this DB have the embedding table?
const rows = await readQueryRows(await conn.query("CALL SHOW_TABLES() WHERE name = 'EMBEDDING_TABLE'"));
const hasEmbeddings = rows.length > 0; // if false, the warn is expected, not a defect Type guard
import { isMissingEmbeddingTableError } from './binder-errors.js';
// narrows catch(unknown) to the one tolerated variant
function isExpectedSchemaDrift(err: unknown): boolean {
return isMissingEmbeddingTableError(err);
} Try / catch
try {
await deleteNodesForFile(dbPath, filePath);
} catch (err) {
// singular variant is legacy-permissive and rarely throws; embedding-missing only warns
throw err;
} Prevention
- Use deleteNodesForFiles (plural) for new code — its STRICT policy only tolerates this exact case.
- Full-rebuild (analyze --force) after upgrading across the embeddings boundary.
- One CLI version per .gitnexus DB to avoid schema-variant mixing.
When it happens
Trigger: Calling deleteNodesForFile on a DB created by a build variant without EMBEDDING_SCHEMA — the `MATCH (e:EMBEDDING_TABLE) WHERE e.nodeId = n.id DELETE e` prepare fails with the binder's missing-table error, isMissingEmbeddingTableError matches, and the warn fires before the per-node-table loop.
Common situations: Databases indexed by older gitnexus versions or embedding-free configurations; mixing CLI versions against one .gitnexus directory; test fixtures built with a reduced schema.
Related errors
- deleteNodesForFiles: ${EMBEDDING_TABLE_NAME} table does not
- [embed] Failed to delete stale embedding rows — aborting to
- [${logTag}] failed to clear existing ${relType} edges before
- [spring-aop] failed to clear synthetic evidence before incre
- Incremental importer BFS: dropped chunk ${chunkIndex} (${bat
AI-assisted analysis of abhigyanpatwari/GitNexus@aac7515d2a (2026-08-20).
Data as JSON: /api/errors/1f04bf09777d1557.
Report an issue: GitHub.