linera-io/linera-protocol · error · anyhow

the entry "{part}" is not matching

Error message

the entry "{part}" is not matching

What it means

Raised while parsing a `scylladb:` storage configuration in `StorageConfig::from_str` (linera-storage-runtime). Each segment after `scylladb:` must either be a `tcp` transport entry or start with `table` (the namespace). A segment matching neither shape hits this catch-all bail, with the offending segment echoed in the message.

Source

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

                            })?;
                            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,
            });
        }
        #[cfg(all(feature = "rocksdb", feature = "scylladb"))]
        if let Some(s) = input.strip_prefix(DUAL_ROCKS_DB_SCYLLA_DB) {
            let parts = s.split(':').collect::<Vec<_>>();
            if parts.len() != 5 && parts.len() != 6 {
                bail!(

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Use the documented shapes: transport as `tcp:host:port` and namespace prefixed with `table`, e.g. `scylladb:tcp:host:9042:table_my_ns`
  2. Prefix the namespace with `table` if it is missing
  3. Remove stray segments that belong to neither the URI nor the namespace

Example fix

# before
--storage scylladb:10.0.0.1:9042:my_ns

# after
--storage scylladb:tcp:10.0.0.1:9042:table_my_ns
Defensive patterns

Strategy: validation

Validate before calling

// Rust: verify every scylladb segment matches a known shape before FromStr
if let Some(rest) = storage_str.strip_prefix("scylladb:") {
    for part in rest.split(':') {
        anyhow::ensure!(
            part.starts_with("tcp") || part.starts_with("table"),
            "unrecognized scylladb segment '{part}' (expected tcp:... or table<namespace>)"
        );
    }
}

Prevention

When it happens

Trigger: Passing `scylladb:hostname`, `scylladb:9042:table_ns`, or a bare host string; forgetting the `table` prefix on the namespace; splitting a URI incorrectly so a stray fragment becomes its own segment.

Common situations: Assuming a plain `scylladb:host:port` URL form works; renaming namespaces without the `table` prefix; leftover punctuation from manual string edits.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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