linera-io/linera-protocol · error

The input has not matched: {input}

Error message

The input has not matched: {input}

What it means

StorageConfig::from_str dispatches on the config-string prefix: 'memory:', 'service:', 'rocksdb:', 'scylladb:' or 'dualrocksdbscylladb:'. If none matches (or the matching backend was not compiled into this binary, because its cargo feature is off), from_str logs the available backends via tracing error! and returns this error echoing the input.

Source

Thrown at linera-storage-runtime/src/storage_config.rs:278

                DEFAULT_NAMESPACE.to_string()
            } else {
                parts[5].to_string()
            };
            return Ok(StorageConfig {
                inner_storage_config,
                namespace,
            });
        }
        error!("available storage: memory");
        #[cfg(feature = "storage-service")]
        error!("Also available is linera-storage-service");
        #[cfg(feature = "rocksdb")]
        error!("Also available is RocksDB");
        #[cfg(feature = "scylladb")]
        error!("Also available is ScyllaDB");
        #[cfg(all(feature = "rocksdb", feature = "scylladb"))]
        error!("Also available is DualRocksDbScyllaDb");
        Err(anyhow!("The input has not matched: {input}"))
    }
}

impl StorageConfig {
    /// Appends a shard-specific subdirectory to the storage path, if applicable.
    #[allow(unused_variables)]
    pub fn maybe_append_shard_path(&mut self, shard: usize) -> std::io::Result<()> {
        match &mut self.inner_storage_config {
            #[cfg(all(feature = "rocksdb", feature = "scylladb"))]
            InnerStorageConfig::DualRocksDbScyllaDb {
                path_with_guard,
                spawn_mode: _,
                uri: _,
            } => {
                let shard_str = format!("shard_{shard}");
                path_with_guard.path_buf.push(shard_str);
                std::fs::create_dir_all(&path_with_guard.path_buf)
            }

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Start the string with one of the supported prefixes: memory:, service:, rocksdb:, scylladb: or dualrocksdbscylladb:
  2. If the prefix looks right, check the binary actually has the backend compiled in — the error! lines printed just before this error list exactly which backends this build supports
  3. Run with tracing/RUST_LOG visible so the 'available storage' hints are shown

Example fix

# before
--storage /tmp/linera-db
# after
--storage rocksdb:/tmp/linera-db
Defensive patterns

Strategy: validation

Validate before calling

// Rust: check the prefix before calling from_str
const KNOWN_PREFIXES: &[&str] = &["memory:", "service:", "rocksdb:", "scylladb:", "dualrocksdbscylladb:"];

if !KNOWN_PREFIXES.iter().any(|p| input.starts_with(p)) {
    anyhow::bail!("unknown storage config {input:?}; expected one of {KNOWN_PREFIXES:?}");
}

Type guard

fn has_known_storage_prefix(s: &str) -> bool {
    s.starts_with("memory:") || s.starts_with("service:") || s.starts_with("rocksdb:")
        || s.starts_with("scylladb:") || s.starts_with("dualrocksdbscylladb:")
}

Try / catch

let config = StorageConfig::from_str(&input)
    .with_context(|| format!("could not parse storage config {input:?}; check prefix and compiled features"))?;

Prevention

When it happens

Trigger: Passing --storage with an unknown prefix such as 'rocksdb2:...' or 'db:...', a bare path like '/tmp/linera', or a valid prefix whose backend feature is disabled in the build (e.g. 'rocksdb:...' on a binary compiled without the rocksdb feature).

Common situations: Typos in the prefix; assuming a bare directory works; using a binary from a different distribution that ships a reduced feature set; docs describing a backend the installed build lacks.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/a4b5a73847befc9c. Report an issue: GitHub.