chroma-core/chroma · error · ChromaValueError

transactional read token changed from log upper bound offset

Error message

transactional read token changed from log upper bound offset ${this.readToken} to ${actualReadToken}

What it means

Same OCC staleness guard as the expectedReadToken variant, but comparing against the transaction's stored readToken: a filtered read during a transaction saw a newer/older log offset than the transaction's snapshot, so buffered writes may be based on stale reads.

Solutions

  1. Re-run the transaction to refresh the read token.
  2. Avoid reads after writes that shift the log offset mid-transaction.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at clients/new-js/packages/chromadb/src/collection.ts:1646 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/55ab47a963fcdaca. Report an issue: GitHub.

Appendix: source

Thrown at clients/new-js/packages/chromadb/src/collection.ts:1646

  ): void {
    if (actualReadToken === null || actualReadToken === undefined) {
      throw new ChromaValueError(
        "transactional get response did not include an OCC read token",
      );
    }
    if (!Number.isSafeInteger(actualReadToken) || actualReadToken < 0) {
      throw new ChromaValueError(
        `transactional read token offset ${actualReadToken} is not a safe integer`,
      );
    }
    if (expectedReadToken !== null && expectedReadToken !== actualReadToken) {
      throw new ChromaValueError(
        "transactional read token changed from log upper bound offset " +
          `${expectedReadToken} to ${actualReadToken}`,
      );
    }
    if (this.readToken !== null && this.readToken !== actualReadToken) {
      throw new ChromaValueError(
        "transactional read token changed from log upper bound offset " +
          `${this.readToken} to ${actualReadToken}`,
      );
    }
  }

  private bufferWrite(
    operation: "add",
    ids: string[],
    payload: AddCollectionRecordsPayload,
  ): void;
  private bufferWrite(
    operation: "update",
    ids: string[],
    payload: UpdateCollectionRecordsPayload,
  ): void;
  private bufferWrite(
    operation: "upsert",

View on GitHub (pinned to aecdd12c8a)