affaan-m/ECC · error · anyhow::Error

Unknown memory connector

Error message

Unknown memory connector: {name}

What it means

Raised in `sync_memory_connector` when the given connector `name` is not a key of `cfg.memory_connectors`. The function resolves the name against the loaded configuration before dispatching to the connector-specific sync implementation; unknown names fail fast with this message naming the offending value.

Solutions

  1. Open the active `config.toml` and check the exact keys under `[memory_connectors]`.
  2. Fix the name in the command to match the config key exactly.
  3. Verify which config file is loaded (e.g. `--config` flag or ECC home override).
  4. Add the missing connector definition to `[memory_connectors]` if it was never configured.

Example fix

// before
$ ecc memory sync --connector note-files
error: Unknown memory connector: note-files
// after
# config.toml: [memory_connectors.notes_jsonl]
$ ecc memory sync --connector notes_jsonl
Defensive patterns

Strategy: validation

Validate before calling

# Check the connector is configured before syncing
if ! grep -q "\[memory_connectors.$NAME\]" config.toml; then
  echo "connector '$NAME' not in config.toml [memory_connectors]" >&2; exit 2
fi

Try / catch

match sync_memory_connector(&db, &cfg, name, limit) {
    Err(e) if e.to_string().starts_with("Unknown memory connector") => {
        eprintln!("available: {:?}", cfg.memory_connectors.keys().collect::<Vec<_>>());
    }
    Err(e) => return Err(e),
    Ok(stats) => println!("{:?}", stats),
}

Prevention

When it happens

Trigger: Running connector sync with `--connector <name>` where `name` is misspelled, was renamed in `config.toml`, or the connector was removed from `[memory_connectors]`; also when ECC loaded a different config file than the one containing the connector.

Common situations: Typos in connector names; forgetting that names are the TOML keys under `memory_connectors`; switching profiles/configs so the connector definition isn't loaded; renaming a connector in config but not in scripts.

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 affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/8e2f03d7793a9169. Report an issue: GitHub.

Appendix: source

Thrown at ecc2/src/main.rs:2942

) -> Result<()> {
    db.refresh_session_durations()?;
    db.sync_cost_tracker_metrics(&cfg.cost_metrics_path())?;
    db.sync_tool_activity_metrics(&cfg.tool_activity_metrics_path())?;
    let _ = session::manager::enforce_session_heartbeats(db, cfg)?;
    let _ = session::manager::enforce_budget_hard_limits(db, cfg)?;
    Ok(())
}

fn sync_memory_connector(
    db: &session::store::StateStore,
    cfg: &config::Config,
    name: &str,
    limit: usize,
) -> Result<GraphConnectorSyncStats> {
    let connector = cfg
        .memory_connectors
        .get(name)
        .ok_or_else(|| anyhow::anyhow!("Unknown memory connector: {name}"))?;

    match connector {
        config::MemoryConnectorConfig::JsonlFile(settings) => {
            sync_jsonl_memory_connector(db, name, settings, limit)
        }
        config::MemoryConnectorConfig::JsonlDirectory(settings) => {
            sync_jsonl_directory_memory_connector(db, name, settings, limit)
        }
        config::MemoryConnectorConfig::MarkdownFile(settings) => {
            sync_markdown_memory_connector(db, name, settings, limit)
        }
        config::MemoryConnectorConfig::MarkdownDirectory(settings) => {
            sync_markdown_directory_memory_connector(db, name, settings, limit)
        }
        config::MemoryConnectorConfig::DotenvFile(settings) => {
            sync_dotenv_memory_connector(db, name, settings, limit)
        }
    }

View on GitHub (pinned to 8321021c54)