chroma-core/chroma · error · ValueError

Record does not contain any non-None fields that can be embe

Error message

Record does not contain any non-None fields that can be embedded.Embeddable Fields: {embeddable_fields}Record Fields: {record_set}

What it means

`_embed_fields` walks the embeddable fields (documents, uris, schema text fields) looking for the first non-None one to embed. If every embeddable field in the record set is None, there is nothing to embed and the request is rejected. The message lists the embeddable fields it tried and the full record set for diagnosis.

Source

Thrown at chromadb/api/models/CollectionCommon.py:740

        for field in embeddable_fields:
            if record_set[field] is not None:  # type: ignore[literal-required]
                # uris require special handling
                if field == "uris":
                    if self._data_loader is None:
                        raise ValueError(
                            "You must set a data loader on the collection if loading from URIs."
                        )
                    return self._embed(
                        input=self._data_loader(uris=cast(URIs, record_set[field])),  # type: ignore[literal-required]
                        is_query=is_query,
                    )
                else:
                    return self._embed(
                        input=record_set[field],  # type: ignore[literal-required]
                        is_query=is_query,
                    )
        raise ValueError(
            "Record does not contain any non-None fields that can be embedded."
            f"Embeddable Fields: {embeddable_fields}"
            f"Record Fields: {record_set}"
        )

    def _embed(self, input: Any, is_query: bool = False) -> Embeddings:
        if self._embedding_function is not None and not isinstance(
            self._embedding_function, DefaultEmbeddingFunction
        ):
            if is_query:
                return self._embedding_function.embed_query(input=input)
            else:
                return self._embedding_function(input=input)

        config_ef = self.configuration.get("embedding_function")
        if config_ef is not None:
            if is_query:
                return config_ef.embed_query(input=input)

View on GitHub (pinned to aecdd12c8a)

Solutions

  1. Include at least one embeddable field per record (documents, uris with a data loader, or a schema text field)
  2. Pass precomputed embeddings if you do not want client-side embedding
  3. Log/inspect the record set before sending: assert at least one embeddable key is non-None

Example fix

# before
col.upsert(records={"ids": ["1"], "documents": [None]})  # nothing embeddable

# after
col.upsert(records={"ids": ["1"], "documents": ["hello world"]})
Defensive patterns

Strategy: validation

Validate before calling

EMBEDDABLE = ("documents", "uris")
has_content = any(records.get(f) is not None for f in EMBEDDABLE) or bool(schema_text_fields & set(records))
if not has_content:
    raise ValueError("records need documents/uris (or embeddings) to upsert")
collection.upsert(records=records)

Prevention

When it happens

Trigger: `collection.upsert`/`add`/`query` with records that contain only ids and/or metadata — documents=None, uris=None, and no schema text fields populated.

Common situations: Building records dynamically where the documents field is dropped or named incorrectly; sending id/metadata-only records expecting server-side embedding of nothing.

Related errors


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/ee3d73c0ab653fff. Report an issue: GitHub.