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

Thrown when clearing synthetic Class nodes injected by the Spring auto-configuration analysis pass before an incremental re-write fails with a non-benign error. These synthetic Class nodes represent auto-configuration entry points; failing to clear them before re-injection would leave stale placeholder nodes. Same classifyDeleteAllError gate as the other delete-all paths: 'benign-missing-table' returns silently, everything else re-throws.

Source

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

    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 d540b00184)

Solutions

  1. Re-run `gitnexus analyze` — the dirty flag forces a full rebuild that recreates all synthetic nodes cleanly
  2. Inspect the wrapped `message` for the root LadybugDB error — lock errors mean stop concurrent processes; disk errors mean free space
  3. Use `gitnexus analyze --force` if the error recurs on every incremental run
  4. Verify no other GitNexus process is using the repository
Defensive patterns

Strategy: retry

Try / catch

try {
  await clearSpringAutoConfigClassNodes();
} catch (e) {
  if (e instanceof Error && e.message.startsWith('[spring-auto-configuration]')) {
    logger.warn('Spring auto-config node clear failed; next run will full-rebuild');
  }
  throw e;
}

Prevention

When it happens

Trigger: During incremental writeback for a Spring Boot project with auto-configuration classes, the MATCH (n:Class) WHERE ... DETACH DELETE query fails on a real LadybugDB error (lock, disk, corruption). The predicate targets only Spring-auto-configuration-owned synthetic Class nodes; other Class declarations are untouched.

Common situations: Re-analyzing a Spring Boot project after adding/removing @AutoConfiguration or META-INF/spring.factories entries; concurrent process contention; disk-full conditions during writeback; corrupted incremental state from a prior crash.

Related errors


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