linera-io/linera-protocol · error · anyhow
The namespace has already been assigned
Error message
The namespace has already been assigned
What it means
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.
Source
Thrown at linera-storage-runtime/src/storage_config.rs:205
let address = parts.next().ok_or_else(|| {
anyhow!("Failed to find address for {s}. {parse_error}")
})?;
let port_str = parts.next().ok_or_else(|| {
anyhow!("Failed to find port for {s}. {parse_error}")
})?;
let port = NonZeroU16::from_str(port_str).map_err(|_| {
anyhow!(
"Failed to find parse port {port_str} for {s}. {parse_error}",
)
})?;
if uri.is_some() {
bail!("The uri has already been assigned");
}
uri = Some(format!("{address}:{port}"));
}
_ if part.starts_with("table") => {
if namespace.is_some() {
bail!("The namespace has already been assigned");
}
namespace = Some(part.to_string());
}
_ => {
bail!("the entry \"{part}\" is not matching");
}
}
}
}
let uri = uri.unwrap_or_else(|| "localhost:9042".to_string());
let namespace = namespace.unwrap_or_else(|| DEFAULT_NAMESPACE.to_string());
let inner_storage_config = InnerStorageConfig::ScyllaDb { uri };
debug!("ScyllaDB connection info: {:?}", inner_storage_config);
return Ok(StorageConfig {
inner_storage_config,
namespace,
});
}View on GitHub (pinned to 6c226ddcb3)
Solutions
- Keep only one `table_<namespace>` entry
- Check for a script/template that appends a default namespace unconditionally
Example fix
# before --storage scylladb:tcp:host:9042:table_ns1:table_ns2 # after --storage scylladb:tcp:host:9042:table_ns1
Defensive patterns
Strategy: validation
Validate before calling
// Rust: reject duplicate table* namespaces in a scylladb string before FromStr
if let Some(rest) = storage_str.strip_prefix("scylladb:") {
let ns_count = rest.split(':').filter(|p| p.starts_with("table")).count();
anyhow::ensure!(ns_count <= 1, "scylladb config allows at most one table_ namespace");
} Prevention
- Provide at most one table-prefixed namespace
- Guard templates that append a default namespace — skip it when one is already present
When it happens
Trigger: Passing `scylladb:tcp:host:9042:table_ns1:table_ns2` — two table-prefixed namespace entries in one config string.
Common situations: Composing the storage string from variables where a default namespace is appended even though one was already provided; concatenating config fragments.
Related errors
- The uri has already been assigned
- the entry "{part}" is not matching
- For DualRocksDbScyllaDb, the formatting has to be dualrocksd
- We should have one genesis config path and one optional name
- For Storage service, the formatting has to be service:endpoi
AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22).
Data as JSON: /api/errors/20929629ef8ab79d.
Report an issue: GitHub.