{"record":{"id":"d2171b7a502c786f","repo":"linera-io/linera-protocol","slug":"cannot-apply-default-storage-because-the-feature","errorCode":null,"errorMessage":"Cannot apply default storage because the feature 'rocksdb' was not selected","messagePattern":"Cannot apply default storage because the feature 'rocksdb' was not selected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-service/src/cli/common_options.rs","lineNumber":94,"sourceCode":"        let storage_env_var = env::var(format!(\"LINERA_STORAGE{suffix}\")).ok();\n        if let Some(config) = storage_env_var {\n            return config.parse();\n        }\n        cfg_if::cfg_if! {\n            if #[cfg(feature = \"rocksdb\")] {\n                let spawn_mode =\n                    linera_views::rocks_db::RocksDbSpawnMode::get_spawn_mode_from_runtime();\n                let inner_storage_config = crate::storage::InnerStorageConfig::RocksDb {\n                    path: linera_wallet_json::paths::config_dir()?.join(\"wallet.db\"),\n                    spawn_mode,\n                };\n                let namespace = linera_storage::DEFAULT_NAMESPACE.to_string();\n                Ok(StorageConfig {\n                    inner_storage_config,\n                    namespace,\n                })\n            } else {\n                bail!(\"Cannot apply default storage because the feature 'rocksdb' was not selected\");\n            }\n        }\n    }\n\n    /// Returns the path to the wallet file.\n    pub fn wallet_path(&self) -> Result<PathBuf, Error> {\n        linera_wallet_json::paths::wallet_path(self.wallet_state_path.as_ref(), &self.suffix())\n    }\n\n    /// Returns the path to the keystore file.\n    pub fn keystore_path(&self) -> Result<PathBuf, Error> {\n        linera_wallet_json::paths::keystore_path(self.keystore_path.as_ref(), &self.suffix())\n    }\n\n    /// Reads and returns the wallet.\n    pub fn wallet(&self) -> Result<Wallet, Error> {\n        Ok(Wallet::read(&self.wallet_path()?)?)\n    }","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/common_options.rs#L76-L112","documentation":"CommonCliOptions::storage_config() resolves storage in order: --storage CLI arg, then LINERA_STORAGE(_SUFFIX) env var, then a RocksDB default — but the default is only compiled in when the 'rocksdb' feature of linera-service is enabled. This build was made without that feature and neither the flag nor env var was provided, so there is no storage backend to fall back to and the CLI bails.","triggerScenarios":"Running any wallet/storage-dependent linera CLI command on a binary built with default-features=false (or with rocksdb disabled), without passing --storage <config> and without LINERA_STORAGE set. Common with minimal/DynamoDB-only builds used against remote storage.","commonSituations":"Custom builds or Docker images built with a trimmed feature set; CI jobs reusing a binary compiled for a different storage target; users following docs written against the default (rocksdb-enabled) build.","solutions":["Pass an explicit storage config, e.g. --storage rocksdb:~/my.db:classifier or --storage dynamodb:... matching your backend (or the equivalent service config string).","Set the LINERA_STORAGE environment variable to the same config string (respects wallet suffixes like LINERA_STORAGE_MYWALLET).","Or rebuild/install the binary with the rocksdb feature enabled to get the default wallet.db storage back.","If distributing custom builds, document the required --storage flag in your runbooks."],"exampleFix":"# before\n$ linera wallet create ... # bails: feature 'rocksdb' not selected\n\n# after\n$ export LINERA_STORAGE=\"rocksdb:$HOME/.config/linera/wallet.db:benchmark\"\n$ linera wallet create ...\n# or per-invocation:\n$ linera --storage rocksdb:/tmp/wallet.db:benchmark wallet create ...","handlingStrategy":"validation","validationCode":"// In deployment scripts, fail fast when neither source is set:\n: \"${LINERA_STORAGE:?this build lacks the rocksdb default; set LINERA_STORAGE or pass --storage}\"","typeGuard":null,"tryCatchPattern":"// Nothing to catch at runtime: fix invocation (pass --storage / set env) or rebuild with the feature.","preventionTips":["Always set LINERA_STORAGE explicitly in scripts instead of relying on the compiled-in default.","Document required cargo features for custom builds of linera-service."],"tags":["linera-service","cli","storage","feature-flags","configuration","rust"],"backgroundTag":"missing-feature-flag","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}