abhigyanpatwari/GitNexus · error

[spring-auto-configuration] failed to clear synthetic Class…

Error message

[spring-auto-configuration] failed to clear synthetic Class nodes before incremental re-write (${message}) — aborting to avoid stale placeholders; the next run will full-rebuild

What it means

Spring auto-configuration cleanup in lbug-adapter (gitnexus/src/core/lbug/lbug-adapter.ts:3003): before an incremental writeback rewrites synthetic auto-configuration Class nodes, the DETACH DELETE failed with a non-benign error. Aborting prevents stale placeholder Classes from surviving into the new index; the dirty flag forces a full rebuild next run.

Solutions

  1. Re-run the analyze — the dirty-flag full rebuild resolves it
  2. Ensure no serve/MCP process holds the database during the writeback
  3. Address the native cause in the embedded message (disk space, locks)
  4. If persistent, force a clean rebuild with gitnexus analyze --force
Defensive patterns

Strategy: retry

Type guard

const isSpringAutoConfigClearFailure = (e: unknown): boolean =>
  e instanceof Error &&
  e.message.startsWith('[spring-auto-configuration] failed to clear synthetic Class nodes');

Try / catch

try {
  await clearSpringAutoConfigNodes();
} catch (e) {
  if (isSpringAutoConfigClearFailure(e)) {
    // stale placeholder risk — abort and rely on the next-run full rebuild
    logger.warn('spring-auto-configuration cleanup failed; next run will full-rebuild');
  }
  throw e;
}

Prevention

When it happens

Trigger: Incremental writeback on a repo carrying Spring auto-configuration placeholders where the Class-node DELETE fails on a lock, disk fault, or native error rather than a missing table.

Common situations: Same-family situations as the other pre-write cleanups: concurrent readers on the index, disk/AV interference, or an index in a half-written state.

Related errors


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

Appendix: source

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

    try {
      countResult = await c.query(`MATCH (n:Class) WHERE ${predicate} RETURN count(n) AS cnt`);
      const result = Array.isArray(countResult) ? countResult[0] : countResult;
      const rows = await result.getAll();
      const count = Number(rows[0]?.cnt ?? rows[0]?.[0] ?? 0);
      if (count > 0) {
        await closeQueryResults(
          await c.query(`MATCH (n:Class) WHERE ${predicate} DETACH DELETE n`),
        );
      }
      if (countResult) await closeQueryResults(countResult);
      return { nodesDeleted: count };
    } catch (err) {
      if (countResult) await closeQueryResults(countResult);
      if (classifyDeleteAllError(err) === 'benign-missing-table') {
        return { nodesDeleted: 0 };
      }
      const message = err instanceof Error ? err.message : String(err);
      throw new Error(
        '[spring-auto-configuration] failed to clear synthetic Class nodes before ' +
          `incremental re-write (${message}) — aborting to avoid stale placeholders; ` +
          'the next run will full-rebuild',
      );
    }
  });
};

// ============================================================================
// Full-Text Search (FTS) Functions
// ============================================================================

/**
 * Load the FTS extension on the supplied connection (or the singleton
 * writable connection when none is given).
 *
 * Delegates to the shared `ExtensionManager` so install policy (auto /
 * load-only / never), out-of-process bounded INSTALL, and capability

View on GitHub (pinned to ac9a4e9abd)