chroma-core/chroma · error · ValueError

Expected images to be a non-empty list, got

Error message

Expected images to be a non-empty list, got {len(images)} images

What it means

Raised by chromadb.api.types.validate_images when the images argument is a list but contains zero entries. Record validation requires at least one image when an images field is supplied.

Solutions

  1. Supply at least one image, or omit the images argument.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at chromadb/api/types.py:1463 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/0a82861b5e02c479. Report an issue: GitHub.

Appendix: source

Thrown at chromadb/api/types.py:1463

        )
    if len(documents) == 0:
        raise ValueError(
            f"Expected documents to be a non-empty list, got {len(documents)} documents"
        )
    for document in documents:
        # If embeddings are present, some documents can be None
        if document is None and nullable:
            continue
        if not is_document(document):
            raise ValueError(f"Expected document to be a str, got {document}")


def validate_images(images: Images) -> None:
    """Validates images to ensure it is a list of numpy arrays"""
    if not isinstance(images, list):
        raise ValueError(f"Expected images to be a list, got {type(images).__name__}")
    if len(images) == 0:
        raise ValueError(
            f"Expected images to be a non-empty list, got {len(images)} images"
        )
    for image in images:
        if not is_image(image):
            raise ValueError(f"Expected image to be a numpy array, got {image}")


def validate_batch(
    batch: Tuple[
        IDs,
        Optional[Union[Embeddings, PyEmbeddings]],
        Optional[Metadatas],
        Optional[Documents],
        Optional[URIs],
    ],
    limits: Dict[str, Any],
) -> None:
    if len(batch[0]) > limits["max_batch_size"]:

View on GitHub (pinned to aecdd12c8a)