abhigyanpatwari/GitNexus · warning · GitNexusRcError
: branch name is too long (max ).
Error message
${source}: branch name is too long (max ${BRANCH_MAX_LENGTH}). What it means
During the bulk COPY of relationship CSVs into LadybugDB, the buffer pool (poolLabel) was exhausted and the pair failed over to the row-by-row fallback with retry. The remedy is logged via logger.warn exactly once per bulk load (poolRemedyIssued, issue #2631) instead of once per pair, because exhaustion repeats for every remaining pair once it starts — and the returned warnings array has no consumer at any call site, so a push alone would be invisible.
Solutions
- Raise the pool: GITNEXUS_LBUG_BUFFER_POOL_SIZE=4294967296 (4 GiB) for large repos
- Or restore the native default sizing: GITNEXUS_LBUG_BUFFER_POOL_SIZE=0 (80% of RAM)
- Verify the value is in BYTES — 4294967296, not 4
- Expect slower load even after the fix if disk-bound; the row-by-row fallback path is much slower than COPY, so prefer fixing the pool size
Example fix
# before export GITNEXUS_LBUG_BUFFER_POOL_SIZE=4 # 4 BYTES, not 4 GiB — pool starved # after export GITNEXUS_LBUG_BUFFER_POOL_SIZE=4294967296 # 4 GiB in bytes # or: export GITNEXUS_LBUG_BUFFER_POOL_SIZE=0 # native 80%-of-RAM default
Defensive patterns
Strategy: fallback
Validate before calling
// before a large bulk load: validate the env early instead of relying on the soft fallback
const raw = process.env.GITNEXUS_LBUG_BUFFER_POOL_SIZE;
if (raw !== undefined && raw.trim() !== '') {
const n = Number(raw);
if (!Number.isInteger(n) || n < 0) delete process.env.GITNEXUS_LBUG_BUFFER_POOL_SIZE; // drop malformed value
}
// size for the workload: large repos want 4 GiB+
process.env.GITNEXUS_LBUG_BUFFER_POOL_SIZE ??= String(4 * 1024 * 1024 * 1024); Prevention
- Always specify the pool size in raw bytes, never with unit suffixes
- Watch stderr for the remedy warn — the returned warnings array has no consumer, so logs are the only signal
- For monorepo-scale edge counts, pre-set 4 GiB or 0 (native) rather than absorbing the slow row-by-row fallback
When it happens
Trigger: copyCsvWithRetry fails with a buffer-pool-exhaustion message (detected by bufferPoolExhaustionRemedy) while bulk-loading a large relationship batch — total edge working set exceeds the pool ceiling (default 2 GiB; GITNEXUS_LBUG_BUFFER_POOL_SIZE caps it, 0 restores LadybugDB's native 80%-of-RAM default).
Common situations: Monorepo-scale graphs with tens of millions of relationships loaded in one analyze; CI runners with modest RAM where the 2 GiB default ceiling is the constraint; setting a pool size in bytes incorrectly (e.g. assuming MB).
Related errors
- COPY failed for : ` : ''}
- [lbug-load] node COPY also failed while relationship emit…
- must be a boolean (true/false).
- Analyze stopped before running out of memory
- Batch execution failed for rows
AI-assisted analysis of abhigyanpatwari/GitNexus@52924ef12c (2026-08-20).
Data as JSON: /api/errors/fbdf839cadbd7801.
Report an issue: GitHub.
Appendix: source
Thrown at gitnexus/src/cli/analyze-config.ts:169
throw new GitNexusRcError(
`${source}: value contains control or hidden/bidirectional characters, which are not allowed.`,
);
}
}
};
/**
* Validate a user-supplied branch name (from CLI or `.gitnexusrc`). Returns the
* trimmed name or throws {@link GitNexusRcError}. Conservative but accepts the
* shapes real branches use (`feature/foo-bar`, `release/1.2`, `develop`).
*/
export function validateBranchName(value: string, source: string): string {
const trimmed = value.trim();
if (!trimmed) {
throw new GitNexusRcError(`${source}: branch name must not be empty.`);
}
if (trimmed.length > BRANCH_MAX_LENGTH) {
throw new GitNexusRcError(`${source}: branch name is too long (max ${BRANCH_MAX_LENGTH}).`);
}
assertNoHiddenChars(trimmed, source);
if (/\s/.test(trimmed)) {
throw new GitNexusRcError(`${source}: branch name must not contain whitespace.`);
}
// git ref-name rules (subset): reject characters git itself forbids in refs.
if (/[~^:?*[\\]/.test(trimmed)) {
throw new GitNexusRcError(
`${source}: branch name contains characters not allowed in a git ref (~ ^ : ? * [ \\).`,
);
}
if (trimmed.startsWith('-')) {
throw new GitNexusRcError(`${source}: branch name must not start with "-".`);
}
if (trimmed.includes('..')) {
throw new GitNexusRcError(`${source}: branch name must not contain "..".`);
}
// Git permits a backtick in a ref, but the branch is embedded inside aView on GitHub (pinned to 52924ef12c)