{"record":{"id":"cba2b06cc1a85c01","repo":"zeroclaw-labs/zeroclaw","slug":"memory-clear-is-unsupported-for-append-only-backen","errorCode":null,"errorMessage":"memory clear is unsupported for append-only backend '{$backend}'; switch to a deletable backend (sqlite, lucid, or postgres)","messagePattern":"memory clear is unsupported for append-only backend '(.+?)'; switch to a deletable backend \\(sqlite, lucid, or postgres\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/memory/cli.rs","lineNumber":326,"sourceCode":"    {\n        format!(\n            \"memory clear is unsupported for append-only backend '{backend}'; switch to a deletable backend (sqlite, lucid, or postgres)\"\n        )\n    }\n}\n\nasync fn handle_clear(\n    config: &Config,\n    key: Option<String>,\n    category: Option<String>,\n    yes: bool,\n) -> Result<()> {\n    let backend = backend_kind_from_dotted(&config.memory.backend);\n    if matches!(\n        classify_memory_backend(&backend),\n        MemoryBackendKind::Markdown | MemoryBackendKind::Qdrant\n    ) {\n        bail!(unsupported_clear_backend_message(&backend));\n    }\n    let mem = create_cli_memory(config)?;\n\n    // Single-key deletion (exact or prefix match).\n    if let Some(key) = key {\n        return handle_clear_key(&*mem, &key, yes).await;\n    }\n\n    // Batch deletion by category (or all).\n    let cat = category.as_deref().map(parse_category);\n    let entries = mem.list(cat.as_ref(), None).await?;\n\n    if entries.is_empty() {\n        println!(\"{}\", mt(\"cli-memory-none-to-clear\", \"No entries to clear.\"));\n        return Ok(());\n    }\n\n    let scope = category.as_deref().unwrap_or(\"all categories\");","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/src/memory/cli.rs#L308-L344","documentation":"`zeroclaw memory clear` only works on backends that support deletion. Markdown and Qdrant are treated as append-only (classify_memory_backend returns Markdown or Qdrant), so handle_clear bails with a message listing the deletable alternatives (sqlite, lucid, postgres) before doing anything.","triggerScenarios":"Running `zeroclaw memory clear` (with or without a --key) while memory.backend is \"markdown\" or \"qdrant\". The backend-kind check runs before create_cli_memory, so no store is even opened.","commonSituations":"Using the markdown backend for human-readable memory files and expecting clear to prune them; a qdrant-only setup (vector store without a deletable metadata store); following a tutorial written for sqlite while running markdown.","solutions":["Switch memory.backend to a deletable backend (sqlite, lucid, or postgres) and re-run clear","For markdown, delete/prune the memory files manually (they are plain files on disk)","For qdrant, purge the collection with qdrant's own tooling if you truly need a wipe","Keep a deletable backend if your workflow regularly calls memory clear"],"exampleFix":"# before\n[memory]\nbackend = \"markdown\"\nzeroclaw memory clear   # -> unsupported\n\n# after\n[memory]\nbackend = \"sqlite\"\nzeroclaw memory clear","handlingStrategy":"validation","validationCode":"// Same classification the command uses, checked before offering 'clear':\nuse MemoryBackendKind::*;\nmatch classify_memory_backend(&backend_kind_from_dotted(&config.memory.backend)) {\n    Markdown | Qdrant => { /* hide/disable the clear action in your UI */ }\n    _ => { /* safe to run memory clear */ }\n}","typeGuard":"fn supports_clear(kind: MemoryBackendKind) -> bool {\n    !matches!(kind, MemoryBackendKind::Markdown | MemoryBackendKind::Qdrant)\n}","tryCatchPattern":"// Catch the bail and route to guidance: for Markdown offer file deletion,\n// for Qdrant offer collection purge — do not retry clear on the same backend.","preventionTips":["Pick sqlite/lucid/postgres when your workflow needs deletion","Automate markdown pruning outside zeroclaw if you keep that backend","Keep the deletable-backend list (sqlite, lucid, postgres) in operator runbooks"],"tags":["memory","cli","unsupported-operation","backend"],"backgroundTag":"unsupported-backend-operation","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}