{"record":{"id":"6b5b63bccbc60fbf","repo":"linera-io/linera-protocol","slug":"cannot-run-admin-operations-on-the-memory-store","errorCode":null,"errorMessage":"Cannot run admin operations on the memory store","messagePattern":"Cannot run admin operations on the memory store","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-storage-runtime/src/store_config.rs","lineNumber":204,"sourceCode":"                Ok(job.run(storage).await)\n            }\n        }\n    }\n\n    /// Connects to the configured key-value store and runs the given\n    /// [`RunnableWithStore`] job against it.\n    #[allow(unused_variables)]\n    pub async fn run_with_store<Job>(\n        self,\n        cache_sizes: StorageCacheConfig,\n        job: Job,\n    ) -> Result<Job::Output, anyhow::Error>\n    where\n        Job: RunnableWithStore,\n    {\n        match self {\n            StoreConfig::Memory { .. } => {\n                Err(anyhow!(\"Cannot run admin operations on the memory store\"))\n            }\n            #[cfg(feature = \"storage-service\")]\n            StoreConfig::StorageService { config, namespace } => Ok(job\n                .run::<StorageServiceDatabase>(config, namespace, cache_sizes)\n                .await?),\n            #[cfg(feature = \"rocksdb\")]\n            StoreConfig::RocksDb { config, namespace } => Ok(job\n                .run::<RocksDbDatabase>(config, namespace, cache_sizes)\n                .await?),\n            #[cfg(feature = \"scylladb\")]\n            StoreConfig::ScyllaDb { config, namespace } => Ok(job\n                .run::<ScyllaDbDatabase>(config, namespace, cache_sizes)\n                .await?),\n            #[cfg(all(feature = \"rocksdb\", feature = \"scylladb\"))]\n            StoreConfig::DualRocksDbScyllaDb { config, namespace } => Ok(job\n                .run::<DualDatabase<RocksDbDatabase, ScyllaDbDatabase, ChainStatesFirstAssignment>>(\n                    config,\n                    namespace,","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-runtime/src/store_config.rs#L186-L222","documentation":"StoreConfig::run_with_store executes admin jobs (RunnableWithStore implementations such as storage initialization/migration) against the configured database. The Memory variant is an in-process, non-persistent store, so admin operations on it are meaningless and rejected outright with this error instead of silently no-op'ing.","triggerScenarios":"Calling an admin entry point (e.g. linera-db initialize/migration flows that route through run_with_store) with --storage memory:... . Everything except the Memory variant — storage-service, rocksdb, scylladb, dual — proceeds normally.","commonSituations":"Copy-pasting a dev quickstart that uses memory storage into an admin command; scripts defaulting to memory for local tests; forgetting to switch the storage flag when moving from running a node to maintaining its database.","solutions":["Point the admin command at persistent storage: --storage rocksdb:<path>, scylladb:..., service:... or dualrocksdbscylladb:...","If you were only testing the tool, keep memory storage for node runs but not for admin operations","Check the default storage value of the command — defaults are often memory, so an omitted flag triggers this"],"exampleFix":"# before\n--storage memory:main.json (admin command)\n# after\n--storage rocksdb:/tmp/linera-db","handlingStrategy":"validation","validationCode":"// Rust: refuse admin jobs on memory storage before calling run_with_store\nmatch &store_config {\n    StoreConfig::Memory { .. } => {\n        return Err(anyhow::anyhow!(\"admin operations need persistent storage; pass rocksdb:/scylladb:/service:/dualrocksdbscylladb: config\"));\n    }\n    _ => {}\n}\nstore_config.run_with_store(cache_sizes, job).await","typeGuard":"fn supports_admin_ops(cfg: &StoreConfig) -> bool {\n    !matches!(cfg, StoreConfig::Memory { .. })\n}","tryCatchPattern":"if let Err(e) = store_config.run_with_store(cache_sizes, job).await {\n    if e.to_string().contains(\"memory store\") {\n        eprintln!(\"re-run with a persistent --storage config\");\n    }\n    return Err(e);\n}","preventionTips":["Make admin CLI subcommands require a persistent storage value instead of defaulting to memory","Document that memory storage is for ephemeral test runs only","Add a preflight check that rejects memory configs in deployment scripts before they reach admin commands"],"tags":["linera","storage","memory","admin","config"],"backgroundTag":"unsupported-backend-operation","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}