{"record":{"id":"d4dd32528162a659","repo":"zeroclaw-labs/zeroclaw","slug":"memory-backend-postgres-requires-a-storage-pos","errorCode":null,"errorMessage":"memory backend 'postgres' requires a `[storage.postgres.<alias>]` entry referenced by `memory.backend = \"postgres.<alias>\"`","messagePattern":"memory backend 'postgres' requires a `\\[storage\\.postgres\\.<alias>\\]` entry referenced by `memory\\.backend = \"postgres\\.<alias>\"`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-memory/src/lib.rs","lineNumber":719,"sourceCode":"            INFO,\n            ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Note),\n            &format!(\n                \"📦 Qdrant memory backend configured (url: {}, collection: {})\",\n                url, collection\n            )\n        );\n        return wrap_scanned_and_audit(\n            QdrantMemory::new_lazy(\"qdrant\", &url, &collection, qdrant_api_key, embedder),\n            &config.policy,\n            workspace_dir,\n            config.audit_enabled,\n        );\n    }\n\n    if matches!(backend_kind, MemoryBackendKind::Postgres) {\n        let pg_cfg = match active_storage {\n            ActiveStorage::Postgres(p) => p,\n            _ => anyhow::bail!(\n                \"memory backend 'postgres' requires a `[storage.postgres.<alias>]` entry \\\n                 referenced by `memory.backend = \\\"postgres.<alias>\\\"`\"\n            ),\n        };\n        #[cfg(feature = \"memory-postgres\")]\n        {\n            return wrap_scanned_and_audit(\n                build_postgres_memory(pg_cfg)?,\n                &config.policy,\n                workspace_dir,\n                config.audit_enabled,\n            );\n        }\n        #[cfg(not(feature = \"memory-postgres\"))]\n        {\n            return build_postgres_memory(pg_cfg);\n        }\n    }","sourceCodeStart":701,"sourceCodeEnd":737,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-memory/src/lib.rs#L701-L737","documentation":"The postgres mirror of the qdrant alias check: the backend classified as postgres, but the resolved active storage is not an ActiveStorage::Postgres entry, so the [storage.postgres.<alias>] section with connection settings was never found. The factory refuses to guess connection parameters and names the required TOML shape.","triggerScenarios":"`memory.backend = \"postgres.main\"` while `[storage.postgres.main]` does not exist, is typo'd, or sits under another family ([storage.qdrant.main]). Note this check runs before the feature check, so it can also fire on builds lacking memory-postgres when the section is absent.","commonSituations":"Renaming storage aliases without updating memory.backend; config overlays stripping the [storage.postgres.*] section in lower environments; migrating a sqlite deployment to postgres by editing only the memory.backend line.","solutions":["Add `[storage.postgres.<alias>]` with the connection settings (host/database/credentials per the storage config schema) and align `memory.backend = \"postgres.<alias>\"`.","Fix the alias mismatch between memory.backend's suffix and the TOML section name.","Confirm the section is under the postgres family, not another storage family."],"exampleFix":"# before\n[memory]\nbackend = \"postgres.main\"\n\n# after\n[memory]\nbackend = \"postgres.main\"\n\n[storage.postgres.main]\ndatabase_url = \"postgres://user:pass@localhost/zeroclaw\"","handlingStrategy":"validation","validationCode":"let backend = backend_kind_from_dotted(&config.memory.backend);\nif backend == \"postgres\"\n    && !matches!(config.resolve_active_storage(), ActiveStorage::Postgres(_))\n{\n    anyhow::bail!(\n        \"memory.backend = {:?} has no matching [storage.postgres.<alias>] section\",\n        config.memory.backend\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the dotted alias against the storage tables at config load time.","When migrating a deployment to postgres, edit both memory.backend and add the [storage.postgres.<alias>] section in the same change.","CI smoke test every environment config through create_memory_from_config."],"tags":["postgres","config","storage-alias","toplevel-config"],"backgroundTag":"missing-config-section","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}