{"record":{"id":"0c33a6c658b1ede6","repo":"abhigyanpatwari/GitNexus","slug":"spring-auto-configuration-failed-to-clear-synthe","errorCode":null,"errorMessage":"[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","messagePattern":"\\[spring-auto-configuration\\] failed to clear synthetic Class nodes before incremental re-write \\((.+?)\\) — aborting to avoid stale placeholders; the next run will full-rebuild","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/lbug/lbug-adapter.ts","lineNumber":3003,"sourceCode":"    try {\n      countResult = await c.query(`MATCH (n:Class) WHERE ${predicate} RETURN count(n) AS cnt`);\n      const result = Array.isArray(countResult) ? countResult[0] : countResult;\n      const rows = await result.getAll();\n      const count = Number(rows[0]?.cnt ?? rows[0]?.[0] ?? 0);\n      if (count > 0) {\n        await closeQueryResults(\n          await c.query(`MATCH (n:Class) WHERE ${predicate} DETACH DELETE n`),\n        );\n      }\n      if (countResult) await closeQueryResults(countResult);\n      return { nodesDeleted: count };\n    } catch (err) {\n      if (countResult) await closeQueryResults(countResult);\n      if (classifyDeleteAllError(err) === 'benign-missing-table') {\n        return { nodesDeleted: 0 };\n      }\n      const message = err instanceof Error ? err.message : String(err);\n      throw new Error(\n        '[spring-auto-configuration] failed to clear synthetic Class nodes before ' +\n          `incremental re-write (${message}) — aborting to avoid stale placeholders; ` +\n          'the next run will full-rebuild',\n      );\n    }\n  });\n};\n\n// ============================================================================\n// Full-Text Search (FTS) Functions\n// ============================================================================\n\n/**\n * Load the FTS extension on the supplied connection (or the singleton\n * writable connection when none is given).\n *\n * Delegates to the shared `ExtensionManager` so install policy (auto /\n * load-only / never), out-of-process bounded INSTALL, and capability","sourceCodeStart":2985,"sourceCodeEnd":3021,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/core/lbug/lbug-adapter.ts#L2985-L3021","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-run `gitnexus analyze` — the dirty flag forces a full rebuild that recreates all synthetic nodes cleanly","Inspect the wrapped `message` for the root LadybugDB error — lock errors mean stop concurrent processes; disk errors mean free space","Use `gitnexus analyze --force` if the error recurs on every incremental run","Verify no other GitNexus process is using the repository"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await clearSpringAutoConfigClassNodes();\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('[spring-auto-configuration]')) {\n    logger.warn('Spring auto-config node clear failed; next run will full-rebuild');\n  }\n  throw e;\n}","preventionTips":["Avoid concurrent process access during incremental writeback","Use `gitnexus analyze --force` if the error is persistent","Verify the LadybugDB version matches GitNexus's expected version"],"tags":["ladybugdb","spring-auto-configuration","incremental-writeback","synthetic-nodes","delete-all"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}