{"record":{"id":"22d8edc96756554c","repo":"linera-io/linera-protocol","slug":"we-should-have-one-genesis-config-path-and-one-opt","errorCode":null,"errorMessage":"We should have one genesis config path and one optional namespace","messagePattern":"We should have one genesis config path and one optional namespace","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"linera-storage-runtime/src/storage_config.rs","lineNumber":96,"sourceCode":"const DUAL_ROCKS_DB_SCYLLA_DB: &str = \"dualrocksdbscylladb:\";\n\nimpl FromStr for StorageConfig {\n    type Err = anyhow::Error;\n\n    fn from_str(input: &str) -> Result<Self, Self::Err> {\n        if let Some(s) = input.strip_prefix(MEMORY) {\n            let parts = s.split(':').collect::<Vec<_>>();\n            if parts.len() == 1 {\n                let genesis_path = parts[0].to_string().into();\n                let namespace = DEFAULT_NAMESPACE.to_string();\n                let inner_storage_config = InnerStorageConfig::Memory { genesis_path };\n                return Ok(StorageConfig {\n                    inner_storage_config,\n                    namespace,\n                });\n            }\n            if parts.len() != 2 {\n                bail!(\"We should have one genesis config path and one optional namespace\");\n            }\n            let genesis_path = parts[0].to_string().into();\n            let namespace = parts[1].to_string();\n            let inner_storage_config = InnerStorageConfig::Memory { genesis_path };\n            return Ok(StorageConfig {\n                inner_storage_config,\n                namespace,\n            });\n        }\n        #[cfg(feature = \"storage-service\")]\n        if let Some(s) = input.strip_prefix(STORAGE_SERVICE) {\n            if s.is_empty() {\n                bail!(\n                    \"For Storage service, the formatting has to be service:endpoint:namespace,\\\nexample service:tcp:127.0.0.1:7878:table_do_my_test\"\n                );\n            }\n            let parts = s.split(':').collect::<Vec<_>>();","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-runtime/src/storage_config.rs#L78-L114","documentation":"Raised while parsing a `memory:` storage configuration string in `StorageConfig::from_str` (linera-storage-runtime). The in-memory backend expects `memory:<genesis_config_path>` or `memory:<genesis_config_path>:<namespace>`; after splitting on ':', anything other than exactly 1 or 2 parts is rejected. This bail fires when 3+ colon-separated segments follow the prefix.","triggerScenarios":"Passing a storage string like `memory:/path/genesis.json:my_ns:extra`, `memory:a:b:c`, or a path/namespace that itself contains colons (e.g. `memory:C:\\gen.json:ns` on Windows, or a namespace containing `:`).","commonSituations":"Typos or trailing colons in `--storage memory:...` CLI arguments; namespaces containing colons; Windows drive-letter paths combined with an explicit namespace; scripts concatenating storage strings with an extra separator.","solutions":["Use the exact form `memory:<genesis_path>` or `memory:<genesis_path>:<namespace>`","Remove any extra colon-separated segment from the string","Choose a namespace without ':' characters","On Windows, double-check that the drive-letter colon is not followed by another colon"],"exampleFix":"# before\n--storage memory:./genesis.json:my_ns:extra\n\n# after\n--storage memory:./genesis.json:my_ns","handlingStrategy":"validation","validationCode":"// Rust: pre-validate a memory storage string before FromStr\nfn is_valid_memory_config(s: &str) -> bool {\n    let Some(rest) = s.strip_prefix(\"memory:\") else { return false };\n    let n = rest.split(':').count();\n    n == 1 || n == 2\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the form: memory:<genesis_path>[:<namespace>] — nothing more","Avoid ':' in namespaces and be careful on Windows drive-letter paths","Log the exact storage string at startup so misparses are obvious"],"tags":["config","parsing","memory-storage","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"}