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

memory connector {name} path is not a directory: {}

Error message

memory connector {name} path is not a directory: {}

What it means

Thrown by `sync_jsonl_directory_memory_connector` immediately after the empty-path check: `settings.path` is non-empty but `is_dir()` returns false. The connector expects to walk a directory of JSONL files; pointing it at a regular file (or a non-existent path) is rejected before `collect_jsonl_paths` runs. The message interpolates the offending path via `settings.path.display()`.

Source

Thrown at ecc2/src/main.rs:3126

        limit,
    )?;
    if stats.records_read < limit {
        db.upsert_connector_source_checkpoint(name, &source_path, &signature)?;
    }
    Ok(stats)
}

fn sync_jsonl_directory_memory_connector(
    db: &session::store::StateStore,
    name: &str,
    settings: &config::MemoryConnectorJsonlDirectoryConfig,
    limit: usize,
) -> Result<GraphConnectorSyncStats> {
    if settings.path.as_os_str().is_empty() {
        anyhow::bail!("memory connector {name} has no path configured");
    }
    if !settings.path.is_dir() {
        anyhow::bail!(
            "memory connector {name} path is not a directory: {}",
            settings.path.display()
        );
    }

    let paths = collect_jsonl_paths(&settings.path, settings.recurse)?;
    let default_session_id = settings
        .session_id
        .as_deref()
        .map(|value| resolve_session_id(db, value))
        .transpose()?;

    let mut stats = GraphConnectorSyncStats {
        connector_name: name.to_string(),
        ..Default::default()
    };

    let mut remaining = limit;

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Point `path` at a directory: create one and move JSONL files into it if needed.
  2. If you only have one file, switch the connector type to `jsonl_file`.
  3. Use an absolute path to avoid working-directory ambiguity.

Example fix

// before
[memory_connectors.logs]
type = "jsonl_directory"
path = "/home/user/.ecc/logs/log.jsonl"

// after
[memory_connectors.logs]
type = "jsonl_directory"
path = "/home/user/.ecc/logs"
Defensive patterns

Strategy: validation

Validate before calling

fn ensure_directory(path: &Path, name: &str) -> Result<()> {
    if !path.is_dir() {
        anyhow::bail!("connector {name}: not a directory: {}", path.display());
    }
    Ok(())
}

ensure_directory(&settings.path, name)?;

Prevention

When it happens

Trigger: Configuring `jsonl_directory` with a path to a single `.jsonl` file rather than a directory. Typo in the directory path. Relative path resolved against an unexpected working directory. The directory was moved/deleted after config was written.

Common situations: Confusing the `jsonl_file` and `jsonl_directory` connector types. Stale config after a filesystem reorganization. Relative paths interpreted differently by systemd/launchd vs an interactive shell.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/c823380b7f4b42c2. Report an issue: GitHub.