abhigyanpatwari/GitNexus · error
[spring-aop] failed to clear synthetic evidence before incre
Error message
[spring-aop] failed to clear synthetic evidence before incremental re-write (${message}) — aborting to avoid stale advice metadata; the next run will full-rebuild What it means
Thrown when clearing synthetic Spring AOP evidence (CodeElement nodes) before an incremental re-write fails with a non-benign error. Spring AOP synthetic nodes are injected by GitNexus's Spring analysis pass to represent advice/pointcut relationships; if they can't be cleanly deleted before re-injection, stale advice metadata would persist. The pattern mirrors deleteAllRelationshipsOfType: classifyDeleteAllError checks for 'benign-missing-table' (fresh DB), and anything else re-throws to force a full rebuild on the next run.
Source
Thrown at gitnexus/src/core/lbug/lbug-adapter.ts:2945
`MATCH (n:CodeElement) 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:CodeElement) 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-aop] failed to clear synthetic evidence before incremental re-write ' +
`(${message}) — aborting to avoid stale advice metadata; the next run will full-rebuild`,
);
}
});
};
/**
* Drop Spring-owned auto-configuration `DECLARES` relationships before
* incremental writeback. `DECLARES` is generic, so exact reason filtering is
* required: other metadata systems must retain their own declarations.
*/
export const deleteSpringAutoConfigurationDeclarations = async (): Promise<{
edgesDeleted: number;
}> =>
deleteAllRelationshipsOfType(
'DECLARES',
'spring-auto-configuration',View on GitHub (pinned to d540b00184)
Solutions
- Re-run `gitnexus analyze` — the crash-recovery dirty flag triggers a full rebuild that recreates all nodes from scratch
- Check the wrapped `message` for the specific LadybugDB error to determine if it's a lock (stop concurrent processes), disk (free space), or corruption issue
- If the issue recurs, use `gitnexus analyze --force` to force a clean rebuild from scratch
- Ensure no other GitNexus process (serve, MCP) is accessing the repository during analyze
Defensive patterns
Strategy: retry
Try / catch
try {
await clearSpringAopEvidence();
} catch (e) {
if (e instanceof Error && e.message.startsWith('[spring-aop]')) {
logger.warn('Spring AOP evidence clear failed; next run will full-rebuild');
}
throw e;
} Prevention
- Avoid concurrent process access to the repo during incremental writeback
- Free disk space before re-analyzing Spring projects (AOP nodes add WAL pressure)
- If the error recurs on every run, use `gitnexus analyze --force` to reset incremental state
When it happens
Trigger: During incremental writeback for a repository with Spring AOP annotations, the MATCH (n:CodeElement) WHERE ... DETACH DELETE query fails on a real LadybugDB error — connection lock contention, disk-full WAL write, native crash, or corrupted node state. The predicate filters for Spring-owned synthetic nodes; a failure here means those nodes couldn't be removed.
Common situations: Re-analyzing a Spring Boot project after modifying @Aspect/@Around/@Before annotated code; running incremental analysis while another process holds a lock on the graph; disk pressure during writeback; a corrupted DB state from a previous crashed incremental run where the dirty flag wasn't properly set.
Related errors
- [spring-auto-configuration] failed to clear synthetic Class
- [${logTag}] failed to clear existing ${relType} edges before
- [embed] Failed to delete stale embedding rows — aborting to
- Bridge query prepare failed: ${errMsg}
- Bridge query returned an empty QueryResult array
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/f2c7749fce734632.
Report an issue: GitHub.