zeroclaw-labs/zeroclaw · error · anyhow::Error

unknown catalog ' '; valid

Error message

unknown catalog '{name}'; valid: {valid}

What it means

Argument validation when parsing a comma-separated catalog list for docs-pipeline commands. Each name is looked up in zeroclaw_config::schema::FTL_CATALOGS; fires when a name is not a known Fluent catalog. The message enumerates the valid catalog names. This is a generic allowlist guard — correct the catalog name against the printed valid set.

Solutions

  1. Use one of the valid catalog names listed in the error message.
  2. Check for typos in the catalog name; names are case-sensitive.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/main.rs:3337 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/9e559578e1be4090. Report an issue: GitHub.

Appendix: source

Thrown at src/main.rs:3337

            let names: Vec<&str> = list
                .split(',')
                .map(str::trim)
                .filter(|s| !s.is_empty())
                .collect();
            let mut out = Vec::new();
            for name in &names {
                match zeroclaw_config::schema::FTL_CATALOGS
                    .iter()
                    .find(|(n, _, _)| n == name)
                {
                    Some(entry) => out.push(entry),
                    None => {
                        let valid = zeroclaw_config::schema::FTL_CATALOGS
                            .iter()
                            .map(|(n, _, _)| *n)
                            .collect::<Vec<_>>()
                            .join(", ");
                        bail!("unknown catalog '{name}'; valid: {valid}");
                    }
                }
            }
            out
        }
    };

    let dest = zeroclaw_config::schema::ftl_locale_dir(&locale)?;
    std::fs::create_dir_all(&dest).with_context(|| format!("creating {}", dest.display()))?;
    // Confinement check: the resolved dest must live under the data-dir FTL root.
    let ftl_root = dest
        .parent()
        .map(Path::to_path_buf)
        .unwrap_or_else(|| dest.clone());
    let canon_dest = std::fs::canonicalize(&dest).unwrap_or_else(|_| dest.clone());
    let canon_root = std::fs::canonicalize(&ftl_root).unwrap_or(ftl_root);
    if !canon_dest.starts_with(&canon_root) {
        bail!("refusing to write outside the FTL data directory");

View on GitHub (pinned to 88bb9c8533)