{"record":{"id":"bf0a6f8f9baa2e1c","repo":"risingwavelabs/risingwave","slug":"use-the-mem-backend-instead-of-specifying-a-url","errorCode":null,"errorMessage":"use the `mem` backend instead of specifying a URL of in-memory SQLite","messagePattern":"use the `mem` backend instead of specifying a URL of in-memory SQLite","errorType":"exception","errorClass":"MetaError","httpStatus":null,"severity":"error","filePath":"src/meta/src/controller/mod.rs","lineNumber":121,"sourceCode":"\n                let conn = sea_orm::Database::connect(options).await?;\n                Self {\n                    conn,\n                    endpoint: IN_MEMORY_STORE.to_owned(),\n                }\n            }\n            MetaStoreBackend::Sql { endpoint, config } => {\n                let mut options = ConnectOptions::new(endpoint.clone());\n                options\n                    .max_connections(config.max_connections)\n                    .min_connections(config.min_connections)\n                    .connect_timeout(Duration::from_secs(config.connection_timeout_sec))\n                    .idle_timeout(Duration::from_secs(config.idle_timeout_sec))\n                    .acquire_timeout(Duration::from_secs(config.acquire_timeout_sec));\n\n                if DbBackend::Sqlite.is_prefix_of(&endpoint) {\n                    if endpoint.contains(\":memory:\") || endpoint.contains(\"mode=memory\") {\n                        bail!(\n                            \"use the `mem` backend instead of specifying a URL of in-memory SQLite\"\n                        );\n                    }\n                    options.sqlite_common();\n                }\n\n                let conn = sea_orm::Database::connect(options).await?;\n                Self { conn, endpoint }\n            }\n        })\n    }\n\n    #[cfg(any(test, feature = \"test\"))]\n    pub async fn for_test() -> Self {\n        let this = Self::connect(MetaStoreBackend::Mem).await.unwrap();\n        Migrator::up(&this.conn, None).await.unwrap();\n        this\n    }","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/controller/mod.rs#L103-L139","documentation":"SqlMetaStore::connect explicitly rejects SQLite endpoints that point at an in-memory database (`:memory:` or `mode=memory`). In-memory SQLite is useless for the meta store because each pooled connection gets its own empty database, so users are directed to the dedicated `mem` backend instead.","triggerScenarios":"Configuring the meta store with a SQLite URL like `sqlite://:memory:` or containing `mode=memory` and calling connect().","commonSituations":"Dev/test config mistakes where someone points the meta backend at in-memory SQLite instead of using the built-in in-memory meta backend.","solutions":["Change the meta backend to `mem` (in-memory meta store) instead of an in-memory SQLite URL.","If persistence is needed, use a file-backed SQLite URL (e.g. `sqlite://path/to/meta.db`) or Postgres.","Update the RisingWave config `meta.with_backend`/endpoint accordingly and restart."],"exampleFix":"// before\nendpoint = \"sqlite://:memory:\"\n// after\nbackend = \"mem\"  // or endpoint = \"sqlite://./meta.db\" for persistence","handlingStrategy":"validation","validationCode":"fn valid_meta_endpoint(ep: &str) -> bool {\n    !(ep.starts_with(\"sqlite\") && (ep.contains(\":memory:\") || ep.contains(\"mode=memory\")))\n}","typeGuard":"fn is_in_memory_sqlite(ep: &str) -> bool {\n    ep.contains(\":memory:\") || ep.contains(\"mode=memory\")\n}","tryCatchPattern":null,"preventionTips":["Use the `mem` backend for in-memory runs, never in-memory SQLite URLs","Use file-backed SQLite or Postgres for persistent meta state","Validate the backend endpoint in CI before launching","Read risedev/config docs for supported meta backends"],"tags":["config","sqlite","meta-store"],"backgroundTag":"conflicting-config-options","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}