{"record":{"id":"57f28efa16f6e2bf","repo":"zeroclaw-labs/zeroclaw","slug":"qdrant-connection-failed-e","errorCode":null,"errorMessage":"Qdrant connection failed: {e}","messagePattern":"Qdrant connection failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-memory/src/qdrant.rs","lineNumber":249,"sourceCode":"            )\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),\n            )\n            .json(&create_body)\n            .send()","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-memory/src/qdrant.rs#L231-L267","documentation":"The HTTP request behind the collection-existence check never completed — reqwest returned a transport error (connection refused, DNS failure, TLS handshake), meaning zeroclaw could not reach Qdrant at all. Raised in ensure_collection during store construction or ensure_initialized; note that with a noop embedder (0 dimensions) the whole check is skipped, so this error implies a real embedder is configured.","triggerScenarios":"Qdrant not running or listening on another host/port; wrong scheme (https against a plain HTTP port); DNS name not resolving; firewall/network policy dropping the connection — any condition where the GET /collections/{name} request itself errors.","commonSituations":"Local dev without Qdrant started (localhost:6333 refused); Docker networking mismatches between services; typo'd URLs; TLS mismatch against Qdrant Cloud; the REST URL pointing at the gRPC port.","solutions":["Reachability-check the URL from the same host: `curl http://<host>:6333/collections` should answer.","Fix `url` in `[storage.qdrant.<alias>]`: correct host, REST port (6333), and scheme; use https with a valid certificate for cloud endpoints.","Start Qdrant (or fix DNS/firewall) so the connection can be established, then restart the service so ensure_collection retries."],"exampleFix":"# before\n[storage.qdrant.prod]\nurl = \"http://localhost:6334\"  # wrong port (gRPC)\n\n# after\n[storage.qdrant.prod]\nurl = \"http://localhost:6333\"  # REST port","handlingStrategy":"retry","validationCode":"// Cheap reachability probe before constructing the qdrant store\nlet resp = reqwest::Client::builder()\n    .timeout(Duration::from_secs(3))\n    .build()?\n    .get(format!(\"{url}/collections\"))\n    .send()\n    .await;\nif resp.is_err() {\n    anyhow::bail!(\"qdrant at {url} is unreachable; check host/port/scheme\");\n}","typeGuard":null,"tryCatchPattern":"let mut attempt = 0;\nloop {\n    attempt += 1;\n    match ensure_store(&qdrant_cfg).await {\n        Ok(store) => break store,\n        Err(e) if e.to_string().contains(\"Qdrant connection failed\") && attempt < 5 => {\n            tokio::time::sleep(Duration::from_millis(500 * u64::from(attempt))).await;\n        }\n        Err(e) => break Err(e),\n    }\n}","preventionTips":["Start Qdrant before (or as a dependency of) the zeroclaw service in compose/systemd ordering.","Probe the REST endpoint (typically :6333/collections) in readiness checks so connection problems surface in health endpoints.","Verify the scheme matches the listener — https against a plain HTTP Qdrant port produces this transport error."],"tags":["qdrant","network","connection","initialization","vector-db"],"backgroundTag":"connection-refused","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}