{"record":{"id":"d867cbc111689da4","repo":"linera-io/linera-protocol","slug":"for-rocksdb-the-formatting-has-to-be-rocksdb-dire","errorCode":null,"errorMessage":"For RocksDB, the formatting has to be rocksdb:directory or rocksdb:directory:spawn_mode:namespace","messagePattern":"For RocksDB, the formatting has to be rocksdb:directory or rocksdb:directory:spawn_mode:namespace","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"linera-storage-runtime/src/storage_config.rs","lineNumber":138,"sourceCode":"                bail!(\"Only allowed protocol is tcp\");\n            }\n            let endpoint = parts[1];\n            let port = parts[2];\n            let mut endpoint = endpoint.to_string();\n            endpoint.push(':');\n            endpoint.push_str(port);\n            let endpoint = endpoint.to_string();\n            let namespace = parts[3].to_string();\n            let inner_storage_config = InnerStorageConfig::Service { endpoint };\n            return Ok(StorageConfig {\n                inner_storage_config,\n                namespace,\n            });\n        }\n        #[cfg(feature = \"rocksdb\")]\n        if let Some(s) = input.strip_prefix(ROCKS_DB) {\n            if s.is_empty() {\n                bail!(\n                    \"For RocksDB, the formatting has to be rocksdb:directory or rocksdb:directory:spawn_mode:namespace\");\n            }\n            let parts = s.split(':').collect::<Vec<_>>();\n            if parts.len() == 1 {\n                let path = parts[0].to_string().into();\n                let namespace = DEFAULT_NAMESPACE.to_string();\n                let spawn_mode = RocksDbSpawnMode::SpawnBlocking;\n                let inner_storage_config = InnerStorageConfig::RocksDb { path, spawn_mode };\n                return Ok(StorageConfig {\n                    inner_storage_config,\n                    namespace,\n                });\n            }\n            if parts.len() == 2 || parts.len() == 3 {\n                let path = parts[0].to_string().into();\n                let spawn_mode_name = parts\n                    .get(1)\n                    .copied()","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-runtime/src/storage_config.rs#L120-L156","documentation":"Raised while parsing a `rocksdb:` storage configuration in `StorageConfig::from_str` (linera-storage-runtime, rocksdb feature). The string after the `rocksdb:` prefix is empty — no database directory was given. Accepted forms are `rocksdb:<directory>` or `rocksdb:<directory>:<spawn_mode>:<namespace>`.","triggerScenarios":"Passing exactly `rocksdb:` as the storage string; templating that substitutes an empty directory variable.","commonSituations":"Empty env vars or unset script variables feeding the `--storage rocksdb:$DB_PATH` argument.","solutions":["Provide the database directory: `rocksdb:/tmp/linera-db`","Check the variable expansion that produced the empty path"],"exampleFix":"# before\n--storage rocksdb:\n\n# after\n--storage rocksdb:/tmp/linera-db","handlingStrategy":"validation","validationCode":"// Rust: reject an empty rocksdb path before FromStr\nif storage_str == \"rocksdb:\" {\n    anyhow::bail!(\"rocksdb storage needs a directory: rocksdb:/path/to/db\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fail fast on empty directory variables before building the storage string","Default to a concrete temp directory in test scripts"],"tags":["config","parsing","rocksdb","linera-storage"],"backgroundTag":"connection-string-parse-error","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}