Mintplex-Labs/anything-llm · error

Qdrant:getOrCreateCollection Unable to infer vector dimensio

Error message

Qdrant:getOrCreateCollection Unable to infer vector dimension from input. Open an issue on GitHub for support.

What it means

Dimension-inference guard in QDrant.getOrCreateCollection: the collection does not exist yet and no dimensions value could be inferred from the incoming vectors (both null/undefined), so a Qdrant collection cannot be created because its vector dimension is unknown.

Source

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

      return null;
    });
    return !!collection;
  }

  async deleteVectorsInNamespace(client, namespace = null) {
    await client.deleteCollection(namespace);
    return true;
  }

  // QDrant requires a dimension aspect for collection creation
  // we pass this in from the first chunk to infer the dimensions like other
  // providers do.
  async getOrCreateCollection(client, namespace, dimensions = null) {
    if (await this.namespaceExists(client, namespace)) {
      return await client.getCollection(namespace);
    }
    if (!dimensions)
      throw new Error(
        `Qdrant:getOrCreateCollection Unable to infer vector dimension from input. Open an issue on GitHub for support.`
      );
    await client.createCollection(namespace, {
      vectors: {
        size: dimensions,
        distance: "Cosine",
      },
    });
    return await client.getCollection(namespace);
  }

  async addDocumentToNamespace(
    namespace,
    documentData = {},
    fullFilePath = null,
    skipCache = false
  ) {
    const { DocumentVectors } = require("../../../models/vectors");

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Embed at least one document so the vector dimension can be inferred.
  2. Or create the collection with an explicit vector size.
Defensive patterns

Strategy: validation

When it happens

Trigger: QDrant could not infer the vector dimension when auto-creating a collection.

Common situations: This error is raised at runtime in server/utils/vectorDbProviders/qdrant/index.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.


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