{"record":{"id":"469f5280092bc2ab","repo":"chroma-core/chroma","slug":"you-must-set-a-data-loader-on-the-collection-if-lo","errorCode":null,"errorMessage":"You must set a data loader on the collection if loading from URIs.","messagePattern":"You must set a data loader on the collection if loading from URIs\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/models/CollectionCommon.py","lineNumber":277,"sourceCode":"        self,\n        ids: Optional[OneOrMany[ID]],\n        where: Optional[Where],\n        where_document: Optional[WhereDocument],\n        include: Include,\n    ) -> GetRequest:\n        # Unpack\n        unpacked_ids: Optional[IDs] = maybe_cast_one_to_many(target=ids)\n        filters = FilterSet(where=where, where_document=where_document)\n\n        # Validate\n        if unpacked_ids is not None:\n            validate_ids(ids=unpacked_ids)\n\n        validate_filter_set(filter_set=filters)\n        validate_include(include=include, dissalowed=[\"distances\"])\n\n        if \"data\" in include and self._data_loader is None:\n            raise ValueError(\n                \"You must set a data loader on the collection if loading from URIs.\"\n            )\n\n        # Prepare\n        request_include = include\n        # We need to include uris in the result from the API to load datas\n        if \"data\" in include and \"uris\" not in include:\n            request_include.append(\"uris\")\n\n        return GetRequest(\n            ids=unpacked_ids,\n            where=filters[\"where\"],\n            where_document=filters[\"where_document\"],\n            include=request_include,\n        )\n\n    @validation_context(\"query\")\n    def _validate_and_prepare_query_request(","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/models/CollectionCommon.py#L259-L295","documentation":"`collection.get(include=[..., \"data\"])` asks Chroma to load the raw content behind each stored URI. The collection must have a DataLoader configured (passed at creation via `data_loader=`); without one, Chroma has no way to fetch URI contents, so the request is rejected before reaching the server.","triggerScenarios":"Calling `get()` (or `query()`) with `include` containing \"data\" on a collection created without `data_loader=`, e.g. `client.get_or_create_collection(name=\"docs\")`.","commonSituations":"Adding `include=[\"data\"]` to an existing get call after following an example that assumes a data loader, or creating the collection in one place (without the loader) and reading `data` in another.","solutions":["Pass a data loader when creating/getting the collection: `client.get_or_create_collection(name=\"docs\", data_loader=DefaultDataLoader())`","Use a custom DataLoader (e.g. from chromadb.utils.data_loaders) matching your storage backend","Drop \"data\" from include and fetch the URIs yourself, then load content with your own I/O"],"exampleFix":"# before\ncol = client.get_or_create_collection(name=\"docs\")\ncol.get(include=[\"uris\", \"data\"])  # ValueError\n\n# after\nfrom chromadb.utils.data_loaders import DefaultDataLoader\ncol = client.get_or_create_collection(name=\"docs\", data_loader=DefaultDataLoader())\ncol.get(include=[\"uris\", \"data\"])","handlingStrategy":"validation","validationCode":"include = [\"metadatas\", \"documents\"]\nwants_data = \"data\" in include\n# track loader presence at creation time in your own wrapper\nif wants_data and not collection_has_data_loader:\n    include = [f for f in include if f != \"data\"]  # or raise/report early\ncollection.get(include=include)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always create URI-backed collections with data_loader= so 'data' include is always valid","Centralize collection creation in one factory that decides whether a data loader is attached","Request 'uris' first, load content yourself, if you do not want a loader dependency"],"tags":["data-loader","uris","get","collection-config"],"backgroundTag":"missing-data-loader","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}