{"record":{"id":"8602bc1c1016c12f","repo":"zeroclaw-labs/zeroclaw","slug":"qdrant-collection-check-failed-status-text","errorCode":null,"errorMessage":"Qdrant collection check failed ({status}): {text}","messagePattern":"Qdrant collection check failed \\((.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-memory/src/qdrant.rs","lineNumber":246,"sourceCode":"            .request(\n                reqwest::Method::GET,\n                &format!(\"/collections/{}\", self.collection),\n            )\n            .send()\n            .await;\n\n        match resp {\n            Ok(r) if r.status().is_success() => {\n                // Collection exists\n                return Ok(());\n            }\n            Ok(r) if r.status().as_u16() == 404 => {\n                // Collection doesn't exist, create it\n            }\n            Ok(r) => {\n                let status = r.status();\n                let text = r.text().await.unwrap_or_default();\n                anyhow::bail!(\"Qdrant collection check failed ({status}): {text}\");\n            }\n            Err(e) => {\n                anyhow::bail!(\"Qdrant connection failed: {e}\");\n            }\n        }\n\n        // Create collection with vector config\n        let create_body = serde_json::json!({\n            \"vectors\": {\n                \"size\": dims,\n                \"distance\": \"Cosine\"\n            }\n        });\n\n        let resp = self\n            .request(\n                reqwest::Method::PUT,\n                &format!(\"/collections/{}\", self.collection),","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-memory/src/qdrant.rs#L228-L264","documentation":"QdrantMemory::ensure_collection probes GET /collections/{name} at construction (new_lazy / ensure_initialized); any probe response that is neither success nor 404 aborts initialization. 404 is the expected \"collection missing, create it\" signal — every other status (401/403/400/5xx) fails with the status and body, because the follow-up create would fail the same way.","triggerScenarios":"Constructing the qdrant memory store with an invalid API key (401/403), an invalid collection name (400), or while Qdrant errors server-side (5xx) — but where the HTTP connection itself succeeds, distinguishing it from the connection-failed variant.","commonSituations":"Qdrant Cloud API keys scoped to the wrong project; collection names with characters Qdrant rejects; reverse proxies answering 502/503 before Qdrant sees the request; Qdrant node in maintenance mode.","solutions":["Map the status to a fix: 401/403 → correct api_key in [storage.qdrant.<alias>]; 400 → fix the collection name; 5xx → wait/retry or inspect Qdrant logs.","Confirm the URL hits Qdrant's REST port (typically 6333), not the gRPC port, and that no proxy intercepts it.","If auto-create is blocked by permissions, create the collection manually with the vector size/distance config the store expects (size = embedder dimensions, Cosine)."],"exampleFix":"# preflight the exact request the store makes\n$ curl -H \"api-key: $QDRANT_KEY\" \\\n    http://qdrant-host:6333/collections/zeroclaw_memories\n# expect 200 (exists) or 404 (will be created); anything else matches this error","handlingStrategy":"try-catch","validationCode":"// Preflight the same request ensure_collection makes\nlet resp = reqwest::Client::new()\n    .get(format!(\"{url}/collections/{collection}\"))\n    .header(\"api-key\", api_key)\n    .send()\n    .await?;\nmatch resp.status().as_u16() {\n    200 | 404 => Ok(()), // exists, or will be created\n    code => anyhow::bail!(\"qdrant preflight failed with {code}\"),\n}","typeGuard":null,"tryCatchPattern":"let memory = match QdrantMemory::new_lazy(\"qdrant\", &url, &collection, api_key, embedder) {\n    m => match m.ensure_initialized().await {\n        Ok(()) => m,\n        Err(e) if e.to_string().contains(\"collection check failed\") => {\n            return Err(e.context(\"check api_key/collection name in [storage.qdrant.<alias>]\"));\n        }\n        Err(e) => return Err(e),\n    },\n};","preventionTips":["Add a startup dependency check that curls GET /collections/{name} (expect 200 or 404) before constructing the memory store.","Keep qdrant url, api_key, and collection in one [storage.qdrant.<alias>] block so credentials and collection cannot drift apart."],"tags":["qdrant","http","collection","initialization","vector-db"],"backgroundTag":"http-error-response","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}