diegosouzapw/OmniRoute · error · Error

Failed to create collection

Error message

Failed to create collection (${createRes.status})

What it means

ensureCollection(): the Qdrant GET showed the collection does not exist and the follow-up PUT to create it returned a non-2xx status (with the status code in the message); points cannot be upserted or searched until creation succeeds.

Solutions

  1. Retry — Qdrant returns 409/5xx transiently during create
  2. Check the Qdrant server logs for the rejected collection config (bad quantization/dimension)
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/memory/qdrant.ts:258 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/fdaee1879563360a. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/memory/qdrant.ts:258

  const getRes = await qdrantFetch(cfg, `/collections/${encodeURIComponent(cfg.collection)}`, {
    method: "GET",
  });
  if (getRes.ok) return;

  // Quantization only applies to NEW collections — an existing collection is left
  // untouched (the GET above returns early). Switching modes on a populated
  // collection is a destructive recreate+reindex that must be an explicit UI action.
  const quantizationConfig = buildQuantizationConfig(cfg.quantization);
  const createRes = await qdrantFetch(cfg, `/collections/${encodeURIComponent(cfg.collection)}`, {
    method: "PUT",
    body: JSON.stringify({
      vectors: { size: vectorSize, distance: "Cosine" },
      ...(quantizationConfig ? { quantization_config: quantizationConfig } : {}),
    }),
  });
  if (!createRes.ok) {
    const text = await createRes.text().catch(() => "");
    throw new Error(text.slice(0, 300) || `Failed to create collection (${createRes.status})`);
  }
}

async function getCollectionVectorName(cfg: QdrantConfig): Promise<string | null> {
  const res = await qdrantFetch(cfg, `/collections/${encodeURIComponent(cfg.collection)}`, {
    method: "GET",
  });
  if (!res.ok) return null;
  const data = (await res.json().catch(() => null)) as any;
  const vectors = data?.result?.config?.params?.vectors;
  if (!vectors || typeof vectors !== "object" || Array.isArray(vectors)) {
    return null;
  }
  // Unnamed/single-vector config: { size, distance, ... } (not a named map)
  if (
    Object.prototype.hasOwnProperty.call(vectors, "size") &&
    (typeof vectors.size === "number" || typeof vectors.size === "string")
  ) {

View on GitHub (pinned to a179ffed5b)