{"record":{"id":"255d121fa29fe0ea","repo":"linera-io/linera-protocol","slug":"we-should-have-one-endpoint-and-one-namespace","errorCode":null,"errorMessage":"We should have one endpoint and one namespace","messagePattern":"We should have one endpoint and one namespace","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"linera-storage-runtime/src/storage_config.rs","lineNumber":116,"sourceCode":"            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<_>>();\n            if parts.len() != 4 {\n                bail!(\"We should have one endpoint and one namespace\");\n            }\n            let protocol = parts[0];\n            if protocol != \"tcp\" {\n                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        }","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-runtime/src/storage_config.rs#L98-L134","documentation":"Raised while parsing a `service:` storage configuration in `StorageConfig::from_str` (linera-storage-runtime, storage-service feature). After `service:` the remainder is split on ':' and must yield exactly 4 parts (protocol, endpoint/host, port, namespace). Any other count — typically a missing namespace or an extra colon — bails here.","triggerScenarios":"Passing `service:tcp:127.0.0.1:7878` (namespace omitted); `service:tcp:127.0.0.1:7878:ns:extra` (5 parts); an IPv6 endpoint whose colons break the naive split.","commonSituations":"Forgetting the trailing namespace when switching from another backend; changing the endpoint and dropping the last segment; endpoints with colons that the ':'-based parser cannot represent.","solutions":["Append the missing namespace: `service:tcp:127.0.0.1:7878:table_my_test`","Remove any extra colon-separated segment","Use an IPv4 host or hostname without colons for the endpoint"],"exampleFix":"# before\n--storage service:tcp:127.0.0.1:7878\n\n# after\n--storage service:tcp:127.0.0.1:7878:table_do_my_test","handlingStrategy":"validation","validationCode":"// Rust: count service segments before FromStr\nfn is_valid_service_config(s: &str) -> bool {\n    match s.strip_prefix(\"service:\") {\n        Some(rest) => rest.split(':').count() == 4,\n        None => false,\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["The namespace is mandatory for service storage — always end with :table_<namespace>","Avoid colons in hostnames/namespaces (no IPv6 literals)"],"tags":["config","parsing","storage-service","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"}