linera-io/linera-protocol · error · anyhow
We should have one genesis config path and one optional…
Error message
We should have one genesis config path and one optional namespace
What it means
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.
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
Example fix
# before --storage memory:./genesis.json:my_ns:extra # after --storage memory:./genesis.json:my_ns
Defensive patterns
Strategy: validation
Validate before calling
// Rust: pre-validate a memory storage string before FromStr
fn is_valid_memory_config(s: &str) -> bool {
let Some(rest) = s.strip_prefix("memory:") else { return false };
let n = rest.split(':').count();
n == 1 || n == 2
} Prevention
- 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
When it happens
Trigger: 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 `:`).
Common situations: 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.
Related errors
- For DualRocksDbScyllaDb, the formatting has to be…
- For RocksDB, the formatting has to be rocksdb:directory or…
- For Storage service, the formatting has to be…
- the entry " " is not matching
- The namespace has already been assigned
AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22).
Data as JSON: /api/errors/22d8edc96756554c.
Report an issue: GitHub.
Appendix: source
Thrown at linera-storage-runtime/src/storage_config.rs:96
const DUAL_ROCKS_DB_SCYLLA_DB: &str = "dualrocksdbscylladb:";
impl FromStr for StorageConfig {
type Err = anyhow::Error;
fn from_str(input: &str) -> Result<Self, Self::Err> {
if let Some(s) = input.strip_prefix(MEMORY) {
let parts = s.split(':').collect::<Vec<_>>();
if parts.len() == 1 {
let genesis_path = parts[0].to_string().into();
let namespace = DEFAULT_NAMESPACE.to_string();
let inner_storage_config = InnerStorageConfig::Memory { genesis_path };
return Ok(StorageConfig {
inner_storage_config,
namespace,
});
}
if parts.len() != 2 {
bail!("We should have one genesis config path and one optional namespace");
}
let genesis_path = parts[0].to_string().into();
let namespace = parts[1].to_string();
let inner_storage_config = InnerStorageConfig::Memory { genesis_path };
return Ok(StorageConfig {
inner_storage_config,
namespace,
});
}
#[cfg(feature = "storage-service")]
if let Some(s) = input.strip_prefix(STORAGE_SERVICE) {
if s.is_empty() {
bail!(
"For Storage service, the formatting has to be service:endpoint:namespace,\
example service:tcp:127.0.0.1:7878:table_do_my_test"
);
}
let parts = s.split(':').collect::<Vec<_>>();View on GitHub (pinned to 6c226ddcb3)