{"record":{"id":"12ffcecf8b1b38ed","repo":"zeroclaw-labs/zeroclaw","slug":"qdrant-set-payload-failed-during-agent-rename-st","errorCode":null,"errorMessage":"Qdrant set payload failed during agent rename ({status}): {text}","messagePattern":"Qdrant set payload failed during agent rename \\((.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-memory/src/qdrant.rs","lineNumber":867,"sourceCode":"        }\n        let body = serde_json::json!({\n            \"payload\": { \"agent_id\": to },\n            \"filter\": Self::must_filter(&[(\"agent_id\", from)]),\n        });\n        let resp = self\n            .request(\n                reqwest::Method::POST,\n                &format!(\"/collections/{}/points/payload\", self.collection),\n            )\n            .query(&[(\"wait\", \"true\")])\n            .json(&body)\n            .send()\n            .await\n            .context(\"failed to set payload during Qdrant agent rename\")?;\n        if !resp.status().is_success() {\n            let status = resp.status();\n            let text = resp.text().await.unwrap_or_default();\n            anyhow::bail!(\"Qdrant set payload failed during agent rename ({status}): {text}\");\n        }\n        Ok(matches)\n    }\n\n    async fn count_agent(&self, agent_alias: &str) -> Result<usize> {\n        // Qdrant keys memory points by the alias in the `agent_id` payload field,\n        // so `rename_agent` re-points exactly the points `list_for_agents` returns;\n        // residue is that match count.\n        Ok(self\n            .list_for_agents(&[agent_alias], None, None)\n            .await?\n            .len())\n    }\n\n    async fn count(&self) -> Result<usize> {\n        self.ensure_initialized().await?;\n\n        let resp = self","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-memory/src/qdrant.rs#L849-L885","documentation":"QdrantMemory::rename_agent scrolls points whose agent_id payload equals the old alias and rewrites them to the new alias via set-payload. This error means that set-payload call returned non-2xx partway through the rename.","triggerScenarios":"404 collection missing; 400 from an empty/invalid match list; concurrent deletes removing points between scroll and set-payload; 5xx.","commonSituations":"Renaming an agent while its memories are being purged; renaming against a dropped collection; Qdrant briefly unavailable mid-rename.","solutions":["Retry rename_agent — it re-scrolls and rewrites whatever still matches (idempotent)","404: recreate the collection and restart so init re-runs","Avoid concurrent forget/purge on the same agent during a rename","5xx: wait for readyz then retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Skip renames that cannot matter\nif memory.count_agent(from).await? == 0 { return Ok(0); } // nothing to re-point","typeGuard":"fn is_rename_set_payload_error(e: &anyhow::Error) -> bool {\n    e.to_string().starts_with(\"Qdrant set payload failed during agent rename\")\n}","tryCatchPattern":"match memory.rename_agent(from, to).await {\n    Err(e) if is_rename_set_payload_error(&e) => { sleep(backoff).await; memory.rename_agent(from, to).await } // idempotent re-scroll+rewrite\n    other => other,\n}","preventionTips":["Retry renames — they recompute matches each attempt","Don't purge an agent's memories concurrently with its rename","Health-check Qdrant before admin operations"],"tags":["qdrant","set-payload","agent-rename","http-status","rust"],"backgroundTag":"qdrant-api-error","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}