Mintplex-Labs/anything-llm · error

Namespace by that name does not exist.

Error message

Namespace by that name does not exist.

What it means

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.

Source

Thrown at server/utils/vectorDbProviders/qdrant/index.js:396

      filterIdentifiers,
    });

    const sources = sourceDocuments.map((metadata, i) => {
      return { ...metadata, text: contextTexts[i] };
    });
    return {
      contextTexts,
      sources: this.curateSources(sources),
      message: false,
    };
  }

  async "namespace-stats"(reqBody = {}) {
    const { namespace = null } = reqBody;
    if (!namespace) throw new Error("namespace required");
    const { client } = await this.connect();
    if (!(await this.namespaceExists(client, namespace)))
      throw new Error("Namespace by that name does not exist.");
    const stats = await this.namespace(client, namespace);
    return stats
      ? stats
      : { message: "No stats were able to be fetched from DB for namespace" };
  }

  async "delete-namespace"(reqBody = {}) {
    const { namespace = null } = reqBody;
    const { client } = await this.connect();
    if (!(await this.namespaceExists(client, namespace)))
      throw new Error("Namespace by that name does not exist.");

    const details = await this.namespace(client, namespace);
    await this.deleteVectorsInNamespace(client, namespace);
    return {
      message: `Namespace ${namespace} was deleted along with ${details?.vectorCount} vectors.`,
    };
  }

View on GitHub (pinned to 3aec848f28)

Solutions

  1. List collections to verify: curl -H 'api-key: ...' "$QDRANT_ENDPOINT/collections" and confirm the namespace appears exactly (case-sensitive)
  2. Embed at least one document into the workspace — the Qdrant collection is created on first vector insert, not up front
  3. Check for name drift between the workspace slug and the actual collection name in the Qdrant dashboard
  4. Confirm the app is pointed at the same Qdrant instance (endpoint/API key) that stores this workspace's data

Example fix

// before
const stats = await qdrant["namespace-stats"]({ namespace: "my-namespace" });

// after
const { client } = await qdrant.connect();
if (!(await qdrant.namespaceExists(client, "my-namespace"))) {
  return emptyState(); // no collection yet – nothing embedded
}
const stats = await qdrant["namespace-stats"]({ namespace: "my-namespace" });
Defensive patterns

Strategy: validation

Validate before calling

const { client } = await qdrant.connect();
if (!(await qdrant.namespaceExists(client, namespace))) {
  return { message: `Namespace '${namespace}' has no collection yet (nothing embedded).` };
}
const stats = await qdrant["namespace-stats"]({ namespace });

Try / catch

try {
  const stats = await provider["namespace-stats"]({ namespace });
} catch (e) {
  if (/does not exist/i.test(e.message)) return renderEmptyWorkspaceState(namespace);
  throw e; // real transport error — surface it
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/4acbdda21f36f71e. Report an issue: GitHub.