{"record":{"id":"20929629ef8ab79d","repo":"linera-io/linera-protocol","slug":"the-namespace-has-already-been-assigned","errorCode":null,"errorMessage":"The namespace has already been assigned","messagePattern":"The namespace has already been assigned","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"linera-storage-runtime/src/storage_config.rs","lineNumber":205,"sourceCode":"                            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                            }\n                            namespace = Some(part.to_string());\n                        }\n                        _ => {\n                            bail!(\"the entry \\\"{part}\\\" is not matching\");\n                        }\n                    }\n                }\n            }\n            let uri = uri.unwrap_or_else(|| \"localhost:9042\".to_string());\n            let namespace = namespace.unwrap_or_else(|| DEFAULT_NAMESPACE.to_string());\n            let inner_storage_config = InnerStorageConfig::ScyllaDb { uri };\n            debug!(\"ScyllaDB connection info: {:?}\", inner_storage_config);\n            return Ok(StorageConfig {\n                inner_storage_config,\n                namespace,\n            });\n        }","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-runtime/src/storage_config.rs#L187-L223","documentation":"Raised while parsing a `scylladb:` storage configuration in `StorageConfig::from_str` (linera-storage-runtime). The parser assigns the namespace from the (single) `table`-prefixed entry; a second `table*` segment means the namespace was already set, which is rejected.","triggerScenarios":"Passing `scylladb:tcp:host:9042:table_ns1:table_ns2` — two table-prefixed namespace entries in one config string.","commonSituations":"Composing the storage string from variables where a default namespace is appended even though one was already provided; concatenating config fragments.","solutions":["Keep only one `table_<namespace>` entry","Check for a script/template that appends a default namespace unconditionally"],"exampleFix":"# before\n--storage scylladb:tcp:host:9042:table_ns1:table_ns2\n\n# after\n--storage scylladb:tcp:host:9042:table_ns1","handlingStrategy":"validation","validationCode":"// Rust: reject duplicate table* namespaces in a scylladb string before FromStr\nif let Some(rest) = storage_str.strip_prefix(\"scylladb:\") {\n    let ns_count = rest.split(':').filter(|p| p.starts_with(\"table\")).count();\n    anyhow::ensure!(ns_count <= 1, \"scylladb config allows at most one table_ namespace\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide at most one table-prefixed namespace","Guard templates that append a default namespace — skip it when one is already present"],"tags":["config","parsing","scylladb","linera-storage"],"backgroundTag":"duplicate-config-key","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}