{"record":{"id":"4775b8343e27a06e","repo":"open-webui/open-webui","slug":"external-source-collection-is-not-configured","errorCode":null,"errorMessage":"External source collection is not configured","messagePattern":"External source collection is not configured","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"backend/open_webui/retrieval/external.py","lineNumber":103,"sourceCode":"        raise RuntimeError(f'Invalid {label}')\n    return value\n\n\nasync def _retrieve_qdrant(connection, auth_config, knowledge, query, count, embedding_function) -> list[dict]:\n    try:\n        from qdrant_client import QdrantClient\n    except ImportError as exc:\n        raise RuntimeError('qdrant-client is not installed') from exc\n\n    if not embedding_function:\n        raise RuntimeError('Embedding function is not configured')\n\n    config = connection.get('config') or {}\n    external = (knowledge.meta or {}).get('external', {})\n    source = external.get('source') or {}\n    collection_name = source.get('name')\n    if not collection_name:\n        raise RuntimeError('External source collection is not configured')\n    source_config = _source_config(knowledge)\n    vector_field = source_config.get('vector_field') or None\n\n    vector = await embedding_function(query, prefix=RAG_EMBEDDING_QUERY_PREFIX)\n\n    def _search():\n        client = QdrantClient(\n            url=connection.get('endpoint'),\n            api_key=(auth_config or {}).get('api_key'),\n            timeout=config.get('timeout') or 30,\n        )\n        return client.query_points(\n            collection_name=collection_name,\n            query=vector,\n            using=vector_field,\n            limit=count,\n        )\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/open-webui/open-webui/blob/01f4282f1ffe0d6212f58d3afbeae21fffd0c4be/backend/open_webui/retrieval/external.py#L85-L121","documentation":"Raised by _retrieve_qdrant when knowledge.meta.external.source.name is empty or missing. That field names the Qdrant collection to query, so without it the code has no target to run query_points against. It indicates the knowledge model's external metadata was saved incompletely.","triggerScenarios":"A KnowledgeModel whose meta.external exists (with a connection_id) but whose meta.external.source.name is absent, empty, or None, is used in retrieval. Typical when the knowledge entry was created via API/UI without filling the external source collection name, or the meta dict was hand-edited.","commonSituations":"Creating an external knowledge base and skipping the 'collection name' field; importing or migrating knowledge entries with partial meta JSON; frontend bug that submits meta.external without source; renaming/deleting the collection in Qdrant and clearing the field locally.","solutions":["Open the knowledge base settings and set the external source collection name (meta.external.source.name) to an existing Qdrant collection.","If managing via API, PATCH the knowledge entry so meta.external.source.name is a non-empty string matching a live collection in Qdrant.","Verify the collection actually exists: use the Qdrant dashboard or QdrantClient.get_collections() and copy the exact name.","Validate meta.external completeness at knowledge-create/update time so incomplete entries cannot be saved."],"exampleFix":"# before: knowledge meta saved as\nknowledge.meta = {\"external\": {\"connection_id\": \"abc\"}}\n\n# after: include the source collection name\nknowledge.meta = {\n    \"external\": {\n        \"connection_id\": \"abc\",\n        \"source\": {\"name\": \"my_collection\"},\n    },\n}","handlingStrategy":"validation","validationCode":"def external_source_name(knowledge) -> str | None:\n    external = (knowledge.meta or {}).get('external', {})\n    return (external.get('source') or {}).get('name') or None\n\nif external_source_name(knowledge) is None:\n    raise ValueError('Knowledge base needs an external source collection name')","typeGuard":"def has_external_source(knowledge) -> bool:\n    meta = knowledge.meta or {}\n    source = (meta.get('external') or {}).get('source') or {}\n    return bool(source.get('name'))","tryCatchPattern":"try:\n    await retrieve_external_knowledge(request, knowledge, queries, count)\nexcept RuntimeError as e:\n    if 'collection is not configured' in str(e):\n        return fix_knowledge_meta_prompt(knowledge.id)\n    raise","preventionTips":["Make source.name a required field in the external knowledge creation form and API schema.","After creating a collection in Qdrant, copy the exact name immediately into the knowledge config.","Periodically audit knowledge entries for meta.external blocks missing source.name."],"tags":["configuration","qdrant","knowledge-base","metadata","retrieval"],"backgroundTag":null,"analyzedSha":"01f4282f1ffe0d6212f58d3afbeae21fffd0c4be","analyzedAt":"2026-08-14T18:25:22.715Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}