abhigyanpatwari/GitNexus · warning

deleteNodesForFiles: ${EMBEDDING_TABLE_NAME} table does not

Error message

deleteNodesForFiles: ${EMBEDDING_TABLE_NAME} table does not exist — skipping embedding-row deletes for this writeback.

What it means

deleteNodesForFiles (plural, the #2409 incremental writeback path with the STRICT policy) tolerates exactly one failure: the EMBEDDING table binder error from a build-variant DB without EMBEDDING_SCHEMA, which would otherwise brick every incremental run until --force. Every other error rethrows. The warn fires once per writeback thanks to the warnedMissingEmbeddingTable flag.

Source

Thrown at gitnexus/src/core/lbug/lbug-adapter.ts:2589

    // `e.nodeId = n.id` equality is exact — no `File:a.ts` / `File:a.tsx`
    // prefix collisions. ORDER IS LOAD-BEARING: this must run BEFORE the
    // DETACH DELETE loop below — once the nodes are gone the join matches
    // nothing (empirically verified against @ladybugdb/core 0.18.0).
    try {
      await queryAndDrain(
        targetConn,
        `MATCH (n:${embeddableLabelMatch()}) WHERE n.filePath IN ${listLiteral} ` +
          `MATCH (e:${EMBEDDING_TABLE_NAME}) WHERE e.nodeId = n.id DELETE e`,
      );
    } catch (err) {
      // Tolerate exactly the missing-embedding-table binder error: a
      // build-variant DB without EMBEDDING_SCHEMA would otherwise brick
      // every incremental run until `--force` (FIX 4). The no-swallow
      // policy stays for every real failure — anything else rethrows.
      if (!isMissingEmbeddingTableError(err)) throw err;
      if (!warnedMissingEmbeddingTable) {
        warnedMissingEmbeddingTable = true;
        logger.warn(
          { err },
          `deleteNodesForFiles: ${EMBEDDING_TABLE_NAME} table does not exist — ` +
            'skipping embedding-row deletes for this writeback.',
        );
      }
    }
    for (const tableName of NODE_TABLES) {
      // Community/Process are graph-wide (no filePath); the orchestrator
      // drops them wholesale via deleteAllCommunitiesAndProcesses.
      if (tableName === 'Community' || tableName === 'Process') continue;
      const tn = escapeTableName(tableName);
      await queryAndDrain(
        targetConn,
        `MATCH (n:${tn}) WHERE n.filePath IN ${listLiteral} DETACH DELETE n`,
      );
    }
    options.onChunk?.(
      Math.min((chunkIndex + 1) * DELETE_FILES_CHUNK_SIZE, filePaths.length),

View on GitHub (pinned to aac7515d2a)

Solutions

  1. Run one full `--force` rebuild with a current version to create the EMBEDDING table; the warn disappears on later incremental runs.
  2. If you deliberately run without embeddings, treat the once-per-writeback warn as informational.
  3. Any OTHER error from this function rethrows — fix those before assuming schema drift.
  4. Keep one CLI version owning a given .gitnexus DB to avoid schema-variant mixing.
Defensive patterns

Strategy: type-guard

Validate before calling

// Once per writeback: probe the table, then skip embedding deletes knowingly
const hasTable = await tableExists(targetConn, EMBEDDING_TABLE_NAME);
if (!hasTable) {
  await deleteNodesForFiles(targets.filter(t => !t.needsEmbeddings)); // or plan a --force rebuild
}

Type guard

import { isMissingEmbeddingTableError } from './binder-errors.js';
// the strict variant rethrows EVERYTHING except this one error — narrow precisely:
function tolerable(err: unknown): boolean { return isMissingEmbeddingTableError(err); }

Try / catch

try {
  await deleteNodesForFiles(changedFiles);
} catch (err) {
  if (!isMissingEmbeddingTableError(err)) throw err; // real failure — surfaces
  // expected warn already logged once this writeback; continue
}

Prevention

When it happens

Trigger: Incremental writeback deletes nodes for changed files; the embedding-row DELETE prepare fails with the missing-embedding-table binder error; isMissingEmbeddingTableError(err) is true so it warns (once) and continues to the per-table deletes instead of throwing.

Common situations: Repos indexed before embeddings shipped or with embedding generation disabled; a build-variant DB that never ran EMBEDDING_SCHEMA; upgrading tooling that now does incremental writebacks against that old DB.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@aac7515d2a (2026-08-20). Data as JSON: /api/errors/fe0f2f894ba0e384. Report an issue: GitHub.