chroma-core/chroma · error · ChromaValueError
maxRetries must be a non-negative integer
Error message
maxRetries must be a non-negative integer
What it means
Parameter validation in conditionalMaxRetries: the maxRetries option for conditional transactions (given either as a number or options object) must be a non-negative integer; negative or fractional values are rejected before retry logic is configured.
Solutions
- Pass a non-negative integer for maxRetries.
- Omit maxRetries to use the default retry count.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at clients/new-js/packages/chromadb/src/collection.ts:1308 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/308d2fa327dba6a2.
Report an issue: GitHub.
Appendix: source
Thrown at clients/new-js/packages/chromadb/src/collection.ts:1308
const name = (error as { name?: unknown })?.name;
return (
name === "ConditionalWriteConflictError" ||
name === "StaleReadError" ||
name === "Backoff"
);
};
const conditionalMaxRetries = (
options?: ConditionalTransactionRunOptions | number,
): number => {
const maxRetries =
typeof options === "number"
? options
: options?.maxRetries ?? DEFAULT_CONDITIONAL_MAX_RETRIES;
if (!Number.isInteger(maxRetries) || maxRetries < 0) {
throw new ChromaValueError("maxRetries must be a non-negative integer");
}
return maxRetries;
};
class ConditionalCollectionTransactionImpl
implements ConditionalCollectionTransaction
{
private readIds = new Set<string>();
private readToken: number | null = null;
private knownPresent = new Set<string>();
private knownAbsent = new Set<string>();
private bufferedWriteIds = new Set<string>();
private operations: ConditionalTransactionOperationPayload[] = [];
private closed = false;
private commitBlockedByRun = false;
private retryableOperationError: unknown;
View on GitHub (pinned to aecdd12c8a)