{"record":{"id":"75df463a2495e965","repo":"linera-io/linera-protocol","slug":"failed-to-find-address-for-s-parse-error","errorCode":null,"errorMessage":"Failed to find address for {s}. {parse_error}","messagePattern":"Failed to find address for (.+?)\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-storage-runtime/src/storage_config.rs","lineNumber":188,"sourceCode":"                return Ok(StorageConfig {\n                    inner_storage_config,\n                    namespace,\n                });\n            }\n            bail!(\"We should have one, two or three parts\");\n        }\n        #[cfg(feature = \"scylladb\")]\n        if let Some(s) = input.strip_prefix(SCYLLA_DB) {\n            let mut uri: Option<String> = None;\n            let mut namespace: Option<String> = None;\n            let parse_error: &'static str = \"Correct format is tcp:db_hostname:port.\";\n            if !s.is_empty() {\n                let mut parts = s.split(':');\n                while let Some(part) = parts.next() {\n                    match part {\n                        \"tcp\" => {\n                            let address = parts.next().ok_or_else(|| {\n                                anyhow!(\"Failed to find address for {s}. {parse_error}\")\n                            })?;\n                            let port_str = parts.next().ok_or_else(|| {\n                                anyhow!(\"Failed to find port for {s}. {parse_error}\")\n                            })?;\n                            let port = NonZeroU16::from_str(port_str).map_err(|_| {\n                                anyhow!(\n                                    \"Failed to find parse port {port_str} for {s}. {parse_error}\",\n                                )\n                            })?;\n                            if uri.is_some() {\n                                bail!(\"The uri has already been assigned\");\n                            }\n                            uri = Some(format!(\"{address}:{port}\"));\n                        }\n                        _ if part.starts_with(\"table\") => {\n                            if namespace.is_some() {\n                                bail!(\"The namespace has already been assigned\");\n                            }","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-runtime/src/storage_config.rs#L170-L206","documentation":"For scylladb storage URLs, StorageConfig::from_str splits the part after 'scylladb:' on ':' and processes 'tcp' segments that must contain a hostname and a port. This error means a 'tcp' token was found but the expected address token after it is missing, i.e. the string ends right after 'tcp' or 'tcp:'.","triggerScenarios":"Passing --storage 'scylladb:tcp' or 'scylladb:tcp:' with no hostname. Correct form is 'scylladb:tcp:db_hostname:port' (optionally plus a table namespace, e.g. 'scylladb:tcp:host:9042:table_my_ns').","commonSituations":"Truncated URL from shell history editing; assuming the port alone suffices; copy-paste from configs of other tools that use 'tcp://' style URLs.","solutions":["Provide the full endpoint: --storage scylladb:tcp:hostname:9042","If you only wanted the defaults, drop the tcp part entirely — with no tcp segment the config defaults to localhost:9042","Append an optional namespace segment as 'table_<name>' after the port if multiple shards/namespaces share the cluster"],"exampleFix":"# before\n--storage scylladb:tcp:\n# after\n--storage scylladb:tcp:db.example.com:9042","handlingStrategy":"validation","validationCode":"// Rust: structural check for scylladb tcp segments before calling from_str\nfn scylla_segments_ok(s: &str) -> bool {\n    let mut parts = s.split(':');\n    while let Some(part) = parts.next() {\n        if part == \"tcp\" {\n            let addr = parts.next().unwrap_or(\"\");\n            let port = parts.next().unwrap_or(\"\");\n            if addr.is_empty() || port.is_empty() { return false; }\n            if port.parse::<u16>().map(|p| p == 0).unwrap_or(true) { return false; }\n        }\n    }\n    true\n}","typeGuard":"fn is_valid_scylla_config(s: &str) -> bool { s.is_empty() || scylla_segments_ok(s) }","tryCatchPattern":"match StorageConfig::from_str(&input) {\n    Ok(cfg) => Ok(cfg),\n    Err(e) => Err(format!(\"invalid scylladb storage config {input:?}: {e:#}\")),\n}","preventionTips":["Template your storage strings: scylladb:tcp:<host>:<port>[:table_<namespace>] and lint them in config management","Prefer omitting the tcp segment to get the documented localhost:9042 default in dev setups","Reject empty hostname or port tokens early in any tooling that assembles these strings"],"tags":["linera","storage","scylladb","config","parsing","connection-string"],"backgroundTag":"connection-string-parse-error","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}