{"record":{"id":"4acbdda21f36f71e","repo":"Mintplex-Labs/anything-llm","slug":"namespace-by-that-name-does-not-exist-4acbdd","errorCode":null,"errorMessage":"Namespace by that name does not exist.","messagePattern":"Namespace by that name does not exist\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/vectorDbProviders/qdrant/index.js","lineNumber":396,"sourceCode":"      filterIdentifiers,\n    });\n\n    const sources = sourceDocuments.map((metadata, i) => {\n      return { ...metadata, text: contextTexts[i] };\n    });\n    return {\n      contextTexts,\n      sources: this.curateSources(sources),\n      message: false,\n    };\n  }\n\n  async \"namespace-stats\"(reqBody = {}) {\n    const { namespace = null } = reqBody;\n    if (!namespace) throw new Error(\"namespace required\");\n    const { client } = await this.connect();\n    if (!(await this.namespaceExists(client, namespace)))\n      throw new Error(\"Namespace by that name does not exist.\");\n    const stats = await this.namespace(client, namespace);\n    return stats\n      ? stats\n      : { message: \"No stats were able to be fetched from DB for namespace\" };\n  }\n\n  async \"delete-namespace\"(reqBody = {}) {\n    const { namespace = null } = reqBody;\n    const { client } = await this.connect();\n    if (!(await this.namespaceExists(client, namespace)))\n      throw new Error(\"Namespace by that name does not exist.\");\n\n    const details = await this.namespace(client, namespace);\n    await this.deleteVectorsInNamespace(client, namespace);\n    return {\n      message: `Namespace ${namespace} was deleted along with ${details?.vectorCount} vectors.`,\n    };\n  }","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/vectorDbProviders/qdrant/index.js#L378-L414","documentation":"Thrown by the Qdrant provider's \"namespace-stats\" endpoint. Before returning stats it calls namespaceExists(client, namespace), which wraps Qdrant's collectionExists API; when Qdrant reports no collection with that name, AnythingLLM throws. In Qdrant a \"namespace\" maps to a collection, and collections are only created lazily when the first document is embedded.","triggerScenarios":"Calling 'namespace-stats' with a namespace for which the Qdrant instance has no collection: a workspace that never had documents embedded, a namespace already deleted, a rename/typo/case mismatch in the collection name, or pointing at a different Qdrant instance than the one holding the data.","commonSituations":"Querying stats for a brand-new workspace before any embedding; wrong QDRANT_ENDPOINT/QDRANT_API_KEY so the app sees an empty cluster; deleting a namespace then re-querying it; assuming namespaces are pre-provisioned like in Pinecone/LanceDB when Qdrant creates them on first insert.","solutions":["List collections to verify: curl -H 'api-key: ...' \"$QDRANT_ENDPOINT/collections\" and confirm the namespace appears exactly (case-sensitive)","Embed at least one document into the workspace — the Qdrant collection is created on first vector insert, not up front","Check for name drift between the workspace slug and the actual collection name in the Qdrant dashboard","Confirm the app is pointed at the same Qdrant instance (endpoint/API key) that stores this workspace's data"],"exampleFix":"// before\nconst stats = await qdrant[\"namespace-stats\"]({ namespace: \"my-namespace\" });\n\n// after\nconst { client } = await qdrant.connect();\nif (!(await qdrant.namespaceExists(client, \"my-namespace\"))) {\n  return emptyState(); // no collection yet – nothing embedded\n}\nconst stats = await qdrant[\"namespace-stats\"]({ namespace: \"my-namespace\" });","handlingStrategy":"validation","validationCode":"const { client } = await qdrant.connect();\nif (!(await qdrant.namespaceExists(client, namespace))) {\n  return { message: `Namespace '${namespace}' has no collection yet (nothing embedded).` };\n}\nconst stats = await qdrant[\"namespace-stats\"]({ namespace });","typeGuard":null,"tryCatchPattern":"try {\n  const stats = await provider[\"namespace-stats\"]({ namespace });\n} catch (e) {\n  if (/does not exist/i.test(e.message)) return renderEmptyWorkspaceState(namespace);\n  throw e; // real transport error — surface it\n}","preventionTips":["Treat a missing namespace as an empty state: call namespaceExists before stats/delete UI actions","Remember namespaces are lazy in Qdrant — embed one document before surfacing stats or delete affordances","Never assume cross-provider namespace semantics; guard existence checks per provider"],"tags":["qdrant","vector-db","namespace","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}