{"record":{"id":"cd8eca44a27d8f81","repo":"zylon-ai/private-gpt","slug":"vector-store-for-collection-collection-not-found","errorCode":null,"errorMessage":"Vector store for collection {collection} not found","messagePattern":"Vector store for collection (.+?) not found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/node_store/node_store_component.py","lineNumber":113,"sourceCode":"                f\"Available: {available}\"\n            )\n        return provider(self._settings, collection)\n\n    @property\n    def max_nodes(self) -> int | None:\n        return self._settings.data.max_num_nodes or None\n\n    def get_nodes(\n        self,\n        collection: str,\n        artifacts: list[str] | None = None,\n        node_ids: list[str] | None = None,\n        filters: MetadataFilters | None = None,\n        limit: int | None = None,\n    ) -> list[BaseNode]:\n        vector_store = self._vector_store_component.vector_store(collection)\n        if vector_store is None:\n            raise ValueError(f\"Vector store for collection {collection} not found\")\n        if not hasattr(vector_store, \"get_nodes\"):\n            raise ValueError(\n                f\"Vector store for collection {collection} does not support get_nodes\"\n            )\n\n        if artifacts:\n            artifact_filters = MetadataFilters(\n                filters=[\n                    MetadataFilter(key=MetadataKeys.ARTIFACT_ID.value, value=artifact)\n                    for artifact in artifacts\n                ],\n                condition=FilterCondition.OR,\n            )\n            filters = (\n                MetadataFilters(\n                    filters=[filters, artifact_filters],\n                    condition=FilterCondition.AND,\n                )","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/node_store/node_store_component.py#L95-L131","documentation":"`NodeStoreComponent.get_nodes(collection, ...)` asks `VectorStoreComponent.vector_store(collection)` for the store and raises `ValueError` when it returns None — i.e. no vector store instance exists for that collection name. The factory layer returns None rather than raising for unknown collections, and this component converts that into an explicit error naming the collection.","triggerScenarios":"Calling `get_nodes` with a collection name that was never created/registered (typo, not yet ingested); querying a collection before any ingestion created it; multitenancy setups where the collection key is namespaced differently than expected.","commonSituations":"Querying a per-user or per-tenant collection before the tenant has ingested anything; typos in collection names from request parameters; environments where collections are created lazily on first ingest.","solutions":["Verify the collection exists (list collections on the vector store backend) and correct the name","Ingest documents into the collection first so the store is created","Guard callers: check `vector_store_component.vector_store(collection) is not None` before calling `get_nodes` and return an empty result if appropriate"],"exampleFix":"// before\nnodes = node_store.get_nodes(collection=\"typo-collection\")\n\n// after\nstore = vector_store_component.vector_store(collection)\nif store is None:\n    return []  # or create/ingest the collection first\nnodes = node_store.get_nodes(collection=collection)","handlingStrategy":"validation","validationCode":"if vector_store_component.vector_store(collection) is None:\n    raise KeyError(f\"collection {collection!r} has no vector store; ingest first\")","typeGuard":"def collection_has_store(vsc: Any, collection: str) -> bool:\n    return vsc.vector_store(collection) is not None","tryCatchPattern":"try:\n    nodes = node_store.get_nodes(collection, ...)\nexcept ValueError as e:\n    if \"not found\" in str(e):\n        return []  # unknown collection -> empty result for read paths\n    raise","preventionTips":["Normalize collection names at the API boundary (validate/trim/lower) before lookup","For read paths, treat missing collections as empty rather than errors"],"tags":["vector-store","collection","not-found","retrieval"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}